Compare commits

..

1 Commits

Author SHA1 Message Date
Matthias Clasen 8e9c6171b6 3.24.26 2021-02-23 09:31:37 -05:00
160 changed files with 78679 additions and 35960 deletions
-2
View File
@@ -79,8 +79,6 @@ msys2-mingw64-meson:
name: "gtk3-${env:CI_JOB_NAME}-${env:CI_COMMIT_REF_NAME}"
paths:
- "_build/meson-logs"
- "_build/gdk/libgdk-3-0.dll"
- "_build/gtk/libgtk-3-0.dll"
msys2-mingw64-autotools:
when: manual
+1 -1
View File
@@ -15,7 +15,7 @@ meson \
-Dx11_backend=true \
-Dwayland_backend=true \
-Dxinerama=yes \
-Dprint_backends="file,lpr,test,cups" \
-Dprint_backends="file,lpr,test,cloudprint,cups" \
${EXTRA_MESON_FLAGS:-} \
_build
-154
View File
@@ -1,157 +1,3 @@
Overview of Changes in GTK+ 3.24.30
===================================
* Input:
- Ignore NoSymbol key events (happens with some XKB options)
- Fix incomplete reset in some cases
* GtkEmojiChooser:
- Update data from CLDR 39
- Support translated keywords for multiple languages
- Allow inserting multiple Emoji with Ctrl
- Match keywords for search
- Fix a memory leak
* GtkFileChooser:
- Accessibility improvements
* GtkTreeView
- Fix an accessibility-related memory leak
- Fix assertion failures in some cases
* Printing:
- Remove the Google Cloud Print backend, since the
service was shut down
* Wayland:
- Work with pointer-gestures v1 protocol
* Win32:
- Fix using GL with Mesa drivers
- Add support for Windows Pointer Input stack
* MacOS:
- Fix a crash with Drag-and-Drop
* Translation updates:
Belarusian
Brazilian Portuguese
British English
Catalan
Indonesian
Lithuanian
Nepali
Norwegian Bokmål
Occitan
Portuguese
Romanian
Russian
Serbian
Slovenian
Spanish
Turkish
Ukrainian
Overview of Changes in GTK+ 3.24.29
===================================
* Input:
- Look for a Compose file in the right place (~/.config/gtk-3.0)
- Revert some Compose sequence changes (mainly around dead
acute and apostrophe)
- Consume all key events during preedit, to avoid unexpected
interactions
- Ignore more modifiers during preedit, to allow using 3rd and
5th level choosers
- Fix handling of cursor positions in non-ASCII preedit text
* GtkSpinButton:
- Interpret localized digits
* GtkScale:
- Fix sporadic criticals
* GtkScrolledWindow:
- Cancel overshoot on size changes
- Avoid criticals with non-overlay scrollbars
* GtkFileChooser:
- Handle smb mounts better
* GtkListBox:
- Fix extending multi-selections
* Fix a possible crash in gtk_show_uri
* Wayland:
- Improve font settings fallback
* X11:
- Avoid log spam on exit
- Don't beep on untrusted displays
* OS X:
- Fix building on OS X 10.11
- Add gdk-quartz-cocoa-access.h with api that provides
access to native objects
* Translation updates:
Dutch
Nepali
Swedish
Overview of Changes in GTK+ 3.24.28
===================================
* Input:
- Improve dead key handling
* CSS:
- Fix rendering of scaled text shadows
* Wayland:
- Fix matching of accelerators with multiple layouts
* X11:
- Trap errors from the COW
* Build:
- Make gtk3-update-icon-cache output reproducible
* Translation updates:
Serbian
Overview of Changes in GTK+ 3.24.27
===================================
* Input: Ensure preedit-start and preedit-end
are emitted properly
* GtkScrolledWindow:
- Revert a change that broke touch scrolling
* Theme:
- Fix a problem with size changes in SSD decorations
that caused mutter crashes
- Use transparent black for window border in the dark theme
* Windows:
- Memory leak fixes
- Fix unresponsive windows after tablet input
- Add support for wheel and rotation axes
* Translation updates:
Belarusian
German
Kazakh
Korean
Latvian
Turkish
Overview of Changes in GTK+ 3.24.26
===================================
+8 -69
View File
@@ -15,8 +15,6 @@ the same compiler is used for at least GDK-Pixbuf, Pango, atk and glib
so that crashes and errors caused by different CRTs can be avoided. Currently
building with Visual Studio 2008 or later is supported, either via Visual Studio
project files or via the Meson build system, as described in the below sections.
For Visual Studio 2008, 2010, a special setup making use of the Windows 8.0 SDK
is required, see at the bottom of this document for guidance.
Interchanging between Visual Studio 2015, 2017 and 2019 builds should be fine
as they use the same CRT (UCRT) DLLs.
@@ -288,73 +286,6 @@ If you are building with Visual Studio 2008, note the following items as well:
- The more modern visual style for the print dialog is not applied for Visual
Studio 2008 builds. Any solutions to this is really appreciated.
Support for pre-2012 Visual Studio
==================================
This release of GTK+ requires at least the Windows 8.0 SDK in order to be built
successfully using Visual Studio, which means that building with Visual Studio
2008 or 2010 is possible only with a special setup and must be done in the
command line with Ninja. Please see
https://devblogs.microsoft.com/cppblog/using-the-windows-software-development-kit-sdk-for-windows-8-consumer-preview-with-visual-studio-2010/
for references; basically, assuming that your Windows 8.0 SDK is installed in
`C:\Program Files (x86)\Windows Kits\8.0` (`$(WIN8SDKDIR)` in short), you need
to ensure the following before invoking Meson to configure the build:
- Your `%INCLUDE%` must not include the Windows 7.0/7.1 SDK include directories,
and `$(WIN8SDKDIR)\include\um`, `$(WIN8SDKDIR)\include\um\share` and
`$(WIN8SDKDIR)\include\winrt` (in this order) must be before your stock
Visual Studio 2008/2010 header directories. If you have the DirectX SDK installed,
you should remove its include directory from your `%INCLUDE%` as well.
- You must replace the Windows 7.0/7.1 SDK library directory in `%LIB%` with the
Windows 8.0 SDK library directory, i.e. `$(WIN8SDKDIR)\lib\win8\um\[x86|x64]`.
If you have the DirectX SDK installed, you should remove its library directory
from your `%INCLUDE%` as well.
- You must replace the Windows 7.0/7.1 SDK tools directory from your `%PATH%` with
the Windows 8.0 SDK tools directory, i.e. `$(WIN8SDKDIR)\bin\[x86|x64]`.
If you have the DirectX SDK installed, you should remove its utility directory
from your `%PATH%` as well.
The Windows 8.0 SDK headers may contain an `roapi.h` that cannot be used under plain
C, so to remedy that, change the following lines (around lines 55-57):
// RegisterActivationFactory/RevokeActivationFactory registration cookie
typedef struct {} *RO_REGISTRATION_COOKIE;
// RegisterActivationFactory/DllGetActivationFactory callback
to
// RegisterActivationFactory/RevokeActivationFactory registration cookie
#ifdef __cplusplus
typedef struct {} *RO_REGISTRATION_COOKIE;
#else
typedef struct _RO_REGISTRATION_COOKIE *RO_REGISTRATION_COOKIE; /* make this header includable in C files */
#endif
// RegisterActivationFactory/DllGetActivationFactory callback
This follows what is done in the Windows 8.1 SDK, which contains an `roapi.h`
that is usable under plain C. Please note that you might need to copy that file
into a location that is in your `%INCLUDE%` which precedes the include path for the
Windows 8.0 SDK headers, if you do not have administrative privileges.
Visual Studio 2008 hacks
========================
- You need to run the following lines from your build directory, to embed the
manifests that are generated during the build, assuming the built binaries
are installed to `$(PREFIX)`, after a successful build/installation:
```cmd
> for /r %f in (*.dll.manifest) do if exist $(PREFIX)\bin\%~nf mt /manifest %f (PREFIX)\bin\%~nf;2
> for /r %f in (*.exe.manifest) do if exist $(PREFIX)\bin\%~nf mt /manifest %f (PREFIX)\bin\%~nf;1
```
- If building for amd64/x86_64/x64, sometimes the compilation of sources may seem to hang, which
is caused by an optimization issue in the 2008 x64 compiler. You need to use Task Manager to
remove all running instances of `cl.exe`, which will cause the build process to terminate. Update
the build flags of the sources that hang on compilation by changing its `"/O2"` flag to `"/O1"`
in `build.ninja`, and retry the build, where things should continue to build normally.
Using GTK+ on Win32
===================
@@ -371,5 +302,13 @@ cases, but not in general. Sorry. If you have all GTK+ and GDK calls
in the same thread, it might work. Otherwise, probably not at
all. Possible ways to fix this are being investigated.
Wintab
======
The tablet support uses the Wintab API. The Wintab development kit is
no longer required. The wintab.h header file is bundled with GTK+
sources. Unfortunately it seems that only Wacom tablets come with
support for the Wintab API nowadays.
--Tor Lillqvist <tml@iki.fi>, <tml@novell.com>
--Updated by Fan, Chun-wei <fanc999@yahoo.com.tw>
+38 -2
View File
@@ -10,8 +10,8 @@
m4_define([gtk_major_version], [3])
m4_define([gtk_minor_version], [24])
m4_define([gtk_micro_version], [30])
m4_define([gtk_interface_age], [26])
m4_define([gtk_micro_version], [26])
m4_define([gtk_interface_age], [22])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
m4_define([gtk_version],
@@ -1576,6 +1576,38 @@ fi
AM_CONDITIONAL(HAVE_TRACKER3, test "x$have_tracker3" = "xyes")
# Checks to see if we should compile with cloudprint backend for GTK+
#
AC_ARG_ENABLE(cloudprint,
[AS_HELP_STRING([--disable-cloudprint],
[disable cloudprint print backend])],,
[enable_cloudprint=auto])
if test "x$enable_cloudprint" = "xno"; then
AM_CONDITIONAL(HAVE_CLOUDPRINT, false)
else
PKG_CHECK_MODULES(REST, [rest-0.7], have_rest=yes, have_rest=no)
PKG_CHECK_MODULES(JSON_GLIB, [json-glib-1.0], have_json_glib=yes, have_json_glib=no)
if test "x$have_rest" = "xyes" -a "x$have_json_glib" = "xyes"; then
PRINT_BACKENDS="$PRINT_BACKENDS cloudprint"
have_cloudprint=yes
fi
AM_CONDITIONAL(HAVE_CLOUDPRINT, test "x$have_cloudprint" = "xyes")
fi
if test "x$enable_cloudprint" = "xyes" -a "x$have_rest" = "xno"; then
AC_MSG_ERROR([
*** rest not found.
])
fi
if test "x$enable_cloudprint" = "xyes" -a "x$have_json_glib" = "xno"; then
AC_MSG_ERROR([
*** json-glib not found.
])
fi
gtk_save_cppflags="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS $GDK_DEP_CFLAGS"
@@ -1618,6 +1650,9 @@ fi
if test "$have_papi" != "yes" -a "$have_cups" != "yes"; then
GTK_PRINT_BACKENDS="$GTK_PRINT_BACKENDS,lpr"
fi
if test "$have_cloudprint" = "yes"; then
GTK_PRINT_BACKENDS="$GTK_PRINT_BACKENDS,cloudprint"
fi
AC_SUBST(GTK_PRINT_BACKENDS)
################################################################
@@ -1959,6 +1994,7 @@ modules/Makefile
modules/input/Makefile
modules/printbackends/Makefile
modules/printbackends/cups/Makefile
modules/printbackends/cloudprint/Makefile
modules/printbackends/lpr/Makefile
modules/printbackends/file/Makefile
modules/printbackends/papi/Makefile
@@ -2,6 +2,7 @@
Name=Icon Browser
Comment=An application that shows themed icons
Exec=gtk3-icon-browser
Icon=gtk3-icon-browser
Terminal=false
Type=Application
StartupNotify=true
+4 -9
View File
@@ -503,19 +503,14 @@ if get_option('man') and xsltproc.found()
[ 'gtk-update-icon-cache', '1', ],
[ 'gtk-encode-symbolic-svg', '1', ],
[ 'gtk-launch', '1', ],
[ 'gtk3-demo', '1', ],
[ 'gtk3-demo-application', '1', ],
[ 'gtk3-widget-factory', '1', ],
[ 'gtk3-icon-browser', '1', ],
[ 'gtk-builder-tool', '1', ],
[ 'gtk-query-settings', '1', ],
]
if get_option('demos')
man_files += [
[ 'gtk3-demo', '1', ],
[ 'gtk3-demo-application', '1', ],
[ 'gtk3-widget-factory', '1', ],
[ 'gtk3-icon-browser', '1', ],
]
endif
if broadway_enabled
man_files += [[ 'broadwayd', '1', ]]
endif
+87 -18
View File
@@ -20,8 +20,12 @@ Getting help with GTK+
<title>Filing a bug report or feature request</title>
<para>
If you encounter a bug, misfeature, or missing feature in GTK, please
file a bug report on <ulink url="https://gitlab.gnome.org/GNOME/gtk/issues">GitLab</ulink>.
If you encounter a bug, misfeature, or missing feature in GTK+, please
file a bug report on
<ulink url="https://bugzilla.gnome.org">https://bugzilla.gnome.org</ulink>.
We'd also appreciate reports of incomplete or misleading information in
the GTK+ documentation; file those against the "docs" component of the "gtk+"
product in Bugzilla.
</para>
<para>
@@ -33,38 +37,103 @@ discussed, we'll add a note to that effect in the report.
<para>
The bug tracker should definitely be used for feature requests, it's
not only for bugs. We track all GTK development in GitLab, so it's
the way to be sure the GTK developers won't forget about an issue.
</para>
<para>
Just make sure that any issue filed is actionable, and contains clear
instructions on how to reproduce an issue, and the conditions to close
the bug report or feature request. Non-actionable, or user support
questions will be directed to Discourse.
not only for bugs. We track all GTK+ development in Bugzilla, so it's
the way to be sure the GTK+ developers won't forget about an issue.
</para>
</refsect1>
<refsect1>
<title>Contributing</title>
<title>Submitting Patches</title>
<para>
Please, follow the instructions outlined in the
<ulink url="https://gitlab.gnome.org/GNOME/gtk/-/blob/master/CONTRIBUTING.md">Contribution Guide</ulink> available in the GTK
source code repository.
If you develop a bugfix or enhancement for GTK+, please file that in
Bugzilla as well. Bugzilla allows you to attach files; please attach a
patch generated by the <command>diff</command> utility, using the
<option>-u</option> option to make the patch more readable. All patches
must be offered under the terms of the GNU LGPL license, so be sure you
are authorized to give us the patch under those terms.
</para>
<para>
If you want to discuss your patch before or after developing it, mail
<ulink url="mailto:gtk-devel-list@gnome.org">gtk-devel-list@gnome.org</ulink>.
But be sure to file the Bugzilla report as well; if the patch is only on the
list and not in Bugzilla, it's likely to slip through the cracks.
</para>
</refsect1>
<refsect1>
<title>User support</title>
<title>Mailing lists</title>
<para>
If you have questions about building, using, or contributing to GTK, please
open a topic on <ulink url="https://discourse.gnome.org/tag/gtk">Discourse</ulink>.
There are several mailing lists dedicated to GTK+ and related
libraries. Discussion of GLib, Pango, and ATK in addition to GTK+
proper is welcome on these lists. You can subscribe or view the
archives of these lists on
<ulink url="https://mail.gnome.org">http://mail.gnome.org</ulink>.
If you aren't subscribed to the list, any message you post to
the list will be held for manual moderation, which might take
some days to happen.
</para>
<para>
<variablelist>
<varlistentry>
<term><ulink url="mailto:gtk-list@gnome.org">gtk-list@gnome.org</ulink></term>
<listitem><para>
gtk-list covers general GTK+ topics; questions about using GTK+ in programs,
GTK+ from a user standpoint, announcements of GTK+-related projects
such as themes or GTK+ modules would all be on-topic. The bulk of the
traffic consists of GTK+ programming questions.
</para></listitem>
</varlistentry>
<varlistentry>
<term><ulink url="mailto:gtk-app-devel-list@gnome.org">gtk-app-devel-list@gnome.org</ulink></term>
<listitem><para>
gtk-app-devel-list covers writing applications in GTK+. It's narrower
in scope than gtk-list, but the two lists overlap quite a
bit. gtk-app-devel-list is a good place to ask questions about GTK+
programming. </para></listitem>
</varlistentry>
<varlistentry>
<term><ulink url="mailto:gtk-devel-list@gnome.org">gtk-devel-list@gnome.org</ulink></term>
<listitem><para>
gtk-devel-list is for discussion of work on GTK+ itself, it is
<emphasis>not</emphasis> for
asking questions about how to use GTK+ in applications. gtk-devel-list
is appropriate for discussion of patches, bugs, proposed features,
and so on.
</para></listitem>
</varlistentry>
<varlistentry>
<term><ulink url="mailto:gtk-i18n-list@gnome.org">gtk-i18n-list@gnome.org</ulink></term>
<listitem><para>
gtk-i18n-list is for discussion of internationalization in GTK+;
Pango is the main focus of the list. Questions about the details of
using Pango, and discussion of proposed Pango patches or features, are
all on topic.
</para></listitem>
</varlistentry>
<varlistentry>
<term><ulink url="mailto:gtk-doc-list@gnome.org">gtk-doc-list@gnome.org</ulink></term>
<listitem><para>
gtk-doc-list is for discussion of the <application>gtk-doc</application>
documentation system (used to document GTK+), and for work on the GTK+
documentation.
</para></listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
</refentry>
+17 -17
View File
@@ -370,7 +370,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
paint_data = gdk_gl_context_get_paint_data (paint_context);
if (paint_data->tmp_framebuffer == 0)
glGenFramebuffers (1, &paint_data->tmp_framebuffer);
glGenFramebuffersEXT (1, &paint_data->tmp_framebuffer);
if (source_type == GL_RENDERBUFFER)
{
@@ -423,10 +423,10 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
/* Create a framebuffer with the source renderbuffer and
make it the current target for reads */
framebuffer = paint_data->tmp_framebuffer;
glBindFramebuffer (GL_FRAMEBUFFER, framebuffer);
glFramebufferRenderbuffer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_RENDERBUFFER, source);
glBindFramebuffer (GL_DRAW_FRAMEBUFFER, 0);
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, framebuffer);
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_RENDERBUFFER_EXT, source);
glBindFramebufferEXT (GL_DRAW_FRAMEBUFFER_EXT, 0);
/* Translate to impl coords */
cairo_region_translate (clip_region, dx, dy);
@@ -481,11 +481,11 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
{
int clipped_src_x = x + (dest.x - dx * window_scale);
int clipped_src_y = y + (height - dest.height - (dest.y - dy * window_scale));
glBlitFramebuffer (clipped_src_x, clipped_src_y,
(clipped_src_x + dest.width), (clipped_src_y + dest.height),
dest.x, FLIP_Y(dest.y + dest.height),
dest.x + dest.width, FLIP_Y(dest.y),
GL_COLOR_BUFFER_BIT, GL_NEAREST);
glBlitFramebufferEXT(clipped_src_x, clipped_src_y,
(clipped_src_x + dest.width), (clipped_src_y + dest.height),
dest.x, FLIP_Y(dest.y + dest.height),
dest.x + dest.width, FLIP_Y(dest.y),
GL_COLOR_BUFFER_BIT, GL_NEAREST);
if (impl_window->current_paint.flushed_region)
{
cairo_rectangle_int_t flushed_rect;
@@ -505,7 +505,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
glDisable (GL_SCISSOR_TEST);
glBindFramebuffer (GL_FRAMEBUFFER, 0);
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0);
#undef FLIP_Y
@@ -671,19 +671,19 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
cairo_surface_set_device_scale (image, buffer_scale, buffer_scale);
framebuffer = paint_data->tmp_framebuffer;
glBindFramebuffer (GL_FRAMEBUFFER, framebuffer);
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, framebuffer);
if (source_type == GL_RENDERBUFFER)
{
/* Create a framebuffer with the source renderbuffer and
make it the current target for reads */
glFramebufferRenderbuffer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_RENDERBUFFER, source);
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_RENDERBUFFER_EXT, source);
}
else
{
glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_TEXTURE_2D, source, 0);
glFramebufferTexture2DEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_TEXTURE_2D, source, 0);
}
glPixelStorei (GL_PACK_ALIGNMENT, 4);
@@ -699,7 +699,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
glPixelStorei (GL_PACK_ROW_LENGTH, 0);
glBindFramebuffer (GL_FRAMEBUFFER, 0);
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0);
cairo_surface_mark_dirty (image);
+2 -1
View File
@@ -803,7 +803,8 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
gdk_event_free (event);
_gdk_quartz_drag_source_context_destroy_gtk_only ();
g_object_unref (_gdk_quartz_drag_source_context);
_gdk_quartz_drag_source_context = NULL;
}
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
-1
View File
@@ -60,7 +60,6 @@ libgdkinclude_HEADERS = \
gdkquartz.h
libgdkquartzinclude_HEADERS = \
gdkquartz-cocoa-access.h \
gdkquartz-gtk-only.h \
gdkquartzcursor.h \
gdkquartzdevice-core.h \
-8
View File
@@ -59,14 +59,6 @@ _gdk_quartz_window_drag_begin (GdkWindow *window,
return _gdk_quartz_drag_source_context;
}
void
_gdk_quartz_drag_source_context_destroy_gtk_only ()
{
if (_gdk_quartz_drag_source_context)
g_object_unref (_gdk_quartz_drag_source_context);
_gdk_quartz_drag_source_context = NULL;
}
static gboolean
gdk_quartz_drag_context_drag_motion (GdkDragContext *context,
GdkWindow *dest_window,
+1 -1
View File
@@ -28,7 +28,7 @@
#include "gdkquartzglcontext.h"
#include "gdkquartzwindow.h"
#include "gdkprivate-quartz.h"
#include "gdkquartz-cocoa-access.h"
#include "gdkquartz-gtk-only.h"
#include "gdkinternals.h"
+1 -1
View File
@@ -75,7 +75,7 @@ typedef enum {
GDK_QUARTZ_EVENT_SUBTYPE_EVENTLOOP
} GdkQuartzEventSubType;
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 10130
#define GDK_QUARTZ_EVENT_TABLET_PROXIMITY NSEventTypeTabletProximity
#define GDK_QUARTZ_EVENT_SUBTYPE_TABLET_PROXIMITY NSEventSubtypeTabletProximity
#define GDK_QUARTZ_EVENT_SUBTYPE_TABLET_POINT NSEventSubtypeTabletPoint
-37
View File
@@ -1,37 +0,0 @@
/* gdkquartz-gtk-only.h
*
* Copyright (C) 2005-2007 Imendio AB
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GDK_QUARTZ_COCOA_ACCESS_H__
#define __GDK_QUARTZ_COCOA_ACCESS_H__
#ifndef __OBJC__
#error "This header declares Cocoa types and can be included only from source files compiled with Objective-C."
#endif
#include <AppKit/AppKit.h>
#include <gdk/gdk.h>
#include <gdk/quartz/gdkquartz.h>
GDK_AVAILABLE_IN_ALL
NSEvent *gdk_quartz_event_get_nsevent (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
NSWindow *gdk_quartz_window_get_nswindow (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
NSView *gdk_quartz_window_get_nsview (GdkWindow *window);
#endif
+8
View File
@@ -38,5 +38,13 @@ NSString *gdk_quartz_atom_to_pasteboard_type_libgtk_only (GdkAtom
/* Utilities */
GDK_AVAILABLE_IN_ALL
NSImage *gdk_quartz_pixbuf_to_ns_image_libgtk_only (GdkPixbuf *pixbuf);
GDK_AVAILABLE_IN_ALL
NSEvent *gdk_quartz_event_get_nsevent (GdkEvent *event);
/* Window */
GDK_AVAILABLE_IN_ALL
NSWindow *gdk_quartz_window_get_nswindow (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
NSView *gdk_quartz_window_get_nsview (GdkWindow *window);
#endif
-3
View File
@@ -51,9 +51,6 @@ id gdk_quartz_drag_context_get_dragging_info_libgtk_only (GdkDragContext
GDK_AVAILABLE_IN_ALL
GdkDragContext *gdk_quartz_drag_source_context_libgtk_only (void);
GDK_AVAILABLE_IN_3_24
void _gdk_quartz_drag_source_context_destroy_gtk_only ();
G_END_DECLS
#endif /* __GDK_QUARTZ_DRAG_CONTEXT_H__ */
-1
View File
@@ -23,7 +23,6 @@
#include <gdkinternals.h>
#include "gdkquartz-gtk-only.h"
#include "gdkquartz-cocoa-access.h"
#include <gdkquartzutils.h>
NSImage *
+3 -6
View File
@@ -30,7 +30,7 @@
#include "gdkquartzglcontext.h"
#include "gdkquartzscreen.h"
#include "gdkquartzcursor.h"
#include "gdkquartz-cocoa-access.h"
#include "gdkquartz-gtk-only.h"
#include <Carbon/Carbon.h>
#include <AvailabilityMacros.h>
@@ -2228,7 +2228,7 @@ _gdk_quartz_window_set_collection_behavior (NSWindow *nswindow,
GdkWindowTypeHint hint)
{
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101100
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 10110
#define GDK_QUARTZ_ALLOWS_TILING NSWindowCollectionBehaviorFullScreenAllowsTiling
#define GDK_QUARTZ_DISALLOWS_TILING NSWindowCollectionBehaviorFullScreenDisallowsTiling
#else
@@ -2441,14 +2441,11 @@ gdk_quartz_window_set_decorations (GdkWindow *window,
impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP ||
if (decorations == 0 || GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP ||
impl->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN )
{
new_mask = GDK_QUARTZ_BORDERLESS_WINDOW;
}
else if (decorations == 0) {
new_mask = GDK_QUARTZ_BORDERLESS_WINDOW | GDK_QUARTZ_MINIATURIZABLE_WINDOW;
}
else
{
/* FIXME: Honor other GDK_DECOR_* flags. */
-1
View File
@@ -26,7 +26,6 @@ gdk_quartz_sources = files(
)
gdk_quartz_public_headers = files(
'gdkquartz-cocoa-access.h',
'gdkquartzcursor.h',
'gdkquartzdevice-core.h',
'gdkquartzdevicemanager-core.h',
+1 -3
View File
@@ -2195,7 +2195,6 @@ deliver_key_event (GdkWaylandSeat *seat,
struct xkb_keymap *xkb_keymap;
GdkKeymap *keymap;
xkb_keysym_t sym;
int layout;
guint delay, interval, timeout;
gint64 begin_time, now;
@@ -2208,7 +2207,6 @@ deliver_key_event (GdkWaylandSeat *seat,
xkb_keymap = _gdk_wayland_keymap_get_xkb_keymap (keymap);
sym = xkb_state_key_get_one_sym (xkb_state, key);
layout = xkb_state_key_get_layout (xkb_state, key);
if (sym == XKB_KEY_NoSymbol)
return;
@@ -2222,7 +2220,7 @@ deliver_key_event (GdkWaylandSeat *seat,
gdk_event_set_seat (event, GDK_SEAT (seat));
event->key.time = time_;
event->key.state = device_get_modifiers (seat->master_pointer);
event->key.group = layout;
event->key.group = 0;
event->key.hardware_keycode = key;
gdk_event_set_scancode (event, key);
event->key.keyval = sym;
+20 -16
View File
@@ -434,19 +434,26 @@ gdk_registry_handle_global (void *data,
}
else if (strcmp (interface, "wl_seat") == 0)
{
SeatAddedClosure *closure;
static const char *required_device_manager_globals[] = {
"wl_compositor",
"wl_data_device_manager",
NULL
};
closure = g_new0 (SeatAddedClosure, 1);
closure->base.handler = seat_added_closure_run;
closure->base.required_globals = required_device_manager_globals;
closure->id = id;
closure->version = version;
postpone_on_globals_closure (display_wayland, &closure->base);
if (has_required_globals (display_wayland,
required_device_manager_globals))
_gdk_wayland_display_add_seat (display_wayland, id, version);
else
{
SeatAddedClosure *closure;
closure = g_new0 (SeatAddedClosure, 1);
closure->base.handler = seat_added_closure_run;
closure->base.required_globals = required_device_manager_globals;
closure->id = id;
closure->version = version;
postpone_on_globals_closure (display_wayland, &closure->base);
}
}
else if (strcmp (interface, "wl_data_device_manager") == 0)
{
@@ -460,12 +467,12 @@ gdk_registry_handle_global (void *data,
display_wayland->subcompositor =
wl_registry_bind (display_wayland->wl_registry, id, &wl_subcompositor_interface, 1);
}
else if (strcmp (interface, "zwp_pointer_gestures_v1") == 0)
else if (strcmp (interface, "zwp_pointer_gestures_v1") == 0 &&
version == GDK_ZWP_POINTER_GESTURES_V1_VERSION)
{
display_wayland->pointer_gestures =
wl_registry_bind (display_wayland->wl_registry,
id, &zwp_pointer_gestures_v1_interface,
MIN (version, GDK_ZWP_POINTER_GESTURES_V1_VERSION));
id, &zwp_pointer_gestures_v1_interface, version);
}
else if (strcmp (interface, "gtk_primary_selection_device_manager") == 0)
{
@@ -526,6 +533,8 @@ gdk_registry_handle_global (void *data,
g_hash_table_insert (display_wayland->known_globals,
GUINT_TO_POINTER (id), g_strdup (interface));
process_on_globals_closures (display_wayland);
}
static void
@@ -616,13 +625,8 @@ _gdk_wayland_display_open (const gchar *display_name)
display_wayland->wl_registry = wl_display_get_registry (display_wayland->wl_display);
wl_registry_add_listener (display_wayland->wl_registry, &registry_listener, display_wayland);
if (wl_display_roundtrip (display_wayland->wl_display) < 0)
{
g_object_unref (display);
return NULL;
}
process_on_globals_closures (display_wayland);
_gdk_wayland_display_async_roundtrip (display_wayland);
/* Wait for initializing to complete. This means waiting for all
* asynchrounous roundtrips that were triggered during initial roundtrip. */
+7 -29
View File
@@ -542,13 +542,13 @@ static TranslationEntry translations[] = {
{ FALSE, "org.gnome.desktop.privacy", "remember-recent-files", "gtk-recent-files-enabled", G_TYPE_BOOLEAN, { .b = TRUE } },
{ FALSE, WM_SETTINGS_SCHEMA, "button-layout", "gtk-decoration-layout", G_TYPE_STRING, { .s = "menu:close" } },
{ FALSE, CLASSIC_WM_SETTINGS_SCHEMA, "button-layout", "gtk-decoration-layout", G_TYPE_STRING, { .s = "menu:close" } },
{ FALSE, "org.gnome.desktop.interface", "font-antialiasing", "gtk-xft-antialias", G_TYPE_NONE, { .i = 1 } },
{ FALSE, "org.gnome.desktop.interface", "font-hinting", "gtk-xft-hinting", G_TYPE_NONE, { .i = 1 } },
{ FALSE, "org.gnome.desktop.interface", "font-hinting", "gtk-xft-hintstyle", G_TYPE_NONE, { .i = 1 } },
{ FALSE, "org.gnome.desktop.interface", "font-antialiasing", "gtk-xft-antialias", G_TYPE_NONE, { .i = 0 } },
{ FALSE, "org.gnome.desktop.interface", "font-hinting", "gtk-xft-hinting", G_TYPE_NONE, { .i = 0 } },
{ FALSE, "org.gnome.desktop.interface", "font-hinting", "gtk-xft-hintstyle", G_TYPE_NONE, { .i = 0 } },
{ FALSE, "org.gnome.desktop.interface", "font-rgba-order", "gtk-xft-rgba", G_TYPE_NONE, { .i = 0 } },
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "antialiasing", "gtk-xft-antialias", G_TYPE_NONE, { .i = 1 } },
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "hinting", "gtk-xft-hinting", G_TYPE_NONE, { .i = 1 } },
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "hinting", "gtk-xft-hintstyle", G_TYPE_NONE, { .i = 1 } },
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "antialiasing", "gtk-xft-antialias", G_TYPE_NONE, { .i = 0 } },
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "hinting", "gtk-xft-hinting", G_TYPE_NONE, { .i = 0 } },
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "hinting", "gtk-xft-hintstyle", G_TYPE_NONE, { .i = 0 } },
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "rgba-order", "gtk-xft-rgba", G_TYPE_NONE, { .i = 0 } },
{ FALSE, "org.gnome.desktop.interface", "text-scaling-factor", "gtk-xft-dpi" , G_TYPE_NONE, { .i = 0 } },
{ FALSE, "org.gnome.desktop.wm.preferences", "action-double-click-titlebar", "gtk-titlebar-double-click", G_TYPE_STRING, { .s = "toggle-maximize" } },
@@ -745,14 +745,6 @@ init_settings (GdkScreen *screen)
goto fallback;
}
if (g_variant_n_children (ret) == 0)
{
g_debug ("Received no portal settings");
g_clear_pointer (&ret, g_variant_unref);
goto fallback;
}
g_variant_get (ret, "(a{sa{sv}})", &iter);
while (g_variant_iter_loop (iter, "{s@a{sv}}", &schema, &val))
@@ -1638,21 +1630,7 @@ output_handle_geometry (void *data,
monitor->x = x;
monitor->y = y;
switch (transform)
{
case WL_OUTPUT_TRANSFORM_90:
case WL_OUTPUT_TRANSFORM_270:
case WL_OUTPUT_TRANSFORM_FLIPPED_90:
case WL_OUTPUT_TRANSFORM_FLIPPED_270:
gdk_monitor_set_physical_size (GDK_MONITOR (monitor),
physical_height, physical_width);
break;
default:
gdk_monitor_set_physical_size (GDK_MONITOR (monitor),
physical_width, physical_height);
}
gdk_monitor_set_physical_size (GDK_MONITOR (monitor), physical_width, physical_height);
gdk_monitor_set_subpixel_layout (GDK_MONITOR (monitor), subpixel);
gdk_monitor_set_manufacturer (GDK_MONITOR (monitor), make);
gdk_monitor_set_model (GDK_MONITOR (monitor), model);
+1 -6
View File
@@ -21,10 +21,7 @@ if WIN32_GLES
AM_CPPFLAGS += "-DGDK_WIN32_ENABLE_EGL=1"
endif #WIN32_GLES
libgdk_win32_DEP_LIBS = \
hid.lib
LDADDS = $(libgdk_win32_DEP_LIBS) $(GDK_DEP_LIBS)
LDADDS = $(GDK_DEP_LIBS)
noinst_LTLIBRARIES = libgdk-win32.la
@@ -43,8 +40,6 @@ libgdk_win32_la_SOURCES = \
gdkdevice-virtual.h \
gdkdevice-win32.c \
gdkdevice-win32.h \
gdkdevice-winpointer.c \
gdkdevice-winpointer.h \
gdkdevice-wintab.c \
gdkdevice-wintab.h \
gdkdisplay-win32.c \
+56 -42
View File
@@ -117,7 +117,7 @@ gdk_device_win32_query_state (GdkDevice *device,
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
hwnd = GDK_WINDOW_HWND (window);
_gdk_win32_get_cursor_pos (&point);
GetCursorPos (&point);
if (root_x)
*root_x = point.x / impl->window_scale;
@@ -150,18 +150,7 @@ gdk_device_win32_query_state (GdkDevice *device,
if (child_window)
{
if (window == gdk_screen_get_root_window (screen))
{
/* Always use WindowFromPoint when searching from the root window.
* Only WindowFromPoint is able to look through transparent
* layered windows.
*/
hwndc = GetAncestor (WindowFromPoint (point), GA_ROOT);
}
else
{
hwndc = ChildWindowFromPoint (hwnd, point);
}
hwndc = ChildWindowFromPoint (hwnd, point);
if (hwndc && hwndc != hwnd)
*child_window = gdk_win32_handle_table_lookup (hwndc);
@@ -212,46 +201,71 @@ _gdk_device_win32_window_at_position (GdkDevice *device,
GdkWindow *window = NULL;
GdkWindowImplWin32 *impl = NULL;
POINT screen_pt, client_pt;
HWND hwnd;
HWND hwnd, hwndc;
RECT rect;
if (!_gdk_win32_get_cursor_pos (&screen_pt))
return NULL;
hwnd = WindowFromPoint (screen_pt);
GetCursorPos (&screen_pt);
if (get_toplevel)
{
/* Use WindowFromPoint instead of ChildWindowFromPoint(Ex).
* Only WindowFromPoint is able to look through transparent
* layered windows.
*/
hwnd = GetAncestor (hwnd, GA_ROOT);
/* Only consider visible children of the desktop to avoid the various
* non-visible windows you often find on a running Windows box. These
* might overlap our windows and cause our walk to fail. As we assume
* WindowFromPoint() can find our windows, we follow similar logic
* here, and ignore invisible and disabled windows.
*/
hwnd = GetDesktopWindow ();
do {
window = gdk_win32_handle_table_lookup (hwnd);
if (window != NULL &&
GDK_WINDOW_TYPE (window) != GDK_WINDOW_ROOT &&
GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
break;
screen_to_client (hwnd, screen_pt, &client_pt);
hwndc = ChildWindowFromPointEx (hwnd, client_pt, CWP_SKIPDISABLED |
CWP_SKIPINVISIBLE);
/* Verify that we're really inside the client area of the window */
if (hwndc != hwnd)
{
GetClientRect (hwndc, &rect);
screen_to_client (hwndc, screen_pt, &client_pt);
if (!PtInRect (&rect, client_pt))
hwndc = hwnd;
}
} while (hwndc != hwnd && (hwnd = hwndc, 1));
}
/* Verify that we're really inside the client area of the window */
GetClientRect (hwnd, &rect);
screen_to_client (hwnd, screen_pt, &client_pt);
if (!PtInRect (&rect, client_pt))
hwnd = NULL;
if (!get_toplevel && hwnd == NULL)
else
{
/* If we didn't hit any window, return the root window */
/* note that the root window ain't a toplevel window */
window = gdk_get_default_root_window ();
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
hwnd = WindowFromPoint (screen_pt);
if (win_x)
*win_x = (screen_pt.x + _gdk_offset_x) / impl->window_scale;
if (win_y)
*win_y = (screen_pt.y + _gdk_offset_y) / impl->window_scale;
/* Verify that we're really inside the client area of the window */
GetClientRect (hwnd, &rect);
screen_to_client (hwnd, screen_pt, &client_pt);
if (!PtInRect (&rect, client_pt))
hwnd = NULL;
return window;
/* If we didn't hit any window at that point, return the desktop */
if (hwnd == NULL)
{
window = gdk_get_default_root_window ();
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
if (win_x)
*win_x = (screen_pt.x + _gdk_offset_x) / impl->window_scale;
if (win_y)
*win_y = (screen_pt.y + _gdk_offset_y) / impl->window_scale;
return window;
}
window = gdk_win32_handle_table_lookup (hwnd);
}
window = gdk_win32_handle_table_lookup (hwnd);
if (window && (win_x || win_y))
{
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
-321
View File
@@ -1,321 +0,0 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 2020 the GTK team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <gdk/gdkwindow.h>
#include <windows.h>
#include "gdkwin32.h"
#include "gdkdevice-winpointer.h"
G_DEFINE_TYPE (GdkDeviceWinpointer, gdk_device_winpointer, GDK_TYPE_DEVICE)
static GdkModifierType
get_keyboard_mask (void)
{
GdkModifierType mask;
BYTE kbd[256];
GetKeyboardState (kbd);
mask = 0;
if (kbd[VK_SHIFT] & 0x80)
mask |= GDK_SHIFT_MASK;
if (kbd[VK_CAPITAL] & 0x80)
mask |= GDK_LOCK_MASK;
if (kbd[VK_CONTROL] & 0x80)
mask |= GDK_CONTROL_MASK;
if (kbd[VK_MENU] & 0x80)
mask |= GDK_MOD1_MASK;
return mask;
}
static gboolean
gdk_device_winpointer_get_history (GdkDevice *device,
GdkWindow *window,
guint32 start,
guint32 stop,
GdkTimeCoord ***events,
gint *n_events)
{
return FALSE;
}
static void
gdk_device_winpointer_get_state (GdkDevice *device,
GdkWindow *window,
gdouble *axes,
GdkModifierType *mask)
{
GdkDeviceWinpointer *device_winpointer = GDK_DEVICE_WINPOINTER (device);
if (mask)
{
*mask = get_keyboard_mask ();
*mask |= device_winpointer->last_button_mask;
}
if (axes)
{
gsize size = sizeof (double) * device_winpointer->num_axes;
memcpy (axes, device_winpointer->last_axis_data, size);
}
}
static void
gdk_device_winpointer_set_window_cursor (GdkDevice *device,
GdkWindow *window,
GdkCursor *cursor)
{
}
static void
gdk_device_winpointer_warp (GdkDevice *device,
GdkScreen *screen,
gdouble x,
gdouble y)
{
}
static void
gdk_device_winpointer_query_state (GdkDevice *device,
GdkWindow *window,
GdkWindow **root_window,
GdkWindow **child_window,
gdouble *root_x,
gdouble *root_y,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask)
{
GdkDeviceWinpointer *device_winpointer = GDK_DEVICE_WINPOINTER (device);
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
GdkScreen *screen = gdk_window_get_screen (window);
HWND hwnd = GDK_WINDOW_HWND (window);
HWND hwndc = NULL;
POINT point;
_gdk_win32_get_cursor_pos (&point);
if (root_x)
*root_x = point.x / impl->window_scale;
if (root_y)
*root_y = point.y / impl->window_scale;
ScreenToClient (hwnd, &point);
if (win_x)
*win_x = point.x / impl->window_scale;
if (win_y)
*win_y = point.y / impl->window_scale;
if (window == gdk_screen_get_root_window (screen))
{
if (win_x)
*win_x += _gdk_offset_x;
if (win_y)
*win_y += _gdk_offset_y;
if (root_x)
*root_x += _gdk_offset_x;
if (root_y)
*root_y += _gdk_offset_y;
}
if (child_window)
{
if (window == gdk_screen_get_root_window (screen))
{
/* Always use WindowFromPoint when searching from the root window.
* Only WindowFromPoint is able to look through transparent
* layered windows.
*/
hwndc = GetAncestor (WindowFromPoint (point), GA_ROOT);
}
else
{
hwndc = ChildWindowFromPoint (hwnd, point);
}
if (hwndc && hwndc != hwnd)
*child_window = gdk_win32_handle_table_lookup (hwndc);
else
*child_window = NULL; /* Direct child unknown to gdk */
}
if (root_window)
*root_window = gdk_screen_get_root_window (screen);
if (mask)
{
*mask = get_keyboard_mask ();
*mask |= device_winpointer->last_button_mask;
}
}
static GdkGrabStatus
gdk_device_winpointer_grab (GdkDevice *device,
GdkWindow *window,
gboolean owner_events,
GdkEventMask event_mask,
GdkWindow *confine_to,
GdkCursor *cursor,
guint32 time_)
{
return GDK_GRAB_SUCCESS;
}
static void
gdk_device_winpointer_ungrab (GdkDevice *device,
guint32 time_)
{
}
static void
screen_to_client (HWND hwnd, POINT screen_pt, POINT *client_pt)
{
*client_pt = screen_pt;
ScreenToClient (hwnd, client_pt);
}
GdkWindow *
_gdk_device_winpointer_window_at_position (GdkDevice *device,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask,
gboolean get_toplevel)
{
GdkDeviceWinpointer *device_winpointer = GDK_DEVICE_WINPOINTER (device);
GdkWindow *window = NULL;
GdkWindowImplWin32 *impl = NULL;
POINT screen_pt, client_pt;
HWND hwnd;
RECT rect;
if (!_gdk_win32_get_cursor_pos (&screen_pt))
return NULL;
hwnd = WindowFromPoint (screen_pt);
if (get_toplevel)
{
/* Use WindowFromPoint instead of ChildWindowFromPoint(Ex).
* Only WindowFromPoint is able to look through transparent
* layered windows.
*/
hwnd = GetAncestor (hwnd, GA_ROOT);
}
/* Verify that we're really inside the client area of the window */
GetClientRect (hwnd, &rect);
screen_to_client (hwnd, screen_pt, &client_pt);
if (!PtInRect (&rect, client_pt))
hwnd = NULL;
if (!get_toplevel && hwnd == NULL)
{
/* If we didn't hit any window, return the root window */
/* note that the root window ain't a toplevel window */
window = gdk_get_default_root_window ();
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
if (win_x)
*win_x = (screen_pt.x + _gdk_offset_x) / impl->window_scale;
if (win_y)
*win_y = (screen_pt.y + _gdk_offset_y) / impl->window_scale;
return window;
}
window = gdk_win32_handle_table_lookup (hwnd);
if (window && (win_x || win_y))
{
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
if (win_x)
*win_x = client_pt.x / impl->window_scale;
if (win_y)
*win_y = client_pt.y / impl->window_scale;
}
if (mask)
{
*mask = get_keyboard_mask ();
*mask |= device_winpointer->last_button_mask;
}
return window;
}
static void
gdk_device_winpointer_select_window_events (GdkDevice *device,
GdkWindow *window,
GdkEventMask event_mask)
{
}
static void
gdk_device_winpointer_init (GdkDeviceWinpointer *device_winpointer)
{
device_winpointer->device_handle = NULL;
device_winpointer->start_cursor_id = 0;
device_winpointer->end_cursor_id = 0;
device_winpointer->origin_x = 0;
device_winpointer->origin_y = 0;
device_winpointer->scale_x = 0.0;
device_winpointer->scale_y = 0.0;
device_winpointer->last_axis_data = NULL;
device_winpointer->num_axes = 0;
device_winpointer->last_button_mask = 0;
}
static void
gdk_device_winpointer_finalize (GObject *object)
{
GdkDeviceWinpointer *device_winpointer = GDK_DEVICE_WINPOINTER (object);
g_free (device_winpointer->last_axis_data);
G_OBJECT_CLASS (gdk_device_winpointer_parent_class)->finalize (object);
}
static void
gdk_device_winpointer_class_init (GdkDeviceWinpointerClass *klass)
{
GdkDeviceClass *device_class = GDK_DEVICE_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gdk_device_winpointer_finalize;
device_class->get_history = gdk_device_winpointer_get_history;
device_class->get_state = gdk_device_winpointer_get_state;
device_class->set_window_cursor = gdk_device_winpointer_set_window_cursor;
device_class->warp = gdk_device_winpointer_warp;
device_class->query_state = gdk_device_winpointer_query_state;
device_class->grab = gdk_device_winpointer_grab;
device_class->ungrab = gdk_device_winpointer_ungrab;
device_class->window_at_position = _gdk_device_winpointer_window_at_position;
device_class->select_window_events = gdk_device_winpointer_select_window_events;
}
-64
View File
@@ -1,64 +0,0 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 2020 the GTK team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GDK_DEVICE_WINPOINTER_H__
#define __GDK_DEVICE_WINPOINTER_H__
#include <gdk/gdkdeviceprivate.h>
#include <windows.h>
G_BEGIN_DECLS
#define GDK_TYPE_DEVICE_WINPOINTER (gdk_device_winpointer_get_type ())
#define GDK_DEVICE_WINPOINTER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE_WINPOINTER, GdkDeviceWinpointer))
#define GDK_DEVICE_WINPOINTER_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE_WINPOINTER, GdkDeviceWinpointerClass))
#define GDK_IS_DEVICE_WINPOINTER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE_WINPOINTER))
#define GDK_IS_DEVICE_WINPOINTER_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE_WINPOINTER))
#define GDK_DEVICE_WINPOINTER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE_WINPOINTER, GdkDeviceWinpointerClass))
typedef struct _GdkDeviceWinpointer GdkDeviceWinpointer;
typedef struct _GdkDeviceWinpointerClass GdkDeviceWinpointerClass;
struct _GdkDeviceWinpointer
{
GdkDevice parent_instance;
HANDLE device_handle;
UINT32 start_cursor_id;
UINT32 end_cursor_id;
int origin_x;
int origin_y;
double scale_x;
double scale_y;
double *last_axis_data;
unsigned num_axes;
GdkModifierType last_button_mask;
};
struct _GdkDeviceWinpointerClass
{
GdkDeviceClass parent_class;
};
GType gdk_device_winpointer_get_type (void) G_GNUC_CONST;
G_END_DECLS
#endif /* __GDK_DEVICE_WINPOINTER_H__ */
+1 -1
View File
@@ -128,7 +128,7 @@ gdk_device_wintab_query_state (GdkDevice *device,
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
hwnd = GDK_WINDOW_HWND (window);
_gdk_win32_get_cursor_pos (&point);
GetCursorPos (&point);
if (root_x)
*root_x = point.x / impl->window_scale;
+2 -2
View File
@@ -49,8 +49,8 @@ struct _GdkDeviceWintab
UINT cursor;
/* The cursor's CSR_PKTDATA */
WTPKT pktdata;
/* Azimuth, altitude and twist axis */
AXIS orientation_axes[3];
/* Azimuth and altitude axis */
AXIS orientation_axes[2];
};
struct _GdkDeviceWintabClass
File diff suppressed because it is too large Load Diff
+5 -27
View File
@@ -41,8 +41,6 @@ struct _GdkDeviceManagerWin32
/* Fake slave devices */
GdkDevice *system_pointer;
GdkDevice *system_keyboard;
GList *winpointer_devices;
GList *wintab_devices;
/* Bumped up every time a wintab device enters the proximity
@@ -59,31 +57,11 @@ struct _GdkDeviceManagerWin32Class
GType gdk_device_manager_win32_get_type (void) G_GNUC_CONST;
typedef void
(*crossing_cb_t)(GdkDisplay *display,
GdkDevice *device,
GdkWindow *window,
POINT *screen_pt,
guint32 time_);
void gdk_winpointer_initialize_window (GdkWindow *window);
gboolean gdk_winpointer_should_forward_message (MSG *msg);
void gdk_winpointer_input_events (GdkDisplay *display,
GdkWindow *window,
crossing_cb_t crossing_cb,
MSG *msg);
gboolean gdk_winpointer_get_message_info (GdkDisplay *display,
MSG *msg,
GdkDevice **device,
guint32 *time_);
void gdk_winpointer_interaction_ended (MSG *msg);
void gdk_winpointer_finalize_window (GdkWindow *window);
void _gdk_wintab_set_tablet_active (void);
gboolean gdk_wintab_input_events (GdkDisplay *display,
GdkEvent *event,
MSG *msg,
GdkWindow *window);
void _gdk_input_set_tablet_active (void);
gboolean gdk_input_other_event (GdkDisplay *display,
GdkEvent *event,
MSG *msg,
GdkWindow *window);
G_END_DECLS
+47 -334
View File
@@ -54,7 +54,6 @@
#include "gdkglcontext-win32.h"
#include "gdkdevicemanager-win32.h"
#include "gdkdeviceprivate.h"
#include "gdkdevice-virtual.h"
#include "gdkdevice-wintab.h"
#include "gdkwin32dnd.h"
#include "gdkdisplay-win32.h"
@@ -62,8 +61,6 @@
#include "gdkdndprivate.h"
#include <windowsx.h>
#include <tpcshrd.h>
#include "winpointer.h"
#ifdef G_WITH_CYGWIN
#include <fcntl.h>
@@ -156,10 +153,6 @@ static int both_shift_pressed[2]; /* to store keycodes for shift keys */
static HHOOK keyboard_hook = NULL;
static UINT aerosnap_message;
static gboolean pen_touch_input;
static POINT pen_touch_cursor_position;
static LONG last_digitizer_time;
static void
track_mouse_event (DWORD dwFlags,
HWND hwnd)
@@ -194,18 +187,6 @@ _gdk_win32_get_next_tick (gulong suggested_tick)
return cur_tick = suggested_tick;
}
BOOL
_gdk_win32_get_cursor_pos (LPPOINT lpPoint)
{
if (pen_touch_input)
{
*lpPoint = pen_touch_cursor_position;
return TRUE;
}
else
return GetCursorPos (lpPoint);
}
static void
generate_focus_event (GdkDeviceManager *device_manager,
GdkWindow *window,
@@ -247,7 +228,6 @@ generate_grab_broken_event (GdkDeviceManager *device_manager,
{
device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_pointer;
source_device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->system_pointer;
_gdk_device_virtual_set_active (device, source_device);
}
event->grab_broken.window = window;
@@ -1257,7 +1237,6 @@ do_show_window (GdkWindow *window, gboolean hide_window)
static void
send_crossing_event (GdkDisplay *display,
GdkDevice *source_device,
GdkWindow *window,
GdkEventType type,
GdkCrossingMode mode,
@@ -1292,7 +1271,7 @@ send_crossing_event (GdkDisplay *display,
event = gdk_event_new (type);
event->crossing.window = window;
event->crossing.subwindow = subwindow;
event->crossing.time = time_;
event->crossing.time = _gdk_win32_get_next_tick (time_);
event->crossing.x = pt.x / impl->window_scale;
event->crossing.y = pt.y / impl->window_scale;
event->crossing.x_root = (screen_pt->x + _gdk_offset_x) / impl->window_scale;
@@ -1304,11 +1283,9 @@ send_crossing_event (GdkDisplay *display,
event->crossing.focus = FALSE;
event->crossing.state = mask;
gdk_event_set_device (event, device_manager->core_pointer);
gdk_event_set_source_device (event, source_device);
gdk_event_set_source_device (event, device_manager->system_pointer);
gdk_event_set_seat (event, gdk_device_get_seat (device_manager->core_pointer));
_gdk_device_virtual_set_active (device_manager->core_pointer, source_device);
_gdk_win32_append_event (event);
}
@@ -1359,7 +1336,6 @@ find_common_ancestor (GdkWindow *win1,
void
synthesize_crossing_events (GdkDisplay *display,
GdkDevice *source_device,
GdkWindow *src,
GdkWindow *dest,
GdkCrossingMode mode,
@@ -1394,7 +1370,6 @@ synthesize_crossing_events (GdkDisplay *display,
else
notify_type = GDK_NOTIFY_ANCESTOR;
send_crossing_event (display,
source_device,
a, GDK_LEAVE_NOTIFY,
mode,
notify_type,
@@ -1414,7 +1389,6 @@ synthesize_crossing_events (GdkDisplay *display,
while (win != c && win->window_type != GDK_WINDOW_ROOT)
{
send_crossing_event (display,
source_device,
win, GDK_LEAVE_NOTIFY,
mode,
notify_type,
@@ -1457,7 +1431,6 @@ synthesize_crossing_events (GdkDisplay *display,
next = b;
send_crossing_event (display,
source_device,
win, GDK_ENTER_NOTIFY,
mode,
notify_type,
@@ -1477,7 +1450,6 @@ synthesize_crossing_events (GdkDisplay *display,
notify_type = GDK_NOTIFY_INFERIOR;
send_crossing_event (display,
source_device,
b, GDK_ENTER_NOTIFY,
mode,
notify_type,
@@ -1487,27 +1459,6 @@ synthesize_crossing_events (GdkDisplay *display,
}
}
static void
make_crossing_event (GdkDisplay *display,
GdkDevice *device,
GdkWindow *window,
POINT *screen_pt,
guint32 time_)
{
GDK_NOTE (EVENTS, g_print (" mouse_window %p -> %p",
mouse_window ? GDK_WINDOW_HWND (mouse_window) : NULL,
window ? GDK_WINDOW_HWND (window) : NULL));
synthesize_crossing_events (display,
device,
mouse_window, window,
GDK_CROSSING_NORMAL,
screen_pt,
0, /* TODO: Set right mask */
time_,
FALSE);
g_set_object (&mouse_window, window);
}
/* The check_extended flag controls whether to check if the windows want
* events from extended input devices and if the message should be skipped
* because an extended input device is active
@@ -1887,7 +1838,7 @@ generate_button_event (GdkEventType type,
GdkWindow *window,
MSG *msg)
{
GdkEvent *event;
GdkEvent *event = gdk_event_new (type);
GdkDeviceManagerWin32 *device_manager;
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
@@ -1896,7 +1847,6 @@ generate_button_event (GdkEventType type,
device_manager = GDK_DEVICE_MANAGER_WIN32 (gdk_display_get_device_manager (gdk_display_get_default ()));
event = gdk_event_new (type);
event->button.window = window;
event->button.time = _gdk_win32_get_next_tick (msg->time);
event->button.x = current_x = (gint16) GET_X_LPARAM (msg->lParam) / impl->window_scale;
@@ -1910,8 +1860,6 @@ generate_button_event (GdkEventType type,
gdk_event_set_source_device (event, device_manager->system_pointer);
gdk_event_set_seat (event, gdk_device_get_seat (device_manager->core_pointer));
_gdk_device_virtual_set_active (device_manager->core_pointer, device_manager->system_pointer);
_gdk_win32_append_event (event);
}
@@ -2155,8 +2103,6 @@ gdk_event_translate (MSG *msg,
GdkDeviceGrabInfo *pointer_grab = NULL;
GdkWindow *grab_window = NULL;
crossing_cb_t crossing_cb = NULL;
gint button;
GdkAtom target;
@@ -2653,8 +2599,6 @@ gdk_event_translate (MSG *msg,
g_print (" (%d,%d)",
GET_X_LPARAM (msg->lParam), GET_Y_LPARAM (msg->lParam)));
pen_touch_input = FALSE;
g_set_object (&window, find_window_for_mouse_event (window, msg));
/* TODO_CSW?: there used to some synthesize and propagate */
if (GDK_WINDOW_DESTROYED (window))
@@ -2694,8 +2638,6 @@ gdk_event_translate (MSG *msg,
g_print (" (%d,%d)",
GET_X_LPARAM (msg->lParam), GET_Y_LPARAM (msg->lParam)));
pen_touch_input = FALSE;
g_set_object (&window, find_window_for_mouse_event (window, msg));
if (pointer_grab != NULL && pointer_grab->implicit)
@@ -2722,12 +2664,11 @@ gdk_event_translate (MSG *msg,
}
synthesize_crossing_events (display,
device_manager_win32->system_pointer,
native_window, new_window,
GDK_CROSSING_UNGRAB,
&msg->pt,
0, /* TODO: Set right mask */
_gdk_win32_get_next_tick (msg->time),
msg->time,
FALSE);
g_set_object (&mouse_window, new_window);
mouse_window_ignored_leave = NULL;
@@ -2753,13 +2694,6 @@ gdk_event_translate (MSG *msg,
(gpointer) msg->wParam,
GET_X_LPARAM (msg->lParam), GET_Y_LPARAM (msg->lParam)));
if (_gdk_win32_tablet_input_api == GDK_WIN32_TABLET_INPUT_API_WINPOINTER &&
( (msg->time - last_digitizer_time) < 200 ||
-(msg->time - last_digitizer_time) < 200 ))
break;
pen_touch_input = FALSE;
new_window = window;
if (pointer_grab != NULL)
@@ -2787,16 +2721,15 @@ gdk_event_translate (MSG *msg,
if (mouse_window != new_window)
{
GDK_NOTE (EVENTS, g_print (" mouse_window %p -> %p",
GDK_NOTE (EVENTS, g_print (" mouse_sinwod %p -> %p",
mouse_window ? GDK_WINDOW_HWND (mouse_window) : NULL,
new_window ? GDK_WINDOW_HWND (new_window) : NULL));
synthesize_crossing_events (display,
device_manager_win32->system_pointer,
mouse_window, new_window,
GDK_CROSSING_NORMAL,
&msg->pt,
0, /* TODO: Set right mask */
_gdk_win32_get_next_tick (msg->time),
msg->time,
FALSE);
g_set_object (&mouse_window, new_window);
mouse_window_ignored_leave = NULL;
@@ -2848,8 +2781,6 @@ gdk_event_translate (MSG *msg,
gdk_event_set_source_device (event, device_manager_win32->system_pointer);
gdk_event_set_seat (event, gdk_device_get_seat (device_manager_win32->core_pointer));
_gdk_device_virtual_set_active (device_manager_win32->core_pointer, device_manager_win32->system_pointer);
_gdk_win32_append_event (event);
}
@@ -2860,17 +2791,12 @@ gdk_event_translate (MSG *msg,
GDK_NOTE (EVENTS,
g_print (" (%d,%d)",
GET_X_LPARAM (msg->lParam), GET_Y_LPARAM (msg->lParam)));
pen_touch_input = FALSE;
break;
case WM_MOUSELEAVE:
GDK_NOTE (EVENTS, g_print (" %d (%ld,%ld)",
HIWORD (msg->wParam), msg->pt.x, msg->pt.y));
pen_touch_input = FALSE;
new_window = NULL;
hwnd = WindowFromPoint (msg->pt);
ignore_leave = FALSE;
@@ -2896,12 +2822,11 @@ gdk_event_translate (MSG *msg,
if (!ignore_leave)
synthesize_crossing_events (display,
device_manager_win32->system_pointer,
mouse_window, new_window,
GDK_CROSSING_NORMAL,
&msg->pt,
0, /* TODO: Set right mask */
_gdk_win32_get_next_tick (msg->time),
msg->time,
FALSE);
g_set_object (&mouse_window, new_window);
mouse_window_ignored_leave = ignore_leave ? new_window : NULL;
@@ -2910,215 +2835,6 @@ gdk_event_translate (MSG *msg,
return_val = TRUE;
break;
case WM_POINTERDOWN:
if (_gdk_win32_tablet_input_api != GDK_WIN32_TABLET_INPUT_API_WINPOINTER ||
gdk_winpointer_should_forward_message (msg))
{
return_val = FALSE;
break;
}
if (IS_POINTER_PRIMARY_WPARAM (msg->wParam))
{
current_root_x = pen_touch_cursor_position.x = GET_X_LPARAM (msg->lParam);
current_root_y = pen_touch_cursor_position.y = GET_Y_LPARAM (msg->lParam);
pen_touch_input = TRUE;
last_digitizer_time = msg->time;
}
if (pointer_grab != NULL &&
!pointer_grab->implicit &&
!pointer_grab->owner_events)
g_set_object (&window, pointer_grab->native_window);
if (IS_POINTER_PRIMARY_WPARAM (msg->wParam) && mouse_window != window)
crossing_cb = make_crossing_event;
gdk_winpointer_input_events (display, window, crossing_cb, msg);
*ret_valp = 0;
return_val = TRUE;
break;
case WM_POINTERUP:
if (_gdk_win32_tablet_input_api != GDK_WIN32_TABLET_INPUT_API_WINPOINTER ||
gdk_winpointer_should_forward_message (msg))
{
return_val = FALSE;
break;
}
if (IS_POINTER_PRIMARY_WPARAM (msg->wParam))
{
current_root_x = pen_touch_cursor_position.x = GET_X_LPARAM (msg->lParam);
current_root_y = pen_touch_cursor_position.y = GET_Y_LPARAM (msg->lParam);
pen_touch_input = TRUE;
last_digitizer_time = msg->time;
}
if (pointer_grab != NULL &&
!pointer_grab->implicit &&
!pointer_grab->owner_events)
g_set_object (&window, pointer_grab->native_window);
gdk_winpointer_input_events (display, window, NULL, msg);
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
if (impl->drag_move_resize_context.op != GDK_WIN32_DRAGOP_NONE)
{
gdk_win32_window_end_move_resize_drag (window);
}
*ret_valp = 0;
return_val = TRUE;
break;
case WM_POINTERUPDATE:
if (_gdk_win32_tablet_input_api != GDK_WIN32_TABLET_INPUT_API_WINPOINTER ||
gdk_winpointer_should_forward_message (msg))
{
return_val = FALSE;
break;
}
if (IS_POINTER_PRIMARY_WPARAM (msg->wParam))
{
current_root_x = pen_touch_cursor_position.x = GET_X_LPARAM (msg->lParam);
current_root_y = pen_touch_cursor_position.y = GET_Y_LPARAM (msg->lParam);
pen_touch_input = TRUE;
last_digitizer_time = msg->time;
}
if (pointer_grab != NULL &&
!pointer_grab->implicit &&
!pointer_grab->owner_events)
g_set_object (&window, pointer_grab->native_window);
if (IS_POINTER_PRIMARY_WPARAM (msg->wParam) && mouse_window != window)
crossing_cb = make_crossing_event;
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
if (impl->drag_move_resize_context.op != GDK_WIN32_DRAGOP_NONE)
{
gdk_win32_window_do_move_resize_drag (window, current_root_x, current_root_y);
}
else
{
gdk_winpointer_input_events (display, window, crossing_cb, msg);
}
*ret_valp = 0;
return_val = TRUE;
break;
case WM_NCPOINTERUPDATE:
if (_gdk_win32_tablet_input_api != GDK_WIN32_TABLET_INPUT_API_WINPOINTER ||
gdk_winpointer_should_forward_message (msg))
{
return_val = FALSE;
break;
}
if (IS_POINTER_PRIMARY_WPARAM (msg->wParam))
{
current_root_x = pen_touch_cursor_position.x = GET_X_LPARAM (msg->lParam);
current_root_y = pen_touch_cursor_position.y = GET_Y_LPARAM (msg->lParam);
pen_touch_input = TRUE;
last_digitizer_time = msg->time;
}
if (IS_POINTER_PRIMARY_WPARAM (msg->wParam) &&
!IS_POINTER_INCONTACT_WPARAM (msg->wParam) &&
mouse_window != NULL)
{
GdkDevice *event_device = NULL;
guint32 event_time = 0;
if (gdk_winpointer_get_message_info (display, msg, &event_device, &event_time))
{
make_crossing_event(display,
event_device,
NULL,
&pen_touch_cursor_position,
event_time);
}
}
return_val = FALSE; /* forward to DefWindowProc */
break;
case WM_POINTERENTER:
if (_gdk_win32_tablet_input_api != GDK_WIN32_TABLET_INPUT_API_WINPOINTER ||
gdk_winpointer_should_forward_message (msg))
{
return_val = FALSE;
break;
}
if (IS_POINTER_PRIMARY_WPARAM (msg->wParam))
{
current_root_x = pen_touch_cursor_position.x = GET_X_LPARAM (msg->lParam);
current_root_y = pen_touch_cursor_position.y = GET_Y_LPARAM (msg->lParam);
pen_touch_input = TRUE;
last_digitizer_time = msg->time;
}
if (pointer_grab != NULL &&
!pointer_grab->implicit &&
!pointer_grab->owner_events)
g_set_object (&window, pointer_grab->native_window);
if (IS_POINTER_NEW_WPARAM (msg->wParam))
{
gdk_winpointer_input_events (display, window, NULL, msg);
}
*ret_valp = 0;
return_val = TRUE;
break;
case WM_POINTERLEAVE:
if (_gdk_win32_tablet_input_api != GDK_WIN32_TABLET_INPUT_API_WINPOINTER ||
gdk_winpointer_should_forward_message (msg))
{
return_val = FALSE;
break;
}
if (IS_POINTER_PRIMARY_WPARAM (msg->wParam))
{
current_root_x = pen_touch_cursor_position.x = GET_X_LPARAM (msg->lParam);
current_root_y = pen_touch_cursor_position.y = GET_Y_LPARAM (msg->lParam);
pen_touch_input = TRUE;
last_digitizer_time = msg->time;
}
if (!IS_POINTER_INRANGE_WPARAM (msg->wParam))
{
gdk_winpointer_input_events (display, window, NULL, msg);
}
else if (IS_POINTER_PRIMARY_WPARAM (msg->wParam) && mouse_window != NULL)
{
GdkDevice *event_device = NULL;
guint32 event_time = 0;
if (gdk_winpointer_get_message_info (display, msg, &event_device, &event_time))
{
make_crossing_event(display,
event_device,
NULL,
&pen_touch_cursor_position,
event_time);
}
}
gdk_winpointer_interaction_ended (msg);
*ret_valp = 0;
return_val = TRUE;
break;
case WM_MOUSEWHEEL:
case WM_MOUSEHWHEEL:
GDK_NOTE (EVENTS, g_print (" %d", (short) HIWORD (msg->wParam)));
@@ -3197,8 +2913,6 @@ gdk_event_translate (MSG *msg,
gdk_event_set_seat (event, gdk_device_get_seat (device_manager_win32->core_pointer));
gdk_event_set_pointer_emulated (event, FALSE);
_gdk_device_virtual_set_active (device_manager_win32->core_pointer, device_manager_win32->system_pointer);
_gdk_win32_append_event (gdk_event_copy (event));
/* Append the discrete version too */
@@ -3217,6 +2931,44 @@ gdk_event_translate (MSG *msg,
return_val = TRUE;
break;
case WM_HSCROLL:
/* Just print more debugging information, don't actually handle it. */
GDK_NOTE (EVENTS,
(g_print (" %s",
(LOWORD (msg->wParam) == SB_ENDSCROLL ? "ENDSCROLL" :
(LOWORD (msg->wParam) == SB_LEFT ? "LEFT" :
(LOWORD (msg->wParam) == SB_RIGHT ? "RIGHT" :
(LOWORD (msg->wParam) == SB_LINELEFT ? "LINELEFT" :
(LOWORD (msg->wParam) == SB_LINERIGHT ? "LINERIGHT" :
(LOWORD (msg->wParam) == SB_PAGELEFT ? "PAGELEFT" :
(LOWORD (msg->wParam) == SB_PAGERIGHT ? "PAGERIGHT" :
(LOWORD (msg->wParam) == SB_THUMBPOSITION ? "THUMBPOSITION" :
(LOWORD (msg->wParam) == SB_THUMBTRACK ? "THUMBTRACK" :
"???")))))))))),
(LOWORD (msg->wParam) == SB_THUMBPOSITION ||
LOWORD (msg->wParam) == SB_THUMBTRACK) ?
(g_print (" %d", HIWORD (msg->wParam)), 0) : 0));
break;
case WM_VSCROLL:
/* Just print more debugging information, don't actually handle it. */
GDK_NOTE (EVENTS,
(g_print (" %s",
(LOWORD (msg->wParam) == SB_ENDSCROLL ? "ENDSCROLL" :
(LOWORD (msg->wParam) == SB_BOTTOM ? "BOTTOM" :
(LOWORD (msg->wParam) == SB_TOP ? "TOP" :
(LOWORD (msg->wParam) == SB_LINEDOWN ? "LINDOWN" :
(LOWORD (msg->wParam) == SB_LINEUP ? "LINEUP" :
(LOWORD (msg->wParam) == SB_PAGEDOWN ? "PAGEDOWN" :
(LOWORD (msg->wParam) == SB_PAGEUP ? "PAGEUP" :
(LOWORD (msg->wParam) == SB_THUMBPOSITION ? "THUMBPOSITION" :
(LOWORD (msg->wParam) == SB_THUMBTRACK ? "THUMBTRACK" :
"???")))))))))),
(LOWORD (msg->wParam) == SB_THUMBPOSITION ||
LOWORD (msg->wParam) == SB_THUMBTRACK) ?
(g_print (" %d", HIWORD (msg->wParam)), 0) : 0));
break;
case WM_MOUSEACTIVATE:
{
if (gdk_window_get_window_type (window) == GDK_WINDOW_TEMP
@@ -3235,17 +2987,6 @@ gdk_event_translate (MSG *msg,
break;
case WM_POINTERACTIVATE:
if (gdk_window_get_window_type (window) == GDK_WINDOW_TEMP ||
!window->accept_focus ||
_gdk_modal_blocked (gdk_window_get_toplevel (window)))
{
*ret_valp = PA_NOACTIVATE;
return_val = TRUE;
}
break;
case WM_KILLFOCUS:
if (keyboard_grab != NULL &&
!GDK_WINDOW_DESTROYED (keyboard_grab->window) &&
@@ -3824,14 +3565,6 @@ gdk_event_translate (MSG *msg,
return_val = TRUE;
break;
case WM_DESTROY:
/* we have to call RemoveProp before the window is destroyed */
if (_gdk_win32_tablet_input_api == GDK_WIN32_TABLET_INPUT_API_WINPOINTER)
gdk_winpointer_finalize_window (window);
return_val = FALSE;
break;
case WM_NCDESTROY:
if ((pointer_grab != NULL && pointer_grab -> window == window) ||
(keyboard_grab && keyboard_grab -> window == window))
@@ -4001,21 +3734,14 @@ gdk_event_translate (MSG *msg,
* instead
*/
if (LOWORD(msg->wParam) != WA_INACTIVE)
{
if (_gdk_win32_tablet_input_api == GDK_WIN32_TABLET_INPUT_API_WINTAB)
_gdk_wintab_set_tablet_active ();
}
_gdk_input_set_tablet_active ();
break;
case WM_ACTIVATEAPP:
GDK_NOTE (EVENTS, g_print (" %s thread: %" G_GINT64_FORMAT,
msg->wParam ? "YES" : "NO",
(gint64) msg->lParam));
// Clear graphics tablet state
_gdk_input_ignore_core = 0;
break;
case WM_NCHITTEST:
/* TODO: pass all messages to DwmDefWindowProc() first! */
return_val = handle_nchittest (msg->hwnd, window,
@@ -4044,30 +3770,17 @@ gdk_event_translate (MSG *msg,
HIWORD (msg->lParam)));
/* Fall through */
wintab:
if (_gdk_win32_tablet_input_api != GDK_WIN32_TABLET_INPUT_API_WINTAB)
break;
event = gdk_event_new (GDK_NOTHING);
event->any.window = window;
g_object_ref (window);
if (gdk_wintab_input_events (display, event, msg, window))
if (gdk_input_other_event (display, event, msg, window))
_gdk_win32_append_event (event);
else
gdk_event_free (event);
break;
case WM_TABLET_QUERYSYSTEMGESTURESTATUS:
*ret_valp = TABLET_DISABLE_PRESSANDHOLD |
TABLET_DISABLE_PENTAPFEEDBACK |
TABLET_DISABLE_PENBARRELFEEDBACK |
TABLET_DISABLE_FLICKS |
TABLET_DISABLE_FLICKFALLBACKKEYS;
return_val = TRUE;
break;
}
done:
+40 -51
View File
@@ -589,6 +589,8 @@ _gdk_win32_display_init_gl (GdkDisplay *display,
gboolean disable_wgl = FALSE;
#ifdef GDK_WIN32_ENABLE_EGL
EGLDisplay egl_disp;
disable_wgl = ((_gdk_gl_flags & GDK_GL_GLES) != 0) ||
display_win32->running_on_arm64;
#endif
@@ -653,48 +655,46 @@ _gdk_win32_display_init_gl (GdkDisplay *display,
wglMakeCurrent (NULL, NULL);
_destroy_dummy_gl_context (dummy);
return TRUE;
}
#ifdef GDK_WIN32_ENABLE_EGL
else
egl_disp = _gdk_win32_get_egl_display (display_win32);
if (egl_disp == EGL_NO_DISPLAY ||
!eglInitialize (egl_disp, NULL, NULL))
{
EGLDisplay 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)
{
if (egl_disp != EGL_NO_DISPLAY)
{
eglTerminate (egl_disp);
egl_disp = EGL_NO_DISPLAY;
}
return FALSE;
eglTerminate (egl_disp);
egl_disp = EGL_NO_DISPLAY;
}
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");
GDK_NOTE (OPENGL,
g_print ("EGL API version %d.%d found\n"
" - Vendor: %s\n"
" - Checked extensions:\n"
"\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 FALSE;
}
#endif
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");
GDK_NOTE (OPENGL,
g_print ("EGL API version %d.%d found\n"
" - Vendor: %s\n"
" - Checked extensions:\n"
"\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 */
@@ -855,30 +855,19 @@ _set_pixformat_for_hdc (HDC hdc,
const gboolean need_alpha_bits,
GdkWin32Display *display)
{
gboolean already_checked = TRUE;
*best_idx = GetPixelFormat (hdc);
PIXELFORMATDESCRIPTOR pfd;
gboolean set_pixel_format_result = FALSE;
/* one is only allowed to call SetPixelFormat(), and so ChoosePixelFormat()
* one single time per window HDC
*/
if (*best_idx == 0)
{
PIXELFORMATDESCRIPTOR pfd;
gboolean set_pixel_format_result = FALSE;
*best_idx = _get_wgl_pfd (hdc, need_alpha_bits, &pfd, display);
if (*best_idx != 0)
set_pixel_format_result = SetPixelFormat (hdc, *best_idx, &pfd);
GDK_NOTE (OPENGL, g_print ("requesting pixel format...\n"));
already_checked = FALSE;
*best_idx = _get_wgl_pfd (hdc, need_alpha_bits, &pfd, display);
if (*best_idx != 0)
set_pixel_format_result = SetPixelFormat (hdc, *best_idx, &pfd);
/* ChoosePixelFormat() or SetPixelFormat() failed, bail out */
if (*best_idx == 0 || !set_pixel_format_result)
return FALSE;
}
GDK_NOTE (OPENGL, g_print ("%s""requested and set pixel format: %d\n", already_checked ? "already " : "", *best_idx));
/* ChoosePixelFormat() or SetPixelFormat() failed, bail out */
if (*best_idx == 0 || !set_pixel_format_result)
return FALSE;
return TRUE;
}
+1 -1
View File
@@ -36,12 +36,12 @@ HINSTANCE _gdk_dll_hinstance;
HINSTANCE _gdk_app_hmodule;
gint _gdk_input_ignore_core;
GdkWin32TabletInputAPI _gdk_win32_tablet_input_api;
HKL _gdk_input_locale;
gboolean _gdk_input_locale_is_ime = FALSE;
UINT _gdk_input_codepage;
gint _gdk_input_ignore_wintab = FALSE;
gint _gdk_max_colors = 0;
GdkWin32ModalOpKind _modal_operation_in_progress = GDK_WIN32_MODAL_OP_NONE;
+22
View File
@@ -49,6 +49,23 @@
static gboolean gdk_synchronize = FALSE;
static gboolean dummy;
const GOptionEntry _gdk_windowing_args[] = {
{ "sync", 0, 0, G_OPTION_ARG_NONE, &gdk_synchronize,
/* Description of --sync in --help output */ N_("Don't batch GDI requests"), NULL },
{ "no-wintab", 0, 0, G_OPTION_ARG_NONE, &_gdk_input_ignore_wintab,
/* Description of --no-wintab in --help output */ N_("Don't use the Wintab API for tablet support"), NULL },
{ "ignore-wintab", 0, 0, G_OPTION_ARG_NONE, &_gdk_input_ignore_wintab,
/* Description of --ignore-wintab in --help output */ N_("Same as --no-wintab"), NULL },
{ "use-wintab", 0, 0, G_OPTION_ARG_NONE, &dummy,
/* Description of --use-wintab in --help output */ N_("Do use the Wintab API [default]"), NULL },
{ "max-colors", 0, 0, G_OPTION_ARG_INT, &_gdk_max_colors,
/* Description of --max-colors=COLORS in --help output */ N_("Size of the palette in 8 bit mode"),
/* Placeholder in --max-colors=COLORS in --help output */ N_("COLORS") },
{ NULL }
};
BOOL WINAPI
DllMain (HINSTANCE hinstDLL,
DWORD dwReason,
@@ -64,6 +81,11 @@ _gdk_win32_windowing_init (void)
{
gchar buf[10];
if (getenv ("GDK_IGNORE_WINTAB") != NULL)
_gdk_input_ignore_wintab = TRUE;
else if (getenv ("GDK_USE_WINTAB") != NULL)
_gdk_input_ignore_wintab = FALSE;
if (gdk_synchronize)
GdiSetBatchLimit (1);
+1 -1
View File
@@ -523,7 +523,7 @@ populate_monitor_devices_from_display_config (GPtrArray *monitors)
refresh = &dispconf_paths[path_index].targetInfo.refreshRate;
gdk_monitor_set_refresh_rate (mon,
refresh->Numerator * (UINT64) 1000 / refresh->Denominator);
refresh->Numerator * 1000 / refresh->Denominator);
}
g_free (dispconf_paths);
+1 -11
View File
@@ -163,18 +163,10 @@ struct _GdkColormapPrivateWin32
GdkColorInfo *info;
};
typedef enum {
GDK_WIN32_TABLET_INPUT_API_NONE = 0,
GDK_WIN32_TABLET_INPUT_API_WINTAB,
GDK_WIN32_TABLET_INPUT_API_WINPOINTER
} GdkWin32TabletInputAPI;
GType _gdk_gc_win32_get_type (void);
gulong _gdk_win32_get_next_tick (gulong suggested_tick);
BOOL _gdk_win32_get_cursor_pos (LPPOINT lpPoint);
void _gdk_window_init_position (GdkWindow *window);
void _gdk_window_move_resize_child (GdkWindow *window,
gint x,
@@ -270,8 +262,6 @@ void _gdk_other_api_failed (const gchar *where,
#define WIN32_GDI_FAILED(api) WIN32_API_FAILED (api)
#define OTHER_API_FAILED(api) _gdk_other_api_failed (G_STRLOC, api)
#define WIN32_API_FAILED_LOG_ONCE(api) G_STMT_START { static gboolean logged = 0; if (!logged) { _gdk_win32_api_failed (G_STRLOC , api); logged = 1; }} G_STMT_END
/* These two macros call a GDI or other Win32 API and if the return
* value is zero or NULL, print a warning message. The majority of GDI
* calls return zero or NULL on failure. The value of the macros is nonzero
@@ -297,7 +287,6 @@ extern HINSTANCE _gdk_dll_hinstance;
extern HINSTANCE _gdk_app_hmodule;
extern gint _gdk_input_ignore_core;
extern GdkWin32TabletInputAPI _gdk_win32_tablet_input_api;
/* These are thread specific, but GDK/win32 works OK only when invoked
* from a single thread anyway.
@@ -337,6 +326,7 @@ void _gdk_win32_end_modal_call (GdkWin32ModalOpKind kind);
/* Options */
extern gboolean _gdk_input_ignore_wintab;
extern gint _gdk_max_colors;
#define GDK_WIN32_COLORMAP_DATA(cmap) ((GdkColormapPrivateWin32 *) GDK_COLORMAP (cmap)->windowing_data)
+26 -10
View File
@@ -555,6 +555,7 @@ RegisterGdkClass (GdkWindowType wtype, GdkWindowTypeHint wtype_hint)
static ATOM klassTOPLEVEL = 0;
static ATOM klassCHILD = 0;
static ATOM klassTEMP = 0;
static ATOM klassTEMPSHADOW = 0;
static HICON hAppIcon = NULL;
static HICON hAppIconSm = NULL;
static WNDCLASSEXW wcl;
@@ -651,16 +652,34 @@ RegisterGdkClass (GdkWindowType wtype, GdkWindowTypeHint wtype_hint)
break;
case GDK_WINDOW_TEMP:
if (klassTEMP == 0)
if ((wtype_hint == GDK_WINDOW_TYPE_HINT_MENU) ||
(wtype_hint == GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU) ||
(wtype_hint == GDK_WINDOW_TYPE_HINT_POPUP_MENU))
{
wcl.lpszClassName = L"gdkWindowTemp";
wcl.style |= CS_SAVEBITS;
ONCE_PER_CLASS ();
klassTEMP = RegisterClassExW (&wcl);
if (klassTEMPSHADOW == 0)
{
wcl.lpszClassName = L"gdkWindowTempShadow";
wcl.style |= CS_SAVEBITS;
wcl.style |= 0x00020000; /* CS_DROPSHADOW */
ONCE_PER_CLASS ();
klassTEMPSHADOW = RegisterClassExW (&wcl);
}
klass = klassTEMPSHADOW;
}
else
{
if (klassTEMP == 0)
{
wcl.lpszClassName = L"gdkWindowTemp";
wcl.style |= CS_SAVEBITS;
ONCE_PER_CLASS ();
klassTEMP = RegisterClassExW (&wcl);
}
klass = klassTEMP;
klass = klassTEMP;
}
break;
default:
@@ -975,9 +994,6 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
if (attributes_mask & GDK_WA_CURSOR)
gdk_window_set_cursor (window, attributes->cursor);
if (_gdk_win32_tablet_input_api == GDK_WIN32_TABLET_INPUT_API_WINPOINTER)
gdk_winpointer_initialize_window (window);
_gdk_win32_window_enable_transparency (window);
}
+1 -5
View File
@@ -30,13 +30,9 @@ all: \
gdk-win32.lib \
gdk.res
gdk_win32_DEPS = \
hid.lib
gdk_win32_OBJECTS = \
gdkcursor-win32.obj \
gdkdevice-win32.obj \
gdkdevice-winpointer.obj \
gdkdevice-wintab.obj \
gdkdevicemanager-win32.obj \
gdkdnd-win32.obj \
@@ -65,7 +61,7 @@ gdk.res : rc\gdk.rc
rc -DBUILDNUMBER=0 -r -fo gdk.res rc\gdk.rc
gdk-win32.lib : $(gdk_win32_OBJECTS)
lib -out:gdk-win32.lib $(gdk_win32_DEPS) $(gdk_win32_OBJECTS)
lib -out:gdk-win32.lib $(gdk_win32_OBJECTS)
clean::
del *.obj
+1 -3
View File
@@ -3,7 +3,6 @@ gdk_win32_sources = files(
'gdkdevicemanager-win32.c',
'gdkdevice-virtual.c',
'gdkdevice-win32.c',
'gdkdevice-winpointer.c',
'gdkdevice-wintab.c',
'gdkdisplay-win32.c',
'gdkdisplaymanager-win32.c',
@@ -48,8 +47,7 @@ install_headers(gdk_win32_public_headers, subdir: 'gtk-3.0/gdk/win32')
install_headers('gdkwin32.h', subdir: 'gtk-3.0/gdk')
gdk_win32_deps = [ # FIXME
pangowin32_dep,
meson.get_compiler('c').find_library('hid')
pangowin32_dep
]
libgdk_win32 = static_library('gdk-win32',
-320
View File
@@ -1,320 +0,0 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 2021 the GTK team
*
* 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/>.
*/
/* This code is derived from portions provided by the mingw-w64 project
* (mingw-w64.org), originally licensed under the Zope Public License
* (ZPL) version 2.1, with modifications made on May 12, 2021.
* Legal notice of the Zope Public License version 2.1 follows:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions in source code must retain the accompanying copyright
* notice, this list of conditions, and the following disclaimer.
* 2. Redistributions in binary form must reproduce the accompanying
* copyright notice, this list of conditions, and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* 3. Names of the copyright holders must not be used to endorse or promote
* products derived from this software without prior written permission
* from the copyright holders.
* 4. The right to distribute this software or to use it for any purpose does
* not give you the right to use Servicemarks (sm) or Trademarks (tm) of
* the copyright holders. Use of them is covered by separate agreement
* with the copyright holders.
* 5. If any files are modified, you must cause the modified files to carry
* prominent notices stating that you changed the files and the date of
* any change.
*/
#ifndef POINTER_FLAG_NONE
#include <windows.h>
#include <tchar.h>
#define WM_POINTERDEVICECHANGE 0x238
#define WM_POINTERDEVICEINRANGE 0x239
#define WM_POINTERDEVICEOUTOFRANGE 0x23a
#define WM_NCPOINTERUPDATE 0x0241
#define WM_NCPOINTERDOWN 0x0242
#define WM_NCPOINTERUP 0x0243
#define WM_POINTERUPDATE 0x0245
#define WM_POINTERDOWN 0x0246
#define WM_POINTERUP 0x0247
#define WM_POINTERENTER 0x0249
#define WM_POINTERLEAVE 0x024a
#define WM_POINTERACTIVATE 0x024b
#define WM_POINTERCAPTURECHANGED 0x024c
#define WM_TOUCHHITTESTING 0x024d
#define WM_POINTERWHEEL 0x024e
#define WM_POINTERHWHEEL 0x024f
#define DM_POINTERHITTEST 0x0250
#define WM_POINTERROUTEDTO 0x0251
#define WM_POINTERROUTEDAWAY 0x0252
#define WM_POINTERROUTEDRELEASED 0x0253
#define POINTER_FLAG_NONE 0x00000000
#define POINTER_FLAG_NEW 0x00000001
#define POINTER_FLAG_INRANGE 0x00000002
#define POINTER_FLAG_INCONTACT 0x00000004
#define POINTER_FLAG_FIRSTBUTTON 0x00000010
#define POINTER_FLAG_SECONDBUTTON 0x00000020
#define POINTER_FLAG_THIRDBUTTON 0x00000040
#define POINTER_FLAG_FOURTHBUTTON 0x00000080
#define POINTER_FLAG_FIFTHBUTTON 0x00000100
#define POINTER_FLAG_PRIMARY 0x00002000
#define POINTER_FLAG_CONFIDENCE 0x00004000
#define POINTER_FLAG_CANCELED 0x00008000
#define POINTER_FLAG_DOWN 0x00010000
#define POINTER_FLAG_UPDATE 0x00020000
#define POINTER_FLAG_UP 0x00040000
#define POINTER_FLAG_WHEEL 0x00080000
#define POINTER_FLAG_HWHEEL 0x00100000
#define POINTER_FLAG_CAPTURECHANGED 0x00200000
#define POINTER_FLAG_HASTRANSFORM 0x00400000
#define POINTER_MOD_SHIFT (0x0004)
#define POINTER_MOD_CTRL (0x0008)
#define TOUCH_FLAG_NONE 0x00000000
#define TOUCH_MASK_NONE 0x00000000
#define TOUCH_MASK_CONTACTAREA 0x00000001
#define TOUCH_MASK_ORIENTATION 0x00000002
#define TOUCH_MASK_PRESSURE 0x00000004
#define PEN_FLAG_NONE 0x00000000
#define PEN_FLAG_BARREL 0x00000001
#define PEN_FLAG_INVERTED 0x00000002
#define PEN_FLAG_ERASER 0x00000004
#define PEN_MASK_NONE 0x00000000
#define PEN_MASK_PRESSURE 0x00000001
#define PEN_MASK_ROTATION 0x00000002
#define PEN_MASK_TILT_X 0x00000004
#define PEN_MASK_TILT_Y 0x00000008
#define POINTER_MESSAGE_FLAG_NEW 0x00000001
#define POINTER_MESSAGE_FLAG_INRANGE 0x00000002
#define POINTER_MESSAGE_FLAG_INCONTACT 0x00000004
#define POINTER_MESSAGE_FLAG_FIRSTBUTTON 0x00000010
#define POINTER_MESSAGE_FLAG_SECONDBUTTON 0x00000020
#define POINTER_MESSAGE_FLAG_THIRDBUTTON 0x00000040
#define POINTER_MESSAGE_FLAG_FOURTHBUTTON 0x00000080
#define POINTER_MESSAGE_FLAG_FIFTHBUTTON 0x00000100
#define POINTER_MESSAGE_FLAG_PRIMARY 0x00002000
#define POINTER_MESSAGE_FLAG_CONFIDENCE 0x00004000
#define POINTER_MESSAGE_FLAG_CANCELED 0x00008000
#define GET_POINTERID_WPARAM(wParam) (LOWORD (wParam))
#define IS_POINTER_FLAG_SET_WPARAM(wParam, flag) (((DWORD)HIWORD (wParam) &(flag)) == (flag))
#define IS_POINTER_NEW_WPARAM(wParam) IS_POINTER_FLAG_SET_WPARAM (wParam, POINTER_MESSAGE_FLAG_NEW)
#define IS_POINTER_INRANGE_WPARAM(wParam) IS_POINTER_FLAG_SET_WPARAM (wParam, POINTER_MESSAGE_FLAG_INRANGE)
#define IS_POINTER_INCONTACT_WPARAM(wParam) IS_POINTER_FLAG_SET_WPARAM (wParam, POINTER_MESSAGE_FLAG_INCONTACT)
#define IS_POINTER_FIRSTBUTTON_WPARAM(wParam) IS_POINTER_FLAG_SET_WPARAM (wParam, POINTER_MESSAGE_FLAG_FIRSTBUTTON)
#define IS_POINTER_SECONDBUTTON_WPARAM(wParam) IS_POINTER_FLAG_SET_WPARAM (wParam, POINTER_MESSAGE_FLAG_SECONDBUTTON)
#define IS_POINTER_THIRDBUTTON_WPARAM(wParam) IS_POINTER_FLAG_SET_WPARAM (wParam, POINTER_MESSAGE_FLAG_THIRDBUTTON)
#define IS_POINTER_FOURTHBUTTON_WPARAM(wParam) IS_POINTER_FLAG_SET_WPARAM (wParam, POINTER_MESSAGE_FLAG_FOURTHBUTTON)
#define IS_POINTER_FIFTHBUTTON_WPARAM(wParam) IS_POINTER_FLAG_SET_WPARAM (wParam, POINTER_MESSAGE_FLAG_FIFTHBUTTON)
#define IS_POINTER_PRIMARY_WPARAM(wParam) IS_POINTER_FLAG_SET_WPARAM (wParam, POINTER_MESSAGE_FLAG_PRIMARY)
#define HAS_POINTER_CONFIDENCE_WPARAM(wParam) IS_POINTER_FLAG_SET_WPARAM (wParam, POINTER_MESSAGE_FLAG_CONFIDENCE)
#define IS_POINTER_CANCELED_WPARAM(wParam) IS_POINTER_FLAG_SET_WPARAM (wParam, POINTER_MESSAGE_FLAG_CANCELED)
#define PA_ACTIVATE MA_ACTIVATE
#define PA_NOACTIVATE MA_NOACTIVATE
typedef DWORD POINTER_INPUT_TYPE;
typedef UINT32 POINTER_FLAGS;
typedef UINT32 TOUCH_FLAGS;
typedef UINT32 TOUCH_MASK;
typedef UINT32 PEN_FLAGS;
typedef UINT32 PEN_MASK;
enum tagPOINTER_INPUT_TYPE {
PT_POINTER = 0x00000001,
PT_TOUCH = 0x00000002,
PT_PEN = 0x00000003,
PT_MOUSE = 0x00000004,
PT_TOUCHPAD = 0x00000005
};
typedef enum tagFEEDBACK_TYPE {
FEEDBACK_TOUCH_CONTACTVISUALIZATION = 1,
FEEDBACK_PEN_BARRELVISUALIZATION = 2,
FEEDBACK_PEN_TAP = 3,
FEEDBACK_PEN_DOUBLETAP = 4,
FEEDBACK_PEN_PRESSANDHOLD = 5,
FEEDBACK_PEN_RIGHTTAP = 6,
FEEDBACK_TOUCH_TAP = 7,
FEEDBACK_TOUCH_DOUBLETAP = 8,
FEEDBACK_TOUCH_PRESSANDHOLD = 9,
FEEDBACK_TOUCH_RIGHTTAP = 10,
FEEDBACK_GESTURE_PRESSANDTAP = 11,
FEEDBACK_MAX = 0xffffffff
} FEEDBACK_TYPE;
typedef enum tagPOINTER_BUTTON_CHANGE_TYPE {
POINTER_CHANGE_NONE,
POINTER_CHANGE_FIRSTBUTTON_DOWN,
POINTER_CHANGE_FIRSTBUTTON_UP,
POINTER_CHANGE_SECONDBUTTON_DOWN,
POINTER_CHANGE_SECONDBUTTON_UP,
POINTER_CHANGE_THIRDBUTTON_DOWN,
POINTER_CHANGE_THIRDBUTTON_UP,
POINTER_CHANGE_FOURTHBUTTON_DOWN,
POINTER_CHANGE_FOURTHBUTTON_UP,
POINTER_CHANGE_FIFTHBUTTON_DOWN,
POINTER_CHANGE_FIFTHBUTTON_UP,
} POINTER_BUTTON_CHANGE_TYPE;
typedef struct tagPOINTER_INFO {
POINTER_INPUT_TYPE pointerType;
UINT32 pointerId;
UINT32 frameId;
POINTER_FLAGS pointerFlags;
HANDLE sourceDevice;
HWND hwndTarget;
POINT ptPixelLocation;
POINT ptHimetricLocation;
POINT ptPixelLocationRaw;
POINT ptHimetricLocationRaw;
DWORD dwTime;
UINT32 historyCount;
INT32 InputData;
DWORD dwKeyStates;
UINT64 PerformanceCount;
POINTER_BUTTON_CHANGE_TYPE ButtonChangeType;
} POINTER_INFO;
typedef struct tagPOINTER_TOUCH_INFO {
POINTER_INFO pointerInfo;
TOUCH_FLAGS touchFlags;
TOUCH_MASK touchMask;
RECT rcContact;
RECT rcContactRaw;
UINT32 orientation;
UINT32 pressure;
} POINTER_TOUCH_INFO;
typedef struct tagPOINTER_PEN_INFO {
POINTER_INFO pointerInfo;
PEN_FLAGS penFlags;
PEN_MASK penMask;
UINT32 pressure;
UINT32 rotation;
INT32 tiltX;
INT32 tiltY;
} POINTER_PEN_INFO;
typedef enum {
POINTER_FEEDBACK_DEFAULT = 1,
POINTER_FEEDBACK_INDIRECT = 2,
POINTER_FEEDBACK_NONE = 3
} POINTER_FEEDBACK_MODE;
typedef struct tagUSAGE_PROPERTIES {
USHORT level;
USHORT page;
USHORT usage;
INT32 logicalMinimum;
INT32 logicalMaximum;
USHORT unit;
USHORT exponent;
BYTE count;
INT32 physicalMinimum;
INT32 physicalMaximum;
} USAGE_PROPERTIES, *PUSAGE_PROPERTIES;
typedef struct tagPOINTER_TYPE_INFO {
POINTER_INPUT_TYPE type;
union {
POINTER_TOUCH_INFO touchInfo;
POINTER_PEN_INFO penInfo;
} DUMMYUNIONNAME;
} POINTER_TYPE_INFO, *PPOINTER_TYPE_INFO;
#define POINTER_DEVICE_PRODUCT_STRING_MAX 520
#define PDC_ARRIVAL 0x001
#define PDC_REMOVAL 0x002
#define PDC_ORIENTATION_0 0x004
#define PDC_ORIENTATION_90 0x008
#define PDC_ORIENTATION_180 0x010
#define PDC_ORIENTATION_270 0x020
#define PDC_MODE_DEFAULT 0x040
#define PDC_MODE_CENTERED 0x080
#define PDC_MAPPING_CHANGE 0x100
#define PDC_RESOLUTION 0x200
#define PDC_ORIGIN 0x400
#define PDC_MODE_ASPECTRATIOPRESERVED 0x800
typedef enum tagPOINTER_DEVICE_TYPE {
POINTER_DEVICE_TYPE_INTEGRATED_PEN = 0x00000001,
POINTER_DEVICE_TYPE_EXTERNAL_PEN = 0x00000002,
POINTER_DEVICE_TYPE_TOUCH = 0x00000003,
POINTER_DEVICE_TYPE_TOUCH_PAD = 0x00000004,
POINTER_DEVICE_TYPE_MAX = 0xffffffff
} POINTER_DEVICE_TYPE;
typedef struct tagPOINTER_DEVICE_INFO {
DWORD displayOrientation;
HANDLE device;
POINTER_DEVICE_TYPE pointerDeviceType;
HMONITOR monitor;
ULONG startingCursorId;
USHORT maxActiveContacts;
WCHAR productString[POINTER_DEVICE_PRODUCT_STRING_MAX];
} POINTER_DEVICE_INFO;
typedef struct tagPOINTER_DEVICE_PROPERTY {
INT32 logicalMin;
INT32 logicalMax;
INT32 physicalMin;
INT32 physicalMax;
UINT32 unit;
UINT32 unitExponent;
USHORT usagePageId;
USHORT usageId;
} POINTER_DEVICE_PROPERTY;
typedef enum tagPOINTER_DEVICE_CURSOR_TYPE {
POINTER_DEVICE_CURSOR_TYPE_UNKNOWN = 0x00000000,
POINTER_DEVICE_CURSOR_TYPE_TIP = 0x00000001,
POINTER_DEVICE_CURSOR_TYPE_ERASER = 0x00000002,
POINTER_DEVICE_CURSOR_TYPE_MAX = 0xffffffff
} POINTER_DEVICE_CURSOR_TYPE;
typedef struct tagPOINTER_DEVICE_CURSOR_INFO {
UINT32 cursorId;
POINTER_DEVICE_CURSOR_TYPE cursor;
} POINTER_DEVICE_CURSOR_INFO;
#endif /* POINTER_FLAG_NONE */
#if WINVER < 0x0601
typedef struct tagGESTURECONFIG {
DWORD dwID;
DWORD dwWant;
DWORD dwBlock;
} GESTURECONFIG,*PGESTURECONFIG;
#endif /* WINVER < 0x0601 */
#ifndef MICROSOFT_TABLETPENSERVICE_PROPERTY
#define MICROSOFT_TABLETPENSERVICE_PROPERTY _T("MicrosoftTabletPenServiceProperty")
#endif
-3
View File
@@ -45,9 +45,6 @@ get_display_name (GFile *file,
if (name == NULL)
{
name = g_file_get_basename (file);
if (name == NULL)
name = g_file_get_uri (file);
if (!g_utf8_validate (name, -1, NULL))
{
tmp = name;
-3
View File
@@ -1964,9 +1964,6 @@ _gdk_x11_display_update_grab_info_ungrab (GdkDisplay *display,
static void
gdk_x11_display_beep (GdkDisplay *display)
{
if (!GDK_X11_DISPLAY (display)->trusted_client)
return;
#ifdef HAVE_XKB
XkbBell (GDK_DISPLAY_XDISPLAY (display), None, 0, None);
#else
-2
View File
@@ -634,14 +634,12 @@ gdk_window_cache_new (GdkScreen *screen)
*/
if (gdk_screen_is_composited (screen))
{
gdk_x11_display_error_trap_push (GDK_X11_SCREEN (screen)->display);
cow = XCompositeGetOverlayWindow (xdisplay, GDK_WINDOW_XID (root_window));
gdk_window_cache_add (result, cow, 0, 0,
gdk_x11_screen_get_width (screen) * GDK_X11_SCREEN(screen)->window_scale,
gdk_x11_screen_get_height (screen) * GDK_X11_SCREEN(screen)->window_scale,
TRUE);
XCompositeReleaseOverlayWindow (xdisplay, GDK_WINDOW_XID (root_window));
gdk_x11_display_error_trap_pop_ignored (GDK_X11_SCREEN (screen)->display);
}
#endif
+17 -6
View File
@@ -240,13 +240,24 @@ gdk_x_io_error (Display *display)
/* This is basically modelled after the code in XLib. We need
* an explicit error handler here, so we can disable our atexit()
* which would otherwise cause a nice segfault.
* We g_debug() instead of g_warning(), because g_warning()
* could possibly be redirected to the log
* We fprintf(stderr, instead of g_warning() because g_warning()
* could possibly be redirected to a dialog
*/
g_debug ("%s: Fatal IO error %d (%s) on X server %s.\n",
g_get_prgname (),
errno, g_strerror (errno),
display ? DisplayString (display) : gdk_get_display_arg_name ());
if (errno == EPIPE)
{
g_message ("The application '%s' lost its connection to the display %s;\n"
"most likely the X server was shut down or you killed/destroyed\n"
"the application.\n",
g_get_prgname (),
display ? DisplayString (display) : gdk_get_display_arg_name ());
}
else
{
g_message ("%s: Fatal IO error %d (%s) on X server %s.\n",
g_get_prgname (),
errno, g_strerror (errno),
display ? DisplayString (display) : gdk_get_display_arg_name ());
}
_exit (1);
}
-3
View File
@@ -5472,9 +5472,6 @@ gdk_x11_window_beep (GdkWindow *window)
display = GDK_WINDOW_DISPLAY (window);
if (!GDK_X11_DISPLAY (display)->trusted_client)
return FALSE;
#ifdef HAVE_XKB
if (GDK_X11_DISPLAY (display)->use_xkb)
{
+5 -13
View File
@@ -1355,10 +1355,7 @@ gtk.gresource.xml: Makefile.am inspector/Makefile.inc
echo " <file compressed='true' preprocess='xml-stripblanks'>inspector/$$n</file>" >> $@; \
done; \
echo " <file>inspector/logo.png</file>" >> $@; \
for f in $(srcdir)/emoji/*.data; do \
n=`basename $$f`; \
echo " <file>emoji/$$n</file>" >> $@; \
done; \
echo " <file>emoji/emoji.data</file>" >> $@; \
echo " </gresource>" >> $@; \
echo "</gresources>" >> $@;
@@ -1744,20 +1741,15 @@ EXTRA_DIST += \
$(gesture_sources) \
$(theme_sources) \
$(gsettings_SCHEMAS) \
compose/compose-parse.py \
compose-parse.py \
emoji/convert-emoji.c \
emoji/gresource.xml.in \
emoji/README.md \
emoji/de.data \
emoji/en.data \
emoji/es.data \
emoji/fr.data \
emoji/zh.data \
emoji/emoji.json \
emoji/emoji1.json \
a11y/Makefile.inc \
deprecated/Makefile.inc \
glade/README.glade \
glade/gtk-private-widgets.xml \
compose/gtk-compose-lookaside.txt \
gtk-compose-lookaside.txt \
inspector/Makefile.inc \
libgtk3.manifest.in \
gtk-win32.rc.body.in \
-2
View File
@@ -11,7 +11,6 @@ a11y_h_sources = \
a11y/gtkcontainercellaccessible.h \
a11y/gtkentryaccessible.h \
a11y/gtkexpanderaccessible.h \
a11y/gtkfilechooserwidgetaccessible.h \
a11y/gtkflowboxaccessible.h \
a11y/gtkflowboxchildaccessible.h \
a11y/gtkframeaccessible.h \
@@ -89,7 +88,6 @@ a11y_c_sources = \
a11y/gtkcontainercellaccessible.c \
a11y/gtkentryaccessible.c \
a11y/gtkexpanderaccessible.c \
a11y/gtkfilechooserwidgetaccessible.c \
a11y/gtkflowboxaccessible.c \
a11y/gtkflowboxchildaccessible.c \
a11y/gtkframeaccessible.c \
+1 -9
View File
@@ -30,19 +30,12 @@ struct _GtkContainerCellAccessiblePrivate
G_DEFINE_TYPE_WITH_PRIVATE (GtkContainerCellAccessible, gtk_container_cell_accessible, GTK_TYPE_CELL_ACCESSIBLE)
static void
unset_child (gpointer child)
{
atk_object_set_parent (ATK_OBJECT (child), NULL);
g_object_unref (child);
}
static void
gtk_container_cell_accessible_finalize (GObject *obj)
{
GtkContainerCellAccessible *container = GTK_CONTAINER_CELL_ACCESSIBLE (obj);
g_list_free_full (container->priv->children, unset_child);
g_list_free_full (container->priv->children, g_object_unref);
G_OBJECT_CLASS (gtk_container_cell_accessible_parent_class)->finalize (obj);
}
@@ -164,7 +157,6 @@ gtk_container_cell_accessible_remove_child (GtkContainerCellAccessible *containe
g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (child));
g_return_if_fail (container->priv->n_children > 0);
atk_object_set_parent (ATK_OBJECT (child), NULL);
container->priv->children = g_list_remove (container->priv->children, child);
container->priv->n_children--;
-122
View File
@@ -1,122 +0,0 @@
/* GTK+ - accessibility implementations
* Copyright 2001, 2002, 2003 Sun Microsystems 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/>.
*/
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
#include "gtkfilechooserwidgetaccessible.h"
static void atk_action_interface_init (AtkActionIface *iface);
G_DEFINE_TYPE_WITH_CODE (GtkFileChooserWidgetAccessible, gtk_file_chooser_widget_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE,
G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init))
static void
gtk_file_chooser_widget_accessible_initialize (AtkObject *obj,
gpointer data)
{
ATK_OBJECT_CLASS (gtk_file_chooser_widget_accessible_parent_class)->initialize (obj, data);
obj->role = ATK_ROLE_FILE_CHOOSER;
}
static void
gtk_file_chooser_widget_accessible_class_init (GtkFileChooserWidgetAccessibleClass *klass)
{
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
GtkContainerAccessibleClass *container_class = (GtkContainerAccessibleClass*)klass;
class->initialize = gtk_file_chooser_widget_accessible_initialize;
container_class->add_gtk = NULL;
container_class->remove_gtk = NULL;
}
static void
gtk_file_chooser_widget_accessible_init (GtkFileChooserWidgetAccessible *file_chooser_widget)
{
}
static gboolean
gtk_file_chooser_widget_accessible_do_action (AtkAction *action,
gint i)
{
GtkWidget *widget;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
if (widget == NULL)
return FALSE;
if (!gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget))
return FALSE;
switch (i)
{
case 0:
g_signal_emit_by_name (GTK_FILE_CHOOSER_WIDGET (widget), "location-popup", "");
return TRUE;
default:
break;
}
return FALSE;
}
static gint
gtk_file_chooser_widget_accessible_get_n_actions (AtkAction *action)
{
return 1;
}
static const gchar *
gtk_file_chooser_widget_accessible_action_get_name (AtkAction *action,
gint i)
{
if (i == 0)
return "show_location";
return NULL;
}
static const gchar *
gtk_file_chooser_widget_accessible_action_get_localized_name (AtkAction *action,
gint i)
{
if (i == 0)
return C_("Action name", "Show location");
return NULL;
}
static const gchar *
gtk_file_chooser_widget_accessible_action_get_description (AtkAction *action,
gint i)
{
if (i == 0)
return C_("Action description", "Show the File Chooser's Location text field");
return NULL;
}
static void
atk_action_interface_init (AtkActionIface *iface)
{
iface->do_action = gtk_file_chooser_widget_accessible_do_action;
iface->get_n_actions = gtk_file_chooser_widget_accessible_get_n_actions;
iface->get_name = gtk_file_chooser_widget_accessible_action_get_name;
iface->get_localized_name = gtk_file_chooser_widget_accessible_action_get_localized_name;
iface->get_description = gtk_file_chooser_widget_accessible_action_get_description;
}
-57
View File
@@ -1,57 +0,0 @@
/* GTK+ - accessibility implementations
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GTK_FILE_CHOOSER_WIDGET_ACCESSIBLE_H__
#define __GTK_FILE_CHOOSER_WIDGET_ACCESSIBLE_H__
#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk-a11y.h> can be included directly."
#endif
#include <gtk/a11y/gtkcontaineraccessible.h>
G_BEGIN_DECLS
#define GTK_TYPE_FILE_CHOOSER_WIDGET_ACCESSIBLE (gtk_file_chooser_widget_accessible_get_type ())
#define GTK_FILE_CHOOSER_WIDGET_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FILE_CHOOSER_WIDGET_ACCESSIBLE, GtkFileChooserWidgetAccessible))
#define GTK_FILE_CHOOSER_WIDGET_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_FILE_CHOOSER_WIDGET_ACCESSIBLE, GtkFileChooserWidgetAccessibleClass))
#define GTK_IS_FILE_CHOOSER_WIDGET_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_FILE_CHOOSER_WIDGET_ACCESSIBLE))
#define GTK_IS_FILE_CHOOSER_WIDGET_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FILE_CHOOSER_WIDGET_ACCESSIBLE))
#define GTK_FILE_CHOOSER_WIDGET_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_FILE_CHOOSER_WIDGET_ACCESSIBLE, GtkFileChooserWidgetAccessibleClass))
typedef struct _GtkFileChooserWidgetAccessible GtkFileChooserWidgetAccessible;
typedef struct _GtkFileChooserWidgetAccessibleClass GtkFileChooserWidgetAccessibleClass;
typedef struct _GtkFileChooserWidgetAccessiblePrivate GtkFileChooserWidgetAccessiblePrivate;
struct _GtkFileChooserWidgetAccessible
{
GtkContainerAccessible parent;
GtkFileChooserWidgetAccessiblePrivate *priv;
};
struct _GtkFileChooserWidgetAccessibleClass
{
GtkContainerAccessibleClass parent_class;
};
GDK_AVAILABLE_IN_ALL
GType gtk_file_chooser_widget_accessible_get_type (void);
G_END_DECLS
#endif /* __GTK_FILE_CHOOSER_WIDGET_ACCESSIBLE_H__ */
-11
View File
@@ -104,17 +104,6 @@ static void
cell_info_free (GtkTreeViewAccessibleCellInfo *cell_info)
{
gtk_accessible_set_widget (GTK_ACCESSIBLE (cell_info->cell), NULL);
if (GTK_IS_CONTAINER_CELL_ACCESSIBLE (cell_info->cell))
{
GList *children;
while ((children = gtk_container_cell_accessible_get_children (GTK_CONTAINER_CELL_ACCESSIBLE (cell_info->cell))) != NULL)
{
GtkCellAccessible *child = children->data;
gtk_container_cell_accessible_remove_child (GTK_CONTAINER_CELL_ACCESSIBLE (cell_info->cell), child);
}
}
g_object_unref (cell_info->cell);
g_free (cell_info);
-2
View File
@@ -14,7 +14,6 @@ a11y_sources = files(
'gtkcontainercellaccessible.c',
'gtkentryaccessible.c',
'gtkexpanderaccessible.c',
'gtkfilechooserwidgetaccessible.c',
'gtkflowboxaccessible.c',
'gtkflowboxchildaccessible.c',
'gtkframeaccessible.c',
@@ -73,7 +72,6 @@ a11y_headers = files(
'gtkcontainercellaccessible.h',
'gtkentryaccessible.h',
'gtkexpanderaccessible.h',
'gtkfilechooserwidgetaccessible.h',
'gtkflowboxaccessible.h',
'gtkflowboxchildaccessible.h',
'gtkframeaccessible.h',
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# compose-parse.py, version 1.4
@@ -26,7 +26,6 @@ URL_KEYSYMSTXT = "http://www.cl.cam.ac.uk/~mgk25/ucs/keysyms.txt"
URL_GDKKEYSYMSH = "http://git.gnome.org/browse/gtk%2B/plain/gdk/gdkkeysyms.h"
URL_UNICODEDATATXT = 'http://www.unicode.org/Public/6.0.0/ucd/UnicodeData.txt'
FILENAME_COMPOSE_SUPPLEMENTARY = 'gtk-compose-lookaside.txt'
FILENAME_COMPOSE_NEGATIVE_SUPPLEMENTARY = 'gtk-compose-remove.txt'
# We currently support keysyms of size 2; once upstream xorg gets sorted,
# we might produce some tables with size 2 and some with size 4.
@@ -449,18 +448,6 @@ xorg_compose_sequences_raw = []
for seq in composefile.readlines():
xorg_compose_sequences_raw.append(seq)
try:
composefile_lookaside = open(FILENAME_COMPOSE_NEGATIVE_SUPPLEMENTARY, 'r')
for seq in composefile_lookaside.readlines():
xorg_compose_sequences_raw.remove(seq)
except IOError, (errno, strerror):
if opt_verbose:
print "I/O error(%s): %s" % (errno, strerror)
print "Did not find negative lookaside compose file. Continuing..."
except:
print "Unexpected error: ", sys.exc_info()[0]
sys.exit(-1)
try:
composefile_lookaside = open(FILENAME_COMPOSE_SUPPLEMENTARY, 'r')
for seq in composefile_lookaside.readlines():
+4 -2
View File
@@ -83,8 +83,10 @@ gtk_hbox_init (GtkHBox *hbox)
*
* Returns: a new #GtkHBox.
*
* Deprecated: 3.2: You should use gtk_box_new() with a %GTK_ORIENTATION_HORIZONTAL
* #GtkOrientable:orientation instead
* Deprecated: 3.2: You can use gtk_box_new() with %GTK_ORIENTATION_HORIZONTAL instead,
* which is a quick and easy change. But the recommendation is to switch to
* #GtkGrid, since #GtkBox is going to go away eventually.
* See [Migrating from other containers to GtkGrid][gtk-migrating-GtkGrid].
*/
GtkWidget *
gtk_hbox_new (gboolean homogeneous,
+4 -2
View File
@@ -90,8 +90,10 @@ gtk_vbox_init (GtkVBox *vbox)
*
* Returns: a new #GtkVBox.
*
* Deprecated: 3.2: You should use gtk_box_new() with a %GTK_ORIENTATION_VERTICAL
* #GtkOrientable:orientation instead
* Deprecated: 3.2: You can use gtk_box_new() with %GTK_ORIENTATION_VERTICAL instead,
* which is a quick and easy change. But the recommendation is to switch to
* #GtkGrid, since #GtkBox is going to go away eventually.
* See [Migrating from other containers to GtkGrid][gtk-migrating-GtkGrid].
*/
GtkWidget *
gtk_vbox_new (gboolean homogeneous,
-23
View File
@@ -1,23 +0,0 @@
Emoji data
==========
We use Emoji data from Unicode and the CLDR, stored in a GVariant.
The immediate source for our data is the json files from
https://github.com/milesj/emojibase.git
To convert the data from that repository to a GVariant that GTK
can use, the convert-emoji tool can be used:
convert-emoji $emojibase/packages/data/de/data.raw.json de.data
for example (for German).
To make these usable by GTK, we wrap them in a resource bundle
that has the GVariant as
/org/gtk/libgtk/emoji/de.data
and install the resulting resource bundle at this location:
/usr/share/gtk-4.0/emoji/de.gresource
+86 -82
View File
@@ -18,40 +18,18 @@
/* Build with gcc -o convert-emoji convert-emoji.c `pkg-config --cflags --libs json-glib-1.0`
*/
/* Reads data from the json files in emojibase, expecting
* language-specific data.raw.json as input
*/
/* The format of the generated data is: a(ausasu).
* Each member of the array has the following fields:
* au - sequence of unicode codepoints. If the
* sequence contains a 0, it marks the point
* where skin tone modifiers should be inserted
* s - name, e.g. "man worker"
* as - keywords, e.g. "man", "worker"
* u - the group that this item belongs to:
* 0: smileys-emotion
* 1: people-body
* 2: component
* 3: animals-nature
* 4: food-drink
* 5: travel-places
* 6: activities
* 7: objects
* 8: symbols
* 9: flags
*/
#include <json-glib/json-glib.h>
#include <string.h>
gboolean
parse_code (GVariantBuilder *b,
const char *code)
const char *code,
GString *name_key)
{
g_auto(GStrv) strv = NULL;
int j;
strv = g_strsplit (code, "-", -1);
strv = g_strsplit (code, " ", -1);
for (j = 0; strv[j]; j++)
{
guint32 u;
@@ -66,7 +44,12 @@ parse_code (GVariantBuilder *b,
if (0x1f3fb <= u && u <= 0x1f3ff)
g_variant_builder_add (b, "u", 0);
else
g_variant_builder_add (b, "u", u);
{
g_variant_builder_add (b, "u", u);
if (j > 0)
g_string_append_c (name_key, '-');
g_string_append_printf (name_key, "%x", u);
}
}
return TRUE;
@@ -77,27 +60,57 @@ main (int argc, char *argv[])
{
JsonParser *parser;
JsonNode *root;
JsonObject *ro;
JsonArray *array;
JsonObject *ro;
JsonNode *node;
const char *unicode;
const char *name;
JsonObjectIter iter;
GError *error = NULL;
guint length, i;
GVariantBuilder builder;
GVariant *v;
GString *s;
GBytes *bytes;
GHashTable *names;
GString *name_key;
if (argc != 3)
if (argc != 4)
{
g_print ("Usage: emoji-convert INPUT OUTPUT\n");
g_print ("Usage: emoji-convert INPUT INPUT1 OUTPUT\n");
return 1;
}
parser = json_parser_new ();
if (!json_parser_load_from_file (parser, argv[2], &error))
{
g_error ("%s", error->message);
return 1;
}
root = json_parser_get_root (parser);
ro = json_node_get_object (root);
json_object_iter_init (&iter, ro);
names = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
name_key = g_string_new ("");
while (json_object_iter_next (&iter, &name, &node))
{
JsonObject *obj = json_node_get_object (node);
const char *unicode;
const char *shortname;
unicode = json_object_get_string_member (obj, "unicode");
shortname = json_object_get_string_member (obj, "shortname");
g_hash_table_insert (names, g_strdup (unicode), g_strdup (shortname));
}
g_object_unref (parser);
parser = json_parser_new ();
if (!json_parser_load_from_file (parser, argv[1], &error))
{
g_error ("%s", error->message);
@@ -108,74 +121,65 @@ main (int argc, char *argv[])
array = json_node_get_array (root);
length = json_array_get_length (array);
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(ausasu)"));
for (i = 0; i < length; i++)
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(auss)"));
i = 0;
while (i < length)
{
JsonObject *obj = json_array_get_object_element (array, i);
JsonNode *node = json_array_get_element (array, i);
JsonObject *obj = json_node_get_object (node);
GVariantBuilder b1;
GVariantBuilder b2;
guint group;
const char *name;
const char *shortname;
char *code;
int j;
gboolean skip;
gboolean has_variations;
if (!json_object_has_member (obj, "group"))
continue;
group = json_object_get_int_member (obj, "group");
name = json_object_get_string_member (obj, "annotation");
if (json_object_has_member (obj, "skins"))
{
JsonArray *a2 = json_object_get_array_member (obj, "skins");
JsonNode *n2 = json_array_get_element (a2, 0);
JsonObject *o2 = json_node_get_object (n2);
code = g_strdup (json_object_get_string_member (o2, "hexcode"));
}
else
{
code = g_strdup (json_object_get_string_member (obj, "hexcode"));
}
i++;
g_variant_builder_init (&b1, G_VARIANT_TYPE ("au"));
if (!parse_code (&b1, code))
return 1;
name = json_object_get_string_member (obj, "name");
code = g_strdup (json_object_get_string_member (obj, "code"));
g_variant_builder_init (&b2, G_VARIANT_TYPE ("as"));
if (json_object_has_member (obj, "tags"))
has_variations = FALSE;
while (i < length)
{
JsonArray *tags = json_object_get_array_member (obj, "tags");
for (int j = 0; j < json_array_get_length (tags); j++)
g_variant_builder_add (&b2, "s", json_array_get_string_element (tags, j));
JsonNode *node2 = json_array_get_element (array, i);
JsonObject *obj2 = json_node_get_object (node2);
const char *name2;
const char *code2;
name2 = json_object_get_string_member (obj2, "name");
code2 = json_object_get_string_member (obj2, "code");
if (!strstr (name2, "skin tone") || !g_str_has_prefix (name2, name))
break;
if (!has_variations)
{
has_variations = TRUE;
g_free (code);
code = g_strdup (code2);
}
i++;
}
g_variant_builder_add (&builder, "(ausasu)", &b1, name, &b2, group);
g_string_set_size (name_key, 0);
if (!parse_code (&b1, code, name_key))
return 1;
shortname = g_hash_table_lookup (names, name_key->str);
g_variant_builder_add (&builder, "(auss)", &b1, name, shortname ? shortname : "");
}
v = g_variant_builder_end (&builder);
if (g_str_has_suffix (argv[2], ".json"))
bytes = g_variant_get_data_as_bytes (v);
if (!g_file_set_contents (argv[3], g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes), &error))
{
JsonNode *node;
char *out;
node = json_gvariant_serialize (v);
out = json_to_string (node, TRUE);
if (!g_file_set_contents (argv[2], out, -1, &error))
{
g_error ("%s", error->message);
return 1;
}
}
else
{
GBytes *bytes;
bytes = g_variant_get_data_as_bytes (v);
if (!g_file_set_contents (argv[2], g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes), &error))
{
g_error ("%s", error->message);
return 1;
}
g_error ("%s", error->message);
return 1;
}
return 0;
BIN
View File
Binary file not shown.
Binary file not shown.
+15740
View File
File diff suppressed because it is too large Load Diff
+34181
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gtk/libgtk/emoji/">
<file>@lang@.data</file>
</gresource>
</gresources>
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -76,7 +76,7 @@ for f in get_files('inspector', '.ui'):
xml += '''
<file>inspector/logo.png</file>
<file>emoji/en.data</file>
<file>emoji/emoji.data</file>
</gresource>
</gresources>'''
+22 -32
View File
@@ -227,30 +227,6 @@ screensaver_signal_portal (GDBusConnection *connection,
}
}
static void
ss_get_active_cb (GObject *source,
GAsyncResult *result,
gpointer data)
{
GtkApplicationImplDBus *dbus = (GtkApplicationImplDBus *) data;
GDBusProxy *proxy = G_DBUS_PROXY (source);
GError *error = NULL;
GVariant *ret;
gboolean active;
ret = g_dbus_proxy_call_finish (proxy, result, &error);
if (ret == NULL)
{
g_warning ("Getting screensaver status failed: %s", error->message);
g_error_free (error);
return;
}
g_variant_get (ret, "(b)", &active);
g_variant_unref (ret);
gtk_application_set_screensaver_active (dbus->impl.application, active);
}
static void
create_monitor_cb (GObject *source,
GAsyncResult *result,
@@ -353,17 +329,31 @@ gtk_application_impl_dbus_startup (GtkApplicationImpl *impl,
if (dbus->ss_proxy)
{
GVariant *active_var;
gboolean active;
g_signal_connect (dbus->ss_proxy, "g-signal",
G_CALLBACK (screensaver_signal_session), impl->application);
g_dbus_proxy_call (dbus->ss_proxy,
"GetActive",
NULL,
G_DBUS_CALL_FLAGS_NONE,
G_MAXINT,
NULL,
ss_get_active_cb,
dbus);
active_var = g_dbus_proxy_call_sync (dbus->ss_proxy,
"GetActive",
NULL,
G_DBUS_CALL_FLAGS_NONE,
G_MAXINT,
NULL,
&error);
if (!active_var)
{
g_debug ("Error calling GetActive on GNOME screensaver: %s",
error->message);
g_clear_error (&error);
}
else
{
g_variant_get (active_var, "(b)", &active);
g_variant_unref (active_var);
gtk_application_set_screensaver_active (dbus->impl.application, active);
}
}
g_debug ("Registering client '%s' '%s'", dbus->application_id, client_id);
+2 -5
View File
@@ -1526,17 +1526,14 @@ gtk_box_pack (GtkBox *box,
guint padding,
GtkPackType pack_type)
{
GtkContainer *container;
GtkBoxPrivate *private;
GtkContainer *container = GTK_CONTAINER (box);
GtkBoxPrivate *private = box->priv;
GtkBoxChild *child_info;
g_return_val_if_fail (GTK_IS_BOX (box), NULL);
g_return_val_if_fail (GTK_IS_WIDGET (child), NULL);
g_return_val_if_fail (_gtk_widget_get_parent (child) == NULL, NULL);
container = GTK_CONTAINER (box);
private = box->priv;
child_info = g_new (GtkBoxChild, 1);
child_info->widget = child;
child_info->padding = padding;
-10
View File
@@ -3563,18 +3563,8 @@ gtk_cell_area_inner_cell_area (GtkCellArea *area,
*inner_area = *cell_area;
if (border.left + border.right > cell_area->width)
{
border.left = cell_area->width / 2;
border.right = (cell_area->width + 1) / 2;
}
inner_area->x += border.left;
inner_area->width -= border.left + border.right;
if (border.top + border.bottom > cell_area->height)
{
border.top = cell_area->height / 2;
border.bottom = (cell_area->height + 1) / 2;
}
inner_area->y += border.top;
inner_area->height -= border.top + border.bottom;
}
-6
View File
@@ -1190,12 +1190,6 @@ gtk_check_algorithmically (const guint16 *compose_buffer,
for (i = 0; i < n_compose && IS_DEAD_KEY (compose_buffer[i]); i++)
;
/* Allow at most 2 dead keys */
if (i > 2)
return FALSE;
/* Can't combine if there's no base character */
if (i == n_compose)
return TRUE;
+9 -9
View File
@@ -121,14 +121,14 @@ gtk_css_custom_gadget_get_preferred_size (GtkCssGadget *gadget,
GtkCssCustomGadgetPrivate *priv = gtk_css_custom_gadget_get_instance_private (GTK_CSS_CUSTOM_GADGET (gadget));
if (priv->preferred_size_func)
priv->preferred_size_func (gadget, orientation, for_size,
minimum, natural,
minimum_baseline, natural_baseline,
priv->data);
return priv->preferred_size_func (gadget, orientation, for_size,
minimum, natural,
minimum_baseline, natural_baseline,
priv->data);
else
GTK_CSS_GADGET_CLASS (gtk_css_custom_gadget_parent_class)->get_preferred_size (gadget, orientation, for_size,
minimum, natural,
minimum_baseline, natural_baseline);
return GTK_CSS_GADGET_CLASS (gtk_css_custom_gadget_parent_class)->get_preferred_size (gadget, orientation, for_size,
minimum, natural,
minimum_baseline, natural_baseline);
}
static void
@@ -140,9 +140,9 @@ gtk_css_custom_gadget_allocate (GtkCssGadget *gadget,
GtkCssCustomGadgetPrivate *priv = gtk_css_custom_gadget_get_instance_private (GTK_CSS_CUSTOM_GADGET (gadget));
if (priv->allocate_func)
priv->allocate_func (gadget, allocation, baseline, out_clip, priv->data);
return priv->allocate_func (gadget, allocation, baseline, out_clip, priv->data);
else
GTK_CSS_GADGET_CLASS (gtk_css_custom_gadget_parent_class)->allocate (gadget, allocation, baseline, out_clip);
return GTK_CSS_GADGET_CLASS (gtk_css_custom_gadget_parent_class)->allocate (gadget, allocation, baseline, out_clip);
}
static gboolean
+1 -3
View File
@@ -485,9 +485,7 @@ make_blurred_pango_surface (cairo_t *existing_cr,
x_scale * (ink_rect.width + 2 * clip_radius),
y_scale * (ink_rect.height + 2 * clip_radius));
cairo_surface_set_device_scale (surface, x_scale, y_scale);
cairo_surface_set_device_offset (surface,
x_scale * (-ink_rect.x + clip_radius),
y_scale * (-ink_rect.y + clip_radius));
cairo_surface_set_device_offset (surface, -ink_rect.x + clip_radius, -ink_rect.y + clip_radius);
cr = cairo_create (surface);
cairo_move_to (cr, 0, 0);
_gtk_pango_fill_layout (cr, layout);
+3 -7
View File
@@ -42,7 +42,6 @@
#include "gtkintl.h"
#include "gtkquartz.h"
#include "gdk/quartz/gdkquartz.h"
#include "gdk/quartz/gdkquartz-cocoa-access.h"
#include "gdk/quartz/gdkquartz-gtk-only.h"
#include "gdk/quartz/gdkquartzdnd.h"
#include "gtkselectionprivate.h"
@@ -1088,10 +1087,8 @@ gtk_drag_begin_idle (gpointer arg)
[types release];
if ((nswindow = get_toplevel_nswindow (info->source_widget)) == NULL)
{
_gdk_quartz_drag_source_context_destroy_gtk_only ();
return G_SOURCE_REMOVE;
}
return G_SOURCE_REMOVE;
/* Ref the context. It's unreffed when the drag has been aborted */
g_object_ref (info->context);
@@ -1103,7 +1100,6 @@ gtk_drag_begin_idle (gpointer arg)
if (drag_image == NULL)
{
g_object_unref (info->context);
_gdk_quartz_drag_source_context_destroy_gtk_only ();
return G_SOURCE_REMOVE;
}
@@ -1672,7 +1668,7 @@ _gtk_drag_source_handle_event (GtkWidget *widget,
break;
default:
g_assert_not_reached ();
}
}
}
/**
+40 -221
View File
@@ -27,7 +27,6 @@
#include "gtkflowbox.h"
#include "gtkstack.h"
#include "gtklabel.h"
#include "gtkmain.h"
#include "gtkgesturelongpress.h"
#include "gtkgesturemultipress.h"
#include "gtkpopover.h"
@@ -42,7 +41,7 @@ typedef struct {
GtkWidget *box;
GtkWidget *heading;
GtkWidget *button;
int group;
const char *first;
gunichar label;
gboolean empty;
} EmojiSection;
@@ -168,43 +167,14 @@ populate_recent_section (GtkEmojiChooser *chooser)
empty = FALSE;
}
gtk_widget_set_visible (chooser->recent.box, !empty);
gtk_widget_set_sensitive (chooser->recent.button, !empty);
if (!empty)
{
gtk_widget_show (chooser->recent.box);
gtk_widget_set_sensitive (chooser->recent.button, TRUE);
}
g_variant_unref (variant);
}
static GVariant *
get_recent_emoji_data (GtkWidget *widget)
{
GVariant *emoji_data = g_object_get_data (G_OBJECT (widget), "emoji-data");
GVariantIter *codes_iter;
GVariantIter *keywords_iter;
GVariantBuilder codes_builder;
const char *name;
const char *shortname;
guint code;
guint group;
g_assert (emoji_data);
if (g_variant_is_of_type (emoji_data, G_VARIANT_TYPE ("(auss)")))
return emoji_data;
g_variant_get (emoji_data, "(au&sasu)", &codes_iter, &name, &keywords_iter, &group);
g_variant_builder_init (&codes_builder, G_VARIANT_TYPE ("au"));
while (g_variant_iter_loop (codes_iter, "u", &code))
g_variant_builder_add (&codes_builder, "u", code);
g_variant_iter_free (codes_iter);
g_variant_iter_free (keywords_iter);
shortname = "";
return g_variant_new ("(auss)", &codes_builder, name, shortname);
}
static void
add_recent_item (GtkEmojiChooser *chooser,
GVariant *item,
@@ -222,7 +192,7 @@ add_recent_item (GtkEmojiChooser *chooser,
children = gtk_container_get_children (GTK_CONTAINER (chooser->recent.box));
for (l = children, i = 1; l; l = l->next, i++)
{
GVariant *item2 = get_recent_emoji_data (GTK_WIDGET (l->data));
GVariant *item2 = g_object_get_data (G_OBJECT (l->data), "emoji-data");
gunichar modifier2 = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (l->data), "modifier"));
if (modifier == modifier2 && g_variant_equal (item, item2))
@@ -252,23 +222,6 @@ add_recent_item (GtkEmojiChooser *chooser,
g_variant_unref (item);
}
static gboolean
should_close (GtkEmojiChooser *chooser)
{
GdkDisplay *display;
GdkSeat *seat;
GdkDevice *device;
GdkModifierType state;
display = gtk_widget_get_display (GTK_WIDGET (chooser));
seat = gdk_display_get_default_seat (display);
device = gdk_seat_get_pointer (seat);
gdk_device_get_state (device, gtk_widget_get_window (GTK_WIDGET (chooser)),
NULL, &state);
return (state & GDK_CONTROL_MASK) == 0;
}
static void
emoji_activated (GtkFlowBox *box,
GtkFlowBoxChild *child,
@@ -281,22 +234,13 @@ emoji_activated (GtkFlowBox *box,
GVariant *item;
gunichar modifier;
if (should_close (chooser))
gtk_popover_popdown (GTK_POPOVER (chooser));
else
{
GtkWidget *popover;
popover = gtk_widget_get_ancestor (GTK_WIDGET (box), GTK_TYPE_POPOVER);
if (popover != GTK_WIDGET (chooser))
gtk_popover_popdown (GTK_POPOVER (popover));
}
gtk_popover_popdown (GTK_POPOVER (chooser));
ebox = gtk_bin_get_child (GTK_BIN (child));
label = gtk_bin_get_child (GTK_BIN (ebox));
text = g_strdup (gtk_label_get_label (GTK_LABEL (label)));
item = get_recent_emoji_data (GTK_WIDGET (child));
item = (GVariant*) g_object_get_data (G_OBJECT (child), "emoji-data");
modifier = (gunichar) GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (child), "modifier"));
add_recent_item (chooser, item, modifier);
@@ -496,87 +440,11 @@ add_emoji (GtkWidget *box,
gtk_flow_box_insert (GTK_FLOW_BOX (box), child, prepend ? 0 : -1);
}
GBytes *
get_emoji_data (void)
{
GBytes *bytes;
const char *lang;
char q[10];
char *path;
GError *error = NULL;
lang = pango_language_to_string (gtk_get_default_language ());
if (strchr (lang, '-'))
{
int i;
for (i = 0; lang[i] != '-' && i < 9; i++)
q[i] = lang[i];
q[i] = '\0';
lang = q;
}
path = g_strconcat ("/org/gtk/libgtk/emoji/", lang, ".data", NULL);
bytes = g_resources_lookup_data (path, 0, &error);
if (bytes)
{
g_debug ("Found emoji data for %s in resource %s", lang, path);
g_free (path);
return bytes;
}
if (g_error_matches (error, G_RESOURCE_ERROR, G_RESOURCE_ERROR_NOT_FOUND))
{
char *filename;
char *gresource_name;
GMappedFile *file;
g_clear_error (&error);
gresource_name = g_strconcat (lang, ".gresource", NULL);
filename = g_build_filename (_gtk_get_data_prefix (), "share", "gtk-3.0",
"emoji", gresource_name, NULL);
g_clear_pointer (&gresource_name, g_free);
file = g_mapped_file_new (filename, FALSE, NULL);
if (file)
{
GBytes *data;
GResource *resource;
data = g_mapped_file_get_bytes (file);
g_mapped_file_unref (file);
resource = g_resource_new_from_data (data, NULL);
g_bytes_unref (data);
g_debug ("Registering resource for Emoji data for %s from file %s", lang, filename);
g_resources_register (resource);
g_resource_unref (resource);
bytes = g_resources_lookup_data (path, 0, NULL);
if (bytes)
{
g_debug ("Found emoji data for %s in resource %s", lang, path);
g_free (path);
g_free (filename);
return bytes;
}
}
g_free (filename);
}
g_clear_error (&error);
g_free (path);
return g_resources_lookup_data ("/org/gtk/libgtk/emoji/en.data", 0, NULL);
}
static gboolean
populate_emoji_chooser (gpointer data)
{
GtkEmojiChooser *chooser = data;
GBytes *bytes = NULL;
GVariant *item;
guint64 start, now;
@@ -584,12 +452,8 @@ populate_emoji_chooser (gpointer data)
if (!chooser->data)
{
GBytes *bytes;
bytes = get_emoji_data ();
chooser->data = g_variant_ref_sink (g_variant_new_from_bytes (G_VARIANT_TYPE ("a(ausasu)"), bytes, TRUE));
g_bytes_unref (bytes);
bytes = g_resources_lookup_data ("/org/gtk/libgtk/emoji/emoji.data", 0, NULL);
chooser->data = g_variant_ref_sink (g_variant_new_from_bytes (G_VARIANT_TYPE ("a(auss)"), bytes, TRUE));
}
if (!chooser->iter)
@@ -599,27 +463,25 @@ populate_emoji_chooser (gpointer data)
}
while ((item = g_variant_iter_next_value (chooser->iter)))
{
guint group;
const char *name;
g_variant_get_child (item, 3, "u", &group);
g_variant_get_child (item, 1, "&s", &name);
if (group == chooser->people.group)
chooser->box = chooser->people.box;
else if (group == chooser->body.group)
if (strcmp (name, chooser->body.first) == 0)
chooser->box = chooser->body.box;
else if (group == chooser->nature.group)
else if (strcmp (name, chooser->nature.first) == 0)
chooser->box = chooser->nature.box;
else if (group == chooser->food.group)
else if (strcmp (name, chooser->food.first) == 0)
chooser->box = chooser->food.box;
else if (group == chooser->travel.group)
else if (strcmp (name, chooser->travel.first) == 0)
chooser->box = chooser->travel.box;
else if (group == chooser->activities.group)
else if (strcmp (name, chooser->activities.first) == 0)
chooser->box = chooser->activities.box;
else if (group == chooser->objects.group)
else if (strcmp (name, chooser->objects.first) == 0)
chooser->box = chooser->objects.box;
else if (group == chooser->symbols.group)
else if (strcmp (name, chooser->symbols.first) == 0)
chooser->box = chooser->symbols.box;
else if (group == chooser->flags.group)
else if (strcmp (name, chooser->flags.first) == 0)
chooser->box = chooser->flags.box;
add_emoji (chooser->box, FALSE, item, 0, chooser);
@@ -630,6 +492,9 @@ populate_emoji_chooser (gpointer data)
return G_SOURCE_CONTINUE;
}
/* We scroll to the top on show, so check the right button for the 1st time */
gtk_widget_set_state_flags (chooser->recent.button, GTK_STATE_FLAG_CHECKED, FALSE);
g_variant_iter_free (chooser->iter);
chooser->iter = NULL;
chooser->box = NULL;
@@ -665,9 +530,6 @@ adj_value_changed (GtkAdjustment *adj,
EmojiSection const *section = sections[i];
GtkAllocation alloc;
if (!gtk_widget_get_visible (section->box))
continue;
if (section->heading)
gtk_widget_get_allocation (section->heading, &alloc);
else
@@ -691,31 +553,6 @@ adj_value_changed (GtkAdjustment *adj,
}
}
static gboolean
match_tokens (const char **term_tokens,
const char **hit_tokens)
{
int i, j;
gboolean matched;
matched = TRUE;
for (i = 0; term_tokens[i]; i++)
{
for (j = 0; hit_tokens[j]; j++)
if (g_str_has_prefix (hit_tokens[j], term_tokens[i]))
goto one_matched;
matched = FALSE;
break;
one_matched:
continue;
}
return matched;
}
static gboolean
filter_func (GtkFlowBoxChild *child,
gpointer data)
@@ -725,8 +562,6 @@ filter_func (GtkFlowBoxChild *child,
GVariant *emoji_data;
const char *text;
const char *name;
char **term_tokens;
char **name_tokens;
gboolean res;
res = TRUE;
@@ -741,23 +576,8 @@ filter_func (GtkFlowBoxChild *child,
if (!emoji_data)
goto out;
term_tokens = g_str_tokenize_and_fold (text, "en", NULL);
g_variant_get_child (emoji_data, 1, "&s", &name);
name_tokens = g_str_tokenize_and_fold (name, "en", NULL);
res = match_tokens ((const char **)term_tokens, (const char **)name_tokens);
if (g_variant_is_of_type (emoji_data, G_VARIANT_TYPE ("(ausasu)")))
{
const char **keywords;
g_variant_get_child (emoji_data, 2, "^a&s", &keywords);
res |= match_tokens ((const char **)term_tokens, keywords);
}
g_strfreev (term_tokens);
g_strfreev (name_tokens);
res = g_str_match_string (text, name, TRUE);
out:
if (res)
@@ -827,14 +647,14 @@ search_changed (GtkEntry *entry,
static void
setup_section (GtkEmojiChooser *chooser,
EmojiSection *section,
int group,
const char *icon)
EmojiSection *section,
const char *first,
const char *icon)
{
GtkAdjustment *adj;
GtkWidget *image;
section->group = group;
section->first = first;
image = gtk_bin_get_child (GTK_BIN (section->button));
gtk_image_set_from_icon_name (GTK_IMAGE (image), icon, GTK_ICON_SIZE_BUTTON);
@@ -897,16 +717,16 @@ gtk_emoji_chooser_init (GtkEmojiChooser *chooser)
adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (chooser->scrolled_window));
g_signal_connect (adj, "value-changed", G_CALLBACK (adj_value_changed), chooser);
setup_section (chooser, &chooser->recent, -1, "emoji-recent-symbolic");
setup_section (chooser, &chooser->people, 0, "emoji-people-symbolic");
setup_section (chooser, &chooser->body, 1, "emoji-body-symbolic");
setup_section (chooser, &chooser->nature, 3, "emoji-nature-symbolic");
setup_section (chooser, &chooser->food, 4, "emoji-food-symbolic");
setup_section (chooser, &chooser->travel, 5, "emoji-travel-symbolic");
setup_section (chooser, &chooser->activities, 6, "emoji-activities-symbolic");
setup_section (chooser, &chooser->objects, 7, "emoji-objects-symbolic");
setup_section (chooser, &chooser->symbols, 8, "emoji-symbols-symbolic");
setup_section (chooser, &chooser->flags, 9, "emoji-flags-symbolic");
setup_section (chooser, &chooser->recent, NULL, "emoji-recent-symbolic");
setup_section (chooser, &chooser->people, "grinning face", "emoji-people-symbolic");
setup_section (chooser, &chooser->body, "selfie", "emoji-body-symbolic");
setup_section (chooser, &chooser->nature, "monkey face", "emoji-nature-symbolic");
setup_section (chooser, &chooser->food, "grapes", "emoji-food-symbolic");
setup_section (chooser, &chooser->travel, "globe showing Europe-Africa", "emoji-travel-symbolic");
setup_section (chooser, &chooser->activities, "jack-o-lantern", "emoji-activities-symbolic");
setup_section (chooser, &chooser->objects, "muted speaker", "emoji-objects-symbolic");
setup_section (chooser, &chooser->symbols, "ATM sign", "emoji-symbols-symbolic");
setup_section (chooser, &chooser->flags, "chequered flag", "emoji-flags-symbolic");
populate_recent_section (chooser);
@@ -924,7 +744,6 @@ gtk_emoji_chooser_show (GtkWidget *widget)
adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (chooser->scrolled_window));
gtk_adjustment_set_value (adj, 0);
adj_value_changed (adj, chooser);
gtk_entry_set_text (GTK_ENTRY (chooser->search_entry), "");
}
+9 -11
View File
@@ -116,7 +116,7 @@ next:
break;
}
}
while (g_unichar_isalnum (g_utf8_get_char (p)) || *p == '_' || *p == ' ');
while (g_unichar_isalnum (g_utf8_get_char (p)) || *p == '_');
if (found_candidate)
n_matches = populate_completion (completion, p, 0);
@@ -521,7 +521,7 @@ add_emoji (GtkWidget *list,
GtkWidget *box;
PangoAttrList *attrs;
char text[64];
const char *name;
const char *shortname;
GtkWidget *stack;
gunichar modifier;
@@ -551,8 +551,8 @@ add_emoji (GtkWidget *list,
gtk_box_pack_start (GTK_BOX (box), stack, FALSE, FALSE, 0);
g_object_set_data (G_OBJECT (child), "stack", stack);
g_variant_get_child (emoji_data, 1, "&s", &name);
label = gtk_label_new (name);
g_variant_get_child (emoji_data, 2, "&s", &shortname);
label = gtk_label_new (shortname);
gtk_widget_show (label);
gtk_label_set_xalign (GTK_LABEL (label), 0);
@@ -610,11 +610,10 @@ populate_completion (GtkEmojiCompletion *completion,
g_variant_iter_init (&iter, completion->data);
while ((item = g_variant_iter_next_value (&iter)))
{
const char *name;
const char *shortname;
g_variant_get_child (item, 1, "&s", &name);
if (g_str_has_prefix (name, text + 1))
g_variant_get_child (item, 2, "&s", &shortname);
if (g_str_has_prefix (shortname, text))
{
n_matches++;
@@ -664,9 +663,8 @@ gtk_emoji_completion_init (GtkEmojiCompletion *completion)
gtk_widget_init_template (GTK_WIDGET (completion));
bytes = get_emoji_data ();
completion->data = g_variant_ref_sink (g_variant_new_from_bytes (G_VARIANT_TYPE ("a(ausasu)"), bytes, TRUE));
bytes = g_resources_lookup_data ("/org/gtk/libgtk/emoji/emoji.data", 0, NULL);
completion->data = g_variant_ref_sink (g_variant_new_from_bytes (G_VARIANT_TYPE ("a(auss)"), bytes, TRUE));
g_bytes_unref (bytes);
completion->long_press = gtk_gesture_long_press_new (completion->list);
+1 -1
View File
@@ -40,7 +40,7 @@
#include "gtklabel.h"
#include "gtkfilechooserentry.h"
#include "gtkfilefilterprivate.h"
#include <quartz/gdkquartz-cocoa-access.h>
#include <quartz/gdkquartz-gtk-only.h>
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
typedef struct {
-2
View File
@@ -69,7 +69,6 @@
#include "gtkcheckbutton.h"
#include "gtkwindowgroup.h"
#include "gtkintl.h"
#include "a11y/gtkfilechooserwidgetaccessible.h"
#include "gtkshow.h"
#include "gtkmain.h"
#include "gtkscrollable.h"
@@ -8753,7 +8752,6 @@ gtk_file_chooser_widget_class_init (GtkFileChooserWidgetClass *class)
gtk_widget_class_bind_template_callback (widget_class, rename_file_rename_clicked);
gtk_widget_class_bind_template_callback (widget_class, rename_file_end);
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_FILE_CHOOSER_WIDGET_ACCESSIBLE);
gtk_widget_class_set_css_name (widget_class, "filechooser");
}
+3 -3
View File
@@ -110,7 +110,7 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
*
* The level of granularity to offer for selecting fonts.
*
* Since: 3.24.1
* Since: 3.22.30
*/
g_object_interface_install_property
(iface,
@@ -129,7 +129,7 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
* The selected font features, in a format that is compatible with
* CSS and with Pango attributes.
*
* Since: 3.24.1
* Since: 3.22.30
*/
g_object_interface_install_property
(iface,
@@ -146,7 +146,7 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
* selected, in a format that is compatible with CSS and with Pango
* attributes.
*
* Since: 3.24.1
* Since: 3.22.30
*/
g_object_interface_install_property
(iface,
+19 -19
View File
@@ -391,7 +391,7 @@ gtk_gl_area_ensure_buffers (GtkGLArea *area)
priv->have_buffers = TRUE;
glGenFramebuffers (1, &priv->frame_buffer);
glGenFramebuffersEXT (1, &priv->frame_buffer);
if (priv->has_alpha)
{
@@ -402,7 +402,7 @@ gtk_gl_area_ensure_buffers (GtkGLArea *area)
/* Delete old render buffer if any */
if (priv->render_buffer != 0)
{
glDeleteRenderbuffers (1, &priv->render_buffer);
glDeleteRenderbuffersEXT(1, &priv->render_buffer);
priv->render_buffer = 0;
}
}
@@ -410,7 +410,7 @@ gtk_gl_area_ensure_buffers (GtkGLArea *area)
{
/* For non-alpha we use render buffers so we can blit instead of texture the result */
if (priv->render_buffer == 0)
glGenRenderbuffers (1, &priv->render_buffer);
glGenRenderbuffersEXT (1, &priv->render_buffer);
/* Delete old texture if any */
if (priv->texture != 0)
@@ -423,12 +423,12 @@ gtk_gl_area_ensure_buffers (GtkGLArea *area)
if ((priv->has_depth_buffer || priv->has_stencil_buffer))
{
if (priv->depth_stencil_buffer == 0)
glGenRenderbuffers (1, &priv->depth_stencil_buffer);
glGenRenderbuffersEXT (1, &priv->depth_stencil_buffer);
}
else if (priv->depth_stencil_buffer != 0)
{
/* Delete old depth/stencil buffer */
glDeleteRenderbuffers (1, &priv->depth_stencil_buffer);
glDeleteRenderbuffersEXT (1, &priv->depth_stencil_buffer);
priv->depth_stencil_buffer = 0;
}
@@ -515,23 +515,23 @@ gtk_gl_area_attach_buffers (GtkGLArea *area)
else if (priv->needs_resize)
gtk_gl_area_allocate_buffers (area);
glBindFramebuffer (GL_FRAMEBUFFER, priv->frame_buffer);
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, priv->frame_buffer);
if (priv->texture)
glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
glFramebufferTexture2D (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_TEXTURE_2D, priv->texture, 0);
else if (priv->render_buffer)
glFramebufferRenderbuffer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_RENDERBUFFER, priv->render_buffer);
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_RENDERBUFFER_EXT, priv->render_buffer);
if (priv->depth_stencil_buffer)
{
if (priv->has_depth_buffer)
glFramebufferRenderbuffer (GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
GL_RENDERBUFFER, priv->depth_stencil_buffer);
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, priv->depth_stencil_buffer);
if (priv->has_stencil_buffer)
glFramebufferRenderbuffer (GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
GL_RENDERBUFFER, priv->depth_stencil_buffer);
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, priv->depth_stencil_buffer);
}
}
@@ -547,7 +547,7 @@ gtk_gl_area_delete_buffers (GtkGLArea *area)
if (priv->render_buffer != 0)
{
glDeleteRenderbuffers (1, &priv->render_buffer);
glDeleteRenderbuffersEXT (1, &priv->render_buffer);
priv->render_buffer = 0;
}
@@ -559,14 +559,14 @@ gtk_gl_area_delete_buffers (GtkGLArea *area)
if (priv->depth_stencil_buffer != 0)
{
glDeleteRenderbuffers (1, &priv->depth_stencil_buffer);
glDeleteRenderbuffersEXT (1, &priv->depth_stencil_buffer);
priv->depth_stencil_buffer = 0;
}
if (priv->frame_buffer != 0)
{
glBindFramebuffer (GL_FRAMEBUFFER, 0);
glDeleteFramebuffers (1, &priv->frame_buffer);
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0);
glDeleteFramebuffersEXT (1, &priv->frame_buffer);
priv->frame_buffer = 0;
}
}
@@ -707,8 +707,8 @@ gtk_gl_area_draw (GtkWidget *widget,
w = gtk_widget_get_allocated_width (widget) * scale;
h = gtk_widget_get_allocated_height (widget) * scale;
status = glCheckFramebufferStatus (GL_FRAMEBUFFER);
if (status == GL_FRAMEBUFFER_COMPLETE)
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
if (status == GL_FRAMEBUFFER_COMPLETE_EXT)
{
if (priv->needs_render || priv->auto_render)
{
+113 -246
View File
@@ -65,7 +65,6 @@ struct _GtkIMContextSimplePrivate
int tentative_match_len;
guint in_hex_sequence : 1;
guint in_compose_sequence : 1;
guint modifiers_dropped : 1;
};
@@ -85,9 +84,6 @@ G_LOCK_DEFINE_STATIC (global_tables);
static GSList *global_tables;
static const guint16 gtk_compose_ignore[] = {
0, /* Yes, XKB will send us key press events with NoSymbol :( */
GDK_KEY_Overlay1_Enable,
GDK_KEY_Overlay2_Enable,
GDK_KEY_Shift_L,
GDK_KEY_Shift_R,
GDK_KEY_Control_L,
@@ -103,10 +99,7 @@ static const guint16 gtk_compose_ignore[] = {
GDK_KEY_Hyper_L,
GDK_KEY_Hyper_R,
GDK_KEY_Mode_switch,
GDK_KEY_ISO_Level3_Shift,
GDK_KEY_ISO_Level3_Latch,
GDK_KEY_ISO_Level5_Shift,
GDK_KEY_ISO_Level5_Latch
GDK_KEY_ISO_Level3_Shift
};
static void gtk_im_context_simple_finalize (GObject *obj);
@@ -168,7 +161,7 @@ gtk_im_context_simple_init_compose_table (void)
const char * const *sys_lang = NULL;
char *x11_compose_file_dir = get_x11_compose_file_dir ();
path = g_build_filename (g_get_user_config_dir (), "gtk-3.0", "Compose", NULL);
path = g_build_filename (g_get_user_config_dir (), "gtk-4.0", "Compose", NULL);
if (g_file_test (path, G_FILE_TEST_EXISTS))
{
G_LOCK (global_tables);
@@ -309,21 +302,13 @@ gtk_im_context_simple_commit_string (GtkIMContextSimple *context_simple,
const char *str)
{
GtkIMContextSimplePrivate *priv = context_simple->priv;
priv->in_hex_sequence = FALSE;
g_string_set_size (priv->tentative_match, 0);
priv->tentative_match_len = 0;
priv->compose_buffer[0] = 0;
if (priv->in_hex_sequence ||
priv->tentative_match_len > 0 ||
priv->compose_buffer[0] != 0)
{
g_string_set_size (priv->tentative_match, 0);
priv->tentative_match_len = 0;
priv->in_compose_sequence = FALSE;
priv->in_hex_sequence = FALSE;
priv->compose_buffer[0] = 0;
g_signal_emit_by_name (context_simple, "preedit-changed");
g_signal_emit_by_name (context_simple, "preedit-end");
}
g_signal_emit_by_name (context_simple, "preedit-changed");
g_signal_emit_by_name (context_simple, "preedit-end");
g_signal_emit_by_name (context_simple, "commit", str);
}
@@ -428,79 +413,6 @@ beep_window (GdkWindow *window)
gdk_window_beep (window);
}
static inline gboolean
is_dead_key (guint keysym)
{
return GDK_KEY_dead_grave <= keysym && keysym <= GDK_KEY_dead_greek;
}
static gunichar
dead_key_to_unicode (guint keysym,
gboolean *need_space)
{
/* Sadly, not all the dead keysyms have spacing mark equivalents
* in Unicode. For those that don't, we use space + the non-spacing
* mark as an approximation
*/
switch (keysym)
{
#define CASE(keysym, unicode, sp) \
case GDK_KEY_dead_##keysym: *need_space = sp; return unicode;
CASE (grave, 0x60, 0);
CASE (acute, 0xb4, 0);
CASE (circumflex, 0x5e, 0);
CASE (tilde, 0x7e, 0);
CASE (macron, 0xaf, 0);
CASE (breve, 0x2d8, 0);
CASE (abovedot, 0x307, 1);
CASE (diaeresis, 0xa8, 0);
CASE (abovering, 0x2da, 0);
CASE (hook, 0x2c0, 0);
CASE (doubleacute, 0x2dd, 0);
CASE (caron, 0x2c7, 0);
CASE (cedilla, 0xb8, 0);
CASE (ogonek, 0x2db, 0);
CASE (iota, 0x37a, 0);
CASE (voiced_sound, 0x3099, 1);
CASE (semivoiced_sound, 0x309a, 1);
CASE (belowdot, 0x323, 1);
CASE (horn, 0x31b, 1);
CASE (stroke, 0x335, 1);
CASE (abovecomma, 0x2bc, 0);
CASE (abovereversedcomma, 0x2bd, 1);
CASE (doublegrave, 0x30f, 1);
CASE (belowring, 0x2f3, 0);
CASE (belowmacron, 0x2cd, 0);
CASE (belowcircumflex, 0x32d, 1);
CASE (belowtilde, 0x330, 1);
CASE (belowbreve, 0x32e, 1);
CASE (belowdiaeresis, 0x324, 1);
CASE (invertedbreve, 0x32f, 1);
CASE (belowcomma, 0x326, 1);
CASE (lowline, 0x5f, 0);
CASE (aboveverticalline, 0x2c8, 0);
CASE (belowverticalline, 0x2cc, 0);
CASE (longsolidusoverlay, 0x338, 1);
CASE (a, 0x363, 1);
CASE (A, 0x363, 1);
CASE (e, 0x364, 1);
CASE (E, 0x364, 1);
CASE (i, 0x365, 1);
CASE (I, 0x365, 1);
CASE (o, 0x366, 1);
CASE (O, 0x366, 1);
CASE (u, 0x367, 1);
CASE (U, 0x367, 1);
CASE (small_schwa, 0x1dea, 1);
CASE (capital_schwa, 0x1dea, 1);
#undef CASE
default:
*need_space = FALSE;
return gdk_keyval_to_unicode (keysym);
}
}
static gboolean
no_sequence_matches (GtkIMContextSimple *context_simple,
int n_compose,
@@ -511,9 +423,7 @@ no_sequence_matches (GtkIMContextSimple *context_simple,
gunichar ch;
context = GTK_IM_CONTEXT (context_simple);
priv->in_compose_sequence = FALSE;
/* No compose sequences found, check first if we have a partial
* match pending.
*/
@@ -545,67 +455,6 @@ no_sequence_matches (GtkIMContextSimple *context_simple,
}
else
{
int i;
for (i = 0; i < n_compose && is_dead_key (priv->compose_buffer[i]); i++)
;
if (n_compose > 1 && i >= n_compose - 1)
{
gboolean need_space;
GString *s;
s = g_string_new ("");
if (i == n_compose - 1)
{
int j;
/* dead keys are never *really* dead */
for (j = 0; j < i; j++)
{
ch = dead_key_to_unicode (priv->compose_buffer[j], &need_space);
if (ch)
{
if (need_space)
g_string_append_c (s, ' ');
g_string_append_unichar (s, ch);
}
}
ch = gdk_keyval_to_unicode (priv->compose_buffer[i]);
if (ch != 0 && ch != ' ' && !g_unichar_iscntrl (ch))
g_string_append_unichar (s, ch);
gtk_im_context_simple_commit_string (context_simple, s->str);
}
else
{
ch = dead_key_to_unicode (priv->compose_buffer[0], &need_space);
if (ch)
{
if (need_space)
g_string_append_c (s, ' ');
g_string_append_unichar (s, ch);
}
gtk_im_context_simple_commit_string (context_simple, s->str);
for (i = 1; i < n_compose; i++)
priv->compose_buffer[i - 1] = priv->compose_buffer[i];
priv->compose_buffer[n_compose - 1] = 0;
priv->in_compose_sequence = TRUE;
g_signal_emit_by_name (context, "preedit-start");
g_signal_emit_by_name (context, "preedit-changed");
}
g_string_free (s, TRUE);
return TRUE;
}
priv->compose_buffer[0] = 0;
if (n_compose > 1) /* Invalid sequence */
{
@@ -739,21 +588,13 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
}
}
if (priv->in_hex_sequence || priv->in_compose_sequence)
return TRUE; /* Don't leak random key events during preedit */
return FALSE;
}
/* Ignore modifier key presses */
for (i = 0; i < G_N_ELEMENTS (gtk_compose_ignore); i++)
if (event->keyval == gtk_compose_ignore[i])
{
if (priv->in_hex_sequence || priv->in_compose_sequence)
return TRUE; /* Don't leak random key events during preedit */
return FALSE;
}
return FALSE;
hex_mod_mask = gdk_keymap_get_modifier_mask (gdk_keymap_get_for_display (display),
GDK_MODIFIER_INTENT_PRIMARY_ACCELERATOR);
@@ -792,23 +633,16 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
gdk_keymap_get_modifier_mask (gdk_keymap_get_for_display (display),
GDK_MODIFIER_INTENT_NO_TEXT_INPUT);
if (priv->in_hex_sequence && priv->modifiers_dropped &&
(event->keyval == GDK_KEY_Return ||
event->keyval == GDK_KEY_ISO_Enter ||
event->keyval == GDK_KEY_KP_Enter))
if (event->state & no_text_input_mask ||
(priv->in_hex_sequence && priv->modifiers_dropped &&
(event->keyval == GDK_KEY_Return ||
event->keyval == GDK_KEY_ISO_Enter ||
event->keyval == GDK_KEY_KP_Enter)))
{
return FALSE;
}
if (event->state & no_text_input_mask)
{
if (priv->in_hex_sequence || priv->in_compose_sequence)
return TRUE; /* Don't leak random key events during preedit */
return FALSE;
}
}
/* Handle backspace */
if (priv->in_hex_sequence && have_hex_mods && is_backspace)
{
@@ -827,7 +661,7 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
if (!priv->in_hex_sequence)
g_signal_emit_by_name (context_simple, "preedit-end");
return TRUE;
}
@@ -879,6 +713,7 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
return TRUE;
}
/* Then, check for compose sequences */
if (priv->in_hex_sequence)
{
if (hex_keyval && n_compose < 6)
@@ -921,8 +756,6 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
char *str = g_strdup (priv->tentative_match->str);
gtk_im_context_simple_commit_string (context_simple, str);
g_free (str);
return TRUE;
}
else
{
@@ -945,7 +778,7 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
return TRUE;
}
}
else /* Then, check for compose sequences */
else
{
gboolean success = FALSE;
GString *output;
@@ -962,12 +795,6 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
&compose_finish, &compose_match,
output))
{
if (!priv->in_compose_sequence)
{
priv->in_compose_sequence = TRUE;
g_signal_emit_by_name (context_simple, "preedit-start");
}
if (compose_finish)
{
if (compose_match)
@@ -1002,12 +829,6 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
&compose_finish, &compose_match,
&output_char))
{
if (!priv->in_compose_sequence)
{
priv->in_compose_sequence = TRUE;
g_signal_emit_by_name (context_simple, "preedit-start");
}
if (compose_finish)
{
if (compose_match)
@@ -1029,17 +850,8 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
if (gtk_check_algorithmically (priv->compose_buffer, n_compose, &output_char))
{
if (!priv->in_compose_sequence)
{
priv->in_compose_sequence = TRUE;
g_signal_emit_by_name (context_simple, "preedit-start");
}
if (output_char)
gtk_im_context_simple_commit_char (context_simple, output_char);
else
g_signal_emit_by_name (context_simple, "preedit-changed");
return TRUE;
}
}
@@ -1056,12 +868,9 @@ gtk_im_context_simple_reset (GtkIMContext *context)
priv->compose_buffer[0] = 0;
if (priv->tentative_match->len > 0 ||
priv->in_hex_sequence ||
priv->in_compose_sequence)
if (priv->tentative_match->len > 0 || priv->in_hex_sequence)
{
priv->in_hex_sequence = FALSE;
priv->in_compose_sequence = FALSE;
g_string_set_size (priv->tentative_match, 0);
priv->tentative_match_len = 0;
g_signal_emit_by_name (context_simple, "preedit-changed");
@@ -1089,55 +898,113 @@ gtk_im_context_simple_get_preedit_string (GtkIMContext *context,
for (i = 0; priv->compose_buffer[i]; i++)
g_string_append_unichar (s, gdk_keyval_to_unicode (priv->compose_buffer[i]));
}
else if (priv->in_compose_sequence)
else if (priv->tentative_match->len > 0 && priv->compose_buffer[0] != 0)
{
if (priv->tentative_match_len > 0 && priv->compose_buffer[0] != 0)
g_string_append (s, priv->tentative_match->str);
}
else
{
for (i = 0; priv->compose_buffer[i]; i++)
{
g_string_append (s, priv->tentative_match->str);
}
else
{
for (i = 0; priv->compose_buffer[i]; i++)
if (priv->compose_buffer[i] == GDK_KEY_Multi_key)
{
if (priv->compose_buffer[i] == GDK_KEY_Multi_key)
/* We only show the Compose key visibly when it is the
* only glyph in the preedit, or when it occurs in the
* middle of the sequence. Sadly, the official character,
* U+2384, COMPOSITION SYMBOL, is bit too distracting, so
* we use U+00B7, MIDDLE DOT.
*/
if (priv->compose_buffer[1] == 0 || i > 0)
g_string_append (s, "·");
}
else
{
gunichar ch;
gboolean need_space;
if (GDK_KEY_dead_grave <= priv->compose_buffer[i] && priv->compose_buffer[i] <= GDK_KEY_dead_greek)
{
/* We only show the Compose key visibly when it is the
* only glyph in the preedit, or when it occurs in the
* middle of the sequence. Sadly, the official character,
* U+2384, COMPOSITION SYMBOL, is bit too distracting, so
* we use U+00B7, MIDDLE DOT.
/* Sadly, not all the dead keysyms have spacing mark equivalents
* in Unicode. For those that don't, we use space + the non-spacing
* mark as an approximation
*/
if (priv->compose_buffer[1] == 0 || i > 0)
g_string_append (s, "·");
switch (priv->compose_buffer[i])
{
#define CASE(keysym, unicode, sp) \
case GDK_KEY_dead_##keysym: ch = unicode; need_space = sp; break
CASE (grave, 0x60, 0);
CASE (acute, 0xb4, 0);
CASE (circumflex, 0x5e, 0);
CASE (tilde, 0x7e, 0);
CASE (macron, 0xaf, 0);
CASE (breve, 0x2d8, 0);
CASE (abovedot, 0x307, 1);
CASE (diaeresis, 0xa8, 0);
CASE (abovering, 0x2da, 0);
CASE (hook, 0x2c0, 0);
CASE (doubleacute, 0x2dd, 0);
CASE (caron, 0x2c7, 0);
CASE (cedilla, 0xb8, 0);
CASE (ogonek, 0x2db, 0);
CASE (iota, 0x37a, 0);
CASE (voiced_sound, 0x3099, 1);
CASE (semivoiced_sound, 0x309a, 1);
CASE (belowdot, 0x323, 1);
CASE (horn, 0x31b, 1);
CASE (stroke, 0x335, 1);
CASE (abovecomma, 0x2bc, 0);
CASE (abovereversedcomma, 0x2bd, 1);
CASE (doublegrave, 0x30f, 1);
CASE (belowring, 0x2f3, 0);
CASE (belowmacron, 0x2cd, 0);
CASE (belowcircumflex, 0x32d, 1);
CASE (belowtilde, 0x330, 1);
CASE (belowbreve, 0x32e, 1);
CASE (belowdiaeresis, 0x324, 1);
CASE (invertedbreve, 0x32f, 1);
CASE (belowcomma, 0x326, 1);
CASE (lowline, 0x5f, 0);
CASE (aboveverticalline, 0x2c8, 0);
CASE (belowverticalline, 0x2cc, 0);
CASE (longsolidusoverlay, 0x338, 1);
CASE (a, 0x363, 1);
CASE (A, 0x363, 1);
CASE (e, 0x364, 1);
CASE (E, 0x364, 1);
CASE (i, 0x365, 1);
CASE (I, 0x365, 1);
CASE (o, 0x366, 1);
CASE (O, 0x366, 1);
CASE (u, 0x367, 1);
CASE (U, 0x367, 1);
CASE (small_schwa, 0x1dea, 1);
CASE (capital_schwa, 0x1dea, 1);
#undef CASE
default:
need_space = FALSE;
ch = gdk_keyval_to_unicode (priv->compose_buffer[i]);
break;
}
if (ch)
{
if (need_space)
g_string_append_c (s, ' ');
g_string_append_unichar (s, ch);
}
}
else
{
gunichar ch;
gboolean need_space;
if (is_dead_key (priv->compose_buffer[i]))
{
ch = dead_key_to_unicode (priv->compose_buffer[i], &need_space);
if (ch)
{
if (need_space)
g_string_append_c (s, ' ');
g_string_append_unichar (s, ch);
}
}
else
{
ch = gdk_keyval_to_unicode (priv->compose_buffer[i]);
if (ch)
g_string_append_unichar (s, ch);
}
ch = gdk_keyval_to_unicode (priv->compose_buffer[i]);
if (ch)
g_string_append_unichar (s, ch);
}
}
}
}
if (cursor_pos)
*cursor_pos = g_utf8_strlen (s->str, s->len);
*cursor_pos = s->len;
if (attrs)
{
+10 -118
View File
@@ -94,7 +94,7 @@ GDK_KEY_dead_belowdiaeresis, 3705, 3705, 3708, 3708, 3708,
GDK_KEY_dead_belowcomma, 3708, 3722, 3722, 3722, 3722,
GDK_KEY_dead_currency, 3722, 3820, 3826, 3826, 3826,
GDK_KEY_dead_greek, 3826, 3928, 3952, 3952, 3952,
GDK_KEY_Multi_key, 3952, 3952, 10663, 14371, 16246,
GDK_KEY_Multi_key, 3952, 3952, 10348, 14044, 15919,
GDK_KEY_Greek_iota, 0x0390,
GDK_KEY_Greek_upsilon, 0x03B0,
GDK_KEY_space, 0x0060,
@@ -1361,7 +1361,6 @@ GDK_KEY_exclam, GDK_KEY_L, 0x1E36,
GDK_KEY_exclam, GDK_KEY_M, 0x1E42,
GDK_KEY_exclam, GDK_KEY_N, 0x1E46,
GDK_KEY_exclam, GDK_KEY_O, 0x1ECC,
GDK_KEY_exclam, GDK_KEY_P, 0x00B6,
GDK_KEY_exclam, GDK_KEY_R, 0x1E5A,
GDK_KEY_exclam, GDK_KEY_S, 0x1E62,
GDK_KEY_exclam, GDK_KEY_T, 0x1E6C,
@@ -1382,7 +1381,6 @@ GDK_KEY_exclam, GDK_KEY_l, 0x1E37,
GDK_KEY_exclam, GDK_KEY_m, 0x1E43,
GDK_KEY_exclam, GDK_KEY_n, 0x1E47,
GDK_KEY_exclam, GDK_KEY_o, 0x1ECD,
GDK_KEY_exclam, GDK_KEY_p, 0x00B6,
GDK_KEY_exclam, GDK_KEY_r, 0x1E5B,
GDK_KEY_exclam, GDK_KEY_s, 0x1E63,
GDK_KEY_exclam, GDK_KEY_t, 0x1E6D,
@@ -1578,12 +1576,6 @@ GDK_KEY_apostrophe, 0x2395, 0x235E,
GDK_KEY_parenleft, GDK_KEY_space, 0x02D8,
GDK_KEY_parenleft, GDK_KEY_parenleft, 0x005B,
GDK_KEY_parenleft, GDK_KEY_minus, 0x007B,
GDK_KEY_parenleft, GDK_KEY_A, 0x0102,
GDK_KEY_parenleft, GDK_KEY_G, 0x011E,
GDK_KEY_parenleft, GDK_KEY_a, 0x0103,
GDK_KEY_parenleft, GDK_KEY_c, 0x00A9,
GDK_KEY_parenleft, GDK_KEY_g, 0x011F,
GDK_KEY_parenleft, GDK_KEY_r, 0x00AE,
GDK_KEY_parenleft, GDK_KEY_Greek_ALPHA, 0x1F09,
GDK_KEY_parenleft, GDK_KEY_Greek_EPSILON, 0x1F19,
GDK_KEY_parenleft, GDK_KEY_Greek_ETA, 0x1F29,
@@ -1672,13 +1664,12 @@ GDK_KEY_minus, GDK_KEY_comma, 0x00AC,
GDK_KEY_minus, GDK_KEY_slash, 0x233F,
GDK_KEY_minus, GDK_KEY_colon, 0x00F7,
GDK_KEY_minus, GDK_KEY_greater, 0x2192,
GDK_KEY_minus, GDK_KEY_A, 0x00C3,
GDK_KEY_minus, GDK_KEY_A, 0x0100,
GDK_KEY_minus, GDK_KEY_D, 0x0110,
GDK_KEY_minus, GDK_KEY_E, 0x0112,
GDK_KEY_minus, GDK_KEY_I, 0x012A,
GDK_KEY_minus, GDK_KEY_L, 0x00A3,
GDK_KEY_minus, GDK_KEY_N, 0x00D1,
GDK_KEY_minus, GDK_KEY_O, 0x00D5,
GDK_KEY_minus, GDK_KEY_O, 0x014C,
GDK_KEY_minus, GDK_KEY_U, 0x016A,
GDK_KEY_minus, GDK_KEY_Y, 0x00A5,
GDK_KEY_minus, GDK_KEY_backslash, 0x2340,
@@ -1688,7 +1679,6 @@ GDK_KEY_minus, GDK_KEY_d, 0x0111,
GDK_KEY_minus, GDK_KEY_e, 0x0113,
GDK_KEY_minus, GDK_KEY_i, 0x012B,
GDK_KEY_minus, GDK_KEY_l, 0x00A3,
GDK_KEY_minus, GDK_KEY_n, 0x00F1,
GDK_KEY_minus, GDK_KEY_o, 0x014D,
GDK_KEY_minus, GDK_KEY_u, 0x016B,
GDK_KEY_minus, GDK_KEY_y, 0x00A5,
@@ -1762,7 +1752,6 @@ GDK_KEY_slash, GDK_KEY_I, 0x0197,
GDK_KEY_slash, GDK_KEY_L, 0x0141,
GDK_KEY_slash, GDK_KEY_O, 0x00D8,
GDK_KEY_slash, GDK_KEY_T, 0x0166,
GDK_KEY_slash, GDK_KEY_U, 0x00B5,
GDK_KEY_slash, GDK_KEY_Z, 0x01B5,
GDK_KEY_slash, GDK_KEY_asciicircum, 0x007C,
GDK_KEY_slash, GDK_KEY_b, 0x0180,
@@ -1791,13 +1780,6 @@ GDK_KEY_slash, 0x2194, 0x21AE,
GDK_KEY_slash, 0x2395, 0x2341,
GDK_KEY_0, GDK_KEY_asterisk, 0x00B0,
GDK_KEY_0, GDK_KEY_3, 0x2189,
GDK_KEY_0, GDK_KEY_C, 0x00A9,
GDK_KEY_0, GDK_KEY_S, 0x00A7,
GDK_KEY_0, GDK_KEY_X, 0x00A4,
GDK_KEY_0, GDK_KEY_asciicircum, 0x00B0,
GDK_KEY_0, GDK_KEY_c, 0x00A9,
GDK_KEY_0, GDK_KEY_s, 0x00A7,
GDK_KEY_0, GDK_KEY_x, 0x00A4,
GDK_KEY_0, GDK_KEY_asciitilde, 0x236C,
GDK_KEY_1, GDK_KEY_2, 0x00BD,
GDK_KEY_1, GDK_KEY_3, 0x2153,
@@ -1807,20 +1789,14 @@ GDK_KEY_1, GDK_KEY_6, 0x2159,
GDK_KEY_1, GDK_KEY_7, 0x2150,
GDK_KEY_1, GDK_KEY_8, 0x215B,
GDK_KEY_1, GDK_KEY_9, 0x2151,
GDK_KEY_1, GDK_KEY_S, 0x00B9,
GDK_KEY_1, GDK_KEY_asciicircum, 0x00B9,
GDK_KEY_1, GDK_KEY_s, 0x00B9,
GDK_KEY_2, GDK_KEY_3, 0x2154,
GDK_KEY_2, GDK_KEY_5, 0x2156,
GDK_KEY_2, GDK_KEY_S, 0x00B2,
GDK_KEY_2, GDK_KEY_asciicircum, 0x00B2,
GDK_KEY_2, GDK_KEY_s, 0x00B2,
GDK_KEY_3, GDK_KEY_4, 0x00BE,
GDK_KEY_3, GDK_KEY_5, 0x2157,
GDK_KEY_3, GDK_KEY_8, 0x215C,
GDK_KEY_3, GDK_KEY_S, 0x00B3,
GDK_KEY_3, GDK_KEY_asciicircum, 0x00B3,
GDK_KEY_3, GDK_KEY_s, 0x00B3,
GDK_KEY_4, GDK_KEY_5, 0x2158,
GDK_KEY_5, GDK_KEY_6, 0x215A,
GDK_KEY_5, GDK_KEY_8, 0x215D,
@@ -1883,8 +1859,6 @@ GDK_KEY_equal, GDK_KEY_E, 0x20AC,
GDK_KEY_equal, GDK_KEY_L, 0x20A4,
GDK_KEY_equal, GDK_KEY_N, 0x20A6,
GDK_KEY_equal, GDK_KEY_O, 0x0150,
GDK_KEY_equal, GDK_KEY_P, 0x20BD,
GDK_KEY_equal, GDK_KEY_R, 0x20B9,
GDK_KEY_equal, GDK_KEY_U, 0x0170,
GDK_KEY_equal, GDK_KEY_W, 0x20A9,
GDK_KEY_equal, GDK_KEY_Y, 0x00A5,
@@ -1892,19 +1866,14 @@ GDK_KEY_equal, GDK_KEY_underscore, 0x2261,
GDK_KEY_equal, GDK_KEY_c, 0x20AC,
GDK_KEY_equal, GDK_KEY_d, 0x20AB,
GDK_KEY_equal, GDK_KEY_e, 0x20AC,
GDK_KEY_equal, GDK_KEY_l, 0x00A3,
GDK_KEY_equal, GDK_KEY_o, 0x0151,
GDK_KEY_equal, GDK_KEY_p, 0x20BD,
GDK_KEY_equal, GDK_KEY_r, 0x20B9,
GDK_KEY_equal, GDK_KEY_u, 0x0171,
GDK_KEY_equal, GDK_KEY_y, 0x00A5,
GDK_KEY_equal, 0x0338, 0x2260,
GDK_KEY_equal, GDK_KEY_Cyrillic_u, 0x04F3,
GDK_KEY_equal, GDK_KEY_Cyrillic_ze, 0x20BD,
GDK_KEY_equal, GDK_KEY_Cyrillic_IE, 0x20AC,
GDK_KEY_equal, GDK_KEY_Cyrillic_ES, 0x20AC,
GDK_KEY_equal, GDK_KEY_Cyrillic_U, 0x04F2,
GDK_KEY_equal, GDK_KEY_Cyrillic_ZE, 0x20BD,
GDK_KEY_equal, 0x2395, 0x2338,
GDK_KEY_greater, GDK_KEY_space, 0x005E,
GDK_KEY_greater, GDK_KEY_quotedbl, 0x201D,
@@ -1954,14 +1923,14 @@ GDK_KEY_A, GDK_KEY_apostrophe, 0x00C1,
GDK_KEY_A, GDK_KEY_parenleft, 0x0102,
GDK_KEY_A, GDK_KEY_asterisk, 0x00C5,
GDK_KEY_A, GDK_KEY_comma, 0x0104,
GDK_KEY_A, GDK_KEY_minus, 0x00C3,
GDK_KEY_A, GDK_KEY_minus, 0x0100,
GDK_KEY_A, GDK_KEY_semicolon, 0x0104,
GDK_KEY_A, GDK_KEY_greater, 0x00C2,
GDK_KEY_A, GDK_KEY_A, 0x00C5,
GDK_KEY_A, GDK_KEY_E, 0x00C6,
GDK_KEY_A, GDK_KEY_T, 0x0040,
GDK_KEY_A, GDK_KEY_asciicircum, 0x00C2,
GDK_KEY_A, GDK_KEY_underscore, 0x00AA,
GDK_KEY_A, GDK_KEY_underscore, 0x0100,
GDK_KEY_A, GDK_KEY_grave, 0x00C0,
GDK_KEY_A, GDK_KEY_asciitilde, 0x00C3,
GDK_KEY_A, GDK_KEY_diaeresis, 0x00C4,
@@ -1971,7 +1940,6 @@ GDK_KEY_C, GDK_KEY_apostrophe, 0x0106,
GDK_KEY_C, GDK_KEY_comma, 0x00C7,
GDK_KEY_C, GDK_KEY_period, 0x010A,
GDK_KEY_C, GDK_KEY_slash, 0x20A1,
GDK_KEY_C, GDK_KEY_0, 0x00A9,
GDK_KEY_C, GDK_KEY_less, 0x010C,
GDK_KEY_C, GDK_KEY_equal, 0x20AC,
GDK_KEY_C, GDK_KEY_E, 0x20A0,
@@ -2005,9 +1973,7 @@ GDK_KEY_F, GDK_KEY_r, 0x20A3,
GDK_KEY_G, GDK_KEY_parenleft, 0x011E,
GDK_KEY_G, GDK_KEY_comma, 0x0122,
GDK_KEY_G, GDK_KEY_period, 0x0120,
GDK_KEY_G, GDK_KEY_T, 0x003E,
GDK_KEY_G, GDK_KEY_U, 0x011E,
GDK_KEY_G, GDK_KEY_u, 0x011E,
GDK_KEY_G, GDK_KEY_breve, 0x011E,
GDK_KEY_H, GDK_KEY_comma, 0x1E28,
GDK_KEY_I, GDK_KEY_quotedbl, 0x00CF,
@@ -2031,13 +1997,11 @@ GDK_KEY_L, GDK_KEY_comma, 0x013B,
GDK_KEY_L, GDK_KEY_minus, 0x00A3,
GDK_KEY_L, GDK_KEY_slash, 0x0141,
GDK_KEY_L, GDK_KEY_less, 0x013D,
GDK_KEY_L, GDK_KEY_equal, 0x00A3,
GDK_KEY_L, GDK_KEY_T, 0x003C,
GDK_KEY_L, GDK_KEY_equal, 0x20A4,
GDK_KEY_L, GDK_KEY_V, 0x007C,
GDK_KEY_M, GDK_KEY_period, 0x1E40,
GDK_KEY_N, GDK_KEY_apostrophe, 0x0143,
GDK_KEY_N, GDK_KEY_comma, 0x0145,
GDK_KEY_N, GDK_KEY_minus, 0x00D1,
GDK_KEY_N, GDK_KEY_less, 0x0147,
GDK_KEY_N, GDK_KEY_equal, 0x20A6,
GDK_KEY_N, GDK_KEY_G, 0x014A,
@@ -2047,7 +2011,7 @@ GDK_KEY_N, GDK_KEY_asciitilde, 0x00D1,
GDK_KEY_O, GDK_KEY_quotedbl, 0x00D6,
GDK_KEY_O, GDK_KEY_apostrophe, 0x00D3,
GDK_KEY_O, GDK_KEY_comma, 0x01EA,
GDK_KEY_O, GDK_KEY_minus, 0x00D5,
GDK_KEY_O, GDK_KEY_minus, 0x014C,
GDK_KEY_O, GDK_KEY_slash, 0x00D8,
GDK_KEY_O, GDK_KEY_semicolon, 0x01EA,
GDK_KEY_O, GDK_KEY_greater, 0x00D4,
@@ -2058,7 +2022,7 @@ GDK_KEY_O, GDK_KEY_R, 0x00AE,
GDK_KEY_O, GDK_KEY_S, 0x00A7,
GDK_KEY_O, GDK_KEY_X, 0x00A4,
GDK_KEY_O, GDK_KEY_asciicircum, 0x00D4,
GDK_KEY_O, GDK_KEY_underscore, 0x00BA,
GDK_KEY_O, GDK_KEY_underscore, 0x014C,
GDK_KEY_O, GDK_KEY_grave, 0x00D2,
GDK_KEY_O, GDK_KEY_c, 0x00A9,
GDK_KEY_O, GDK_KEY_r, 0x00AE,
@@ -2068,31 +2032,23 @@ GDK_KEY_O, GDK_KEY_diaeresis, 0x00D6,
GDK_KEY_O, GDK_KEY_acute, 0x00D3,
GDK_KEY_P, GDK_KEY_exclam, 0x00B6,
GDK_KEY_P, GDK_KEY_period, 0x1E56,
GDK_KEY_P, GDK_KEY_equal, 0x20BD,
GDK_KEY_P, GDK_KEY_P, 0x00B6,
GDK_KEY_P, GDK_KEY_t, 0x20A7,
GDK_KEY_R, GDK_KEY_apostrophe, 0x0154,
GDK_KEY_R, GDK_KEY_comma, 0x0156,
GDK_KEY_R, GDK_KEY_less, 0x0158,
GDK_KEY_R, GDK_KEY_equal, 0x20B9,
GDK_KEY_R, GDK_KEY_O, 0x00AE,
GDK_KEY_R, GDK_KEY_o, 0x00AE,
GDK_KEY_R, GDK_KEY_s, 0x20A8,
GDK_KEY_S, GDK_KEY_exclam, 0x00A7,
GDK_KEY_S, GDK_KEY_apostrophe, 0x015A,
GDK_KEY_S, GDK_KEY_comma, 0x015E,
GDK_KEY_S, GDK_KEY_period, 0x1E60,
GDK_KEY_S, GDK_KEY_0, 0x00A7,
GDK_KEY_S, GDK_KEY_1, 0x00B9,
GDK_KEY_S, GDK_KEY_2, 0x00B2,
GDK_KEY_S, GDK_KEY_3, 0x00B3,
GDK_KEY_S, GDK_KEY_semicolon, 0x0218,
GDK_KEY_S, GDK_KEY_less, 0x0160,
GDK_KEY_S, GDK_KEY_M, 0x2120,
GDK_KEY_S, GDK_KEY_O, 0x00A7,
GDK_KEY_S, GDK_KEY_S, 0x1E9E,
GDK_KEY_S, GDK_KEY_m, 0x2120,
GDK_KEY_S, GDK_KEY_cedilla, 0x015E,
GDK_KEY_T, GDK_KEY_comma, 0x0162,
GDK_KEY_T, GDK_KEY_minus, 0x0166,
GDK_KEY_T, GDK_KEY_period, 0x1E6A,
@@ -2107,7 +2063,6 @@ GDK_KEY_U, GDK_KEY_apostrophe, 0x00DA,
GDK_KEY_U, GDK_KEY_asterisk, 0x016E,
GDK_KEY_U, GDK_KEY_comma, 0x0172,
GDK_KEY_U, GDK_KEY_minus, 0x016A,
GDK_KEY_U, GDK_KEY_slash, 0x00B5,
GDK_KEY_U, GDK_KEY_semicolon, 0x0172,
GDK_KEY_U, GDK_KEY_greater, 0x00DB,
GDK_KEY_U, GDK_KEY_A, 0x0102,
@@ -2151,7 +2106,6 @@ GDK_KEY_U, 0x1EA1, 0x1EB7,
GDK_KEY_V, GDK_KEY_L, 0x007C,
GDK_KEY_W, GDK_KEY_equal, 0x20A9,
GDK_KEY_W, GDK_KEY_asciicircum, 0x0174,
GDK_KEY_X, GDK_KEY_0, 0x00A4,
GDK_KEY_X, GDK_KEY_O, 0x00A4,
GDK_KEY_X, GDK_KEY_o, 0x00A4,
GDK_KEY_Y, GDK_KEY_quotedbl, 0x0178,
@@ -2200,7 +2154,6 @@ GDK_KEY_asciicircum, GDK_KEY_U, 0x00DB,
GDK_KEY_asciicircum, GDK_KEY_W, 0x0174,
GDK_KEY_asciicircum, GDK_KEY_Y, 0x0176,
GDK_KEY_asciicircum, GDK_KEY_Z, 0x1E90,
GDK_KEY_asciicircum, GDK_KEY_underscore, 0x00AF,
GDK_KEY_asciicircum, GDK_KEY_a, 0x00E2,
GDK_KEY_asciicircum, GDK_KEY_c, 0x0109,
GDK_KEY_asciicircum, GDK_KEY_e, 0x00EA,
@@ -2214,7 +2167,6 @@ GDK_KEY_asciicircum, GDK_KEY_u, 0x00FB,
GDK_KEY_asciicircum, GDK_KEY_w, 0x0175,
GDK_KEY_asciicircum, GDK_KEY_y, 0x0177,
GDK_KEY_asciicircum, GDK_KEY_z, 0x1E91,
GDK_KEY_asciicircum, GDK_KEY_bar, 0x2191,
GDK_KEY_asciicircum, 0x1EA0, 0x1EAC,
GDK_KEY_asciicircum, 0x1EA1, 0x1EAD,
GDK_KEY_asciicircum, 0x1EB8, 0x1EC6,
@@ -2425,7 +2377,7 @@ GDK_KEY_a, GDK_KEY_minus, 0x0101,
GDK_KEY_a, GDK_KEY_semicolon, 0x0105,
GDK_KEY_a, GDK_KEY_greater, 0x00E2,
GDK_KEY_a, GDK_KEY_asciicircum, 0x00E2,
GDK_KEY_a, GDK_KEY_underscore, 0x00AA,
GDK_KEY_a, GDK_KEY_underscore, 0x0101,
GDK_KEY_a, GDK_KEY_grave, 0x00E0,
GDK_KEY_a, GDK_KEY_a, 0x00E5,
GDK_KEY_a, GDK_KEY_e, 0x00E6,
@@ -2469,7 +2421,6 @@ GDK_KEY_c, GDK_KEY_apostrophe, 0x0107,
GDK_KEY_c, GDK_KEY_comma, 0x00E7,
GDK_KEY_c, GDK_KEY_period, 0x010B,
GDK_KEY_c, GDK_KEY_slash, 0x00A2,
GDK_KEY_c, GDK_KEY_0, 0x00A9,
GDK_KEY_c, GDK_KEY_less, 0x010D,
GDK_KEY_c, GDK_KEY_equal, 0x20AC,
GDK_KEY_c, GDK_KEY_A, 0x01CD,
@@ -2540,8 +2491,6 @@ GDK_KEY_g, GDK_KEY_parenleft, 0x011F,
GDK_KEY_g, GDK_KEY_comma, 0x0123,
GDK_KEY_g, GDK_KEY_period, 0x0121,
GDK_KEY_g, GDK_KEY_U, 0x011F,
GDK_KEY_g, GDK_KEY_t, 0x003E,
GDK_KEY_g, GDK_KEY_u, 0x011F,
GDK_KEY_g, GDK_KEY_breve, 0x011F,
GDK_KEY_h, GDK_KEY_comma, 0x1E29,
GDK_KEY_i, GDK_KEY_quotedbl, 0x00EF,
@@ -2565,15 +2514,12 @@ GDK_KEY_l, GDK_KEY_comma, 0x013C,
GDK_KEY_l, GDK_KEY_minus, 0x00A3,
GDK_KEY_l, GDK_KEY_slash, 0x0142,
GDK_KEY_l, GDK_KEY_less, 0x013E,
GDK_KEY_l, GDK_KEY_equal, 0x00A3,
GDK_KEY_l, GDK_KEY_t, 0x003C,
GDK_KEY_l, GDK_KEY_v, 0x007C,
GDK_KEY_m, GDK_KEY_period, 0x1E41,
GDK_KEY_m, GDK_KEY_slash, 0x20A5,
GDK_KEY_m, GDK_KEY_u, 0x00B5,
GDK_KEY_n, GDK_KEY_apostrophe, 0x0144,
GDK_KEY_n, GDK_KEY_comma, 0x0146,
GDK_KEY_n, GDK_KEY_minus, 0x00F1,
GDK_KEY_n, GDK_KEY_less, 0x0148,
GDK_KEY_n, GDK_KEY_g, 0x014B,
GDK_KEY_n, GDK_KEY_asciitilde, 0x00F1,
@@ -2590,7 +2536,7 @@ GDK_KEY_o, GDK_KEY_R, 0x00AE,
GDK_KEY_o, GDK_KEY_U, 0x016E,
GDK_KEY_o, GDK_KEY_X, 0x00A4,
GDK_KEY_o, GDK_KEY_asciicircum, 0x00F4,
GDK_KEY_o, GDK_KEY_underscore, 0x00BA,
GDK_KEY_o, GDK_KEY_underscore, 0x014D,
GDK_KEY_o, GDK_KEY_grave, 0x00F2,
GDK_KEY_o, GDK_KEY_a, 0x00E5,
GDK_KEY_o, GDK_KEY_c, 0x00A9,
@@ -2607,19 +2553,13 @@ GDK_KEY_o, GDK_KEY_diaeresis, 0x00F6,
GDK_KEY_o, GDK_KEY_acute, 0x00F3,
GDK_KEY_p, GDK_KEY_exclam, 0x00B6,
GDK_KEY_p, GDK_KEY_period, 0x1E57,
GDK_KEY_p, GDK_KEY_equal, 0x20BD,
GDK_KEY_r, GDK_KEY_apostrophe, 0x0155,
GDK_KEY_r, GDK_KEY_comma, 0x0157,
GDK_KEY_r, GDK_KEY_less, 0x0159,
GDK_KEY_r, GDK_KEY_equal, 0x20B9,
GDK_KEY_s, GDK_KEY_exclam, 0x00A7,
GDK_KEY_s, GDK_KEY_apostrophe, 0x015B,
GDK_KEY_s, GDK_KEY_comma, 0x015F,
GDK_KEY_s, GDK_KEY_period, 0x1E61,
GDK_KEY_s, GDK_KEY_0, 0x00A7,
GDK_KEY_s, GDK_KEY_1, 0x00B9,
GDK_KEY_s, GDK_KEY_2, 0x00B2,
GDK_KEY_s, GDK_KEY_3, 0x00B3,
GDK_KEY_s, GDK_KEY_semicolon, 0x0219,
GDK_KEY_s, GDK_KEY_less, 0x0161,
GDK_KEY_s, GDK_KEY_M, 0x2120,
@@ -2645,59 +2585,20 @@ GDK_KEY_u, GDK_KEY_slash, 0x00B5,
GDK_KEY_u, GDK_KEY_semicolon, 0x0173,
GDK_KEY_u, GDK_KEY_greater, 0x00FB,
GDK_KEY_u, GDK_KEY_A, 0x0102,
GDK_KEY_u, GDK_KEY_E, 0x0114,
GDK_KEY_u, GDK_KEY_G, 0x011E,
GDK_KEY_u, GDK_KEY_I, 0x012C,
GDK_KEY_u, GDK_KEY_O, 0x014E,
GDK_KEY_u, GDK_KEY_U, 0x016C,
GDK_KEY_u, GDK_KEY_asciicircum, 0x00FB,
GDK_KEY_u, GDK_KEY_underscore, 0x016B,
GDK_KEY_u, GDK_KEY_grave, 0x00F9,
GDK_KEY_u, GDK_KEY_a, 0x0103,
GDK_KEY_u, GDK_KEY_e, 0x0115,
GDK_KEY_u, GDK_KEY_g, 0x011F,
GDK_KEY_u, GDK_KEY_i, 0x012D,
GDK_KEY_u, GDK_KEY_o, 0x014F,
GDK_KEY_u, GDK_KEY_u, 0x016D,
GDK_KEY_u, GDK_KEY_asciitilde, 0x0169,
GDK_KEY_u, GDK_KEY_diaeresis, 0x00FC,
GDK_KEY_u, GDK_KEY_acute, 0x00FA,
GDK_KEY_v, GDK_KEY_slash, 0x221A,
GDK_KEY_v, GDK_KEY_A, 0x01CD,
GDK_KEY_v, GDK_KEY_C, 0x010C,
GDK_KEY_v, GDK_KEY_D, 0x010E,
GDK_KEY_v, GDK_KEY_E, 0x011A,
GDK_KEY_v, GDK_KEY_G, 0x01E6,
GDK_KEY_v, GDK_KEY_H, 0x021E,
GDK_KEY_v, GDK_KEY_I, 0x01CF,
GDK_KEY_v, GDK_KEY_K, 0x01E8,
GDK_KEY_v, GDK_KEY_N, 0x0147,
GDK_KEY_v, GDK_KEY_O, 0x01D1,
GDK_KEY_v, GDK_KEY_R, 0x0158,
GDK_KEY_v, GDK_KEY_S, 0x0160,
GDK_KEY_v, GDK_KEY_T, 0x0164,
GDK_KEY_v, GDK_KEY_U, 0x01D3,
GDK_KEY_v, GDK_KEY_Z, 0x017D,
GDK_KEY_v, GDK_KEY_a, 0x01CE,
GDK_KEY_v, GDK_KEY_c, 0x010D,
GDK_KEY_v, GDK_KEY_d, 0x010F,
GDK_KEY_v, GDK_KEY_e, 0x011B,
GDK_KEY_v, GDK_KEY_g, 0x01E7,
GDK_KEY_v, GDK_KEY_h, 0x021F,
GDK_KEY_v, GDK_KEY_i, 0x01D0,
GDK_KEY_v, GDK_KEY_j, 0x01F0,
GDK_KEY_v, GDK_KEY_k, 0x01E9,
GDK_KEY_v, GDK_KEY_l, 0x007C,
GDK_KEY_v, GDK_KEY_n, 0x0148,
GDK_KEY_v, GDK_KEY_o, 0x01D2,
GDK_KEY_v, GDK_KEY_r, 0x0159,
GDK_KEY_v, GDK_KEY_s, 0x0161,
GDK_KEY_v, GDK_KEY_t, 0x0165,
GDK_KEY_v, GDK_KEY_u, 0x01D4,
GDK_KEY_v, GDK_KEY_z, 0x017E,
GDK_KEY_v, GDK_KEY_bar, 0x2193,
GDK_KEY_w, GDK_KEY_asciicircum, 0x0175,
GDK_KEY_x, GDK_KEY_0, 0x00A4,
GDK_KEY_x, GDK_KEY_O, 0x00A4,
GDK_KEY_x, GDK_KEY_o, 0x00A4,
GDK_KEY_x, GDK_KEY_x, 0x00D7,
@@ -2713,9 +2614,7 @@ GDK_KEY_z, GDK_KEY_period, 0x017C,
GDK_KEY_z, GDK_KEY_less, 0x017E,
GDK_KEY_braceleft, GDK_KEY_braceright, 0x2205,
GDK_KEY_bar, GDK_KEY_C, 0x00A2,
GDK_KEY_bar, GDK_KEY_asciicircum, 0x2191,
GDK_KEY_bar, GDK_KEY_c, 0x00A2,
GDK_KEY_bar, GDK_KEY_v, 0x2193,
GDK_KEY_bar, GDK_KEY_asciitilde, 0x236D,
GDK_KEY_bar, 0x2190, 0x2345,
GDK_KEY_bar, 0x2192, 0x2346,
@@ -2743,7 +2642,6 @@ GDK_KEY_asciitilde, GDK_KEY_u, 0x0169,
GDK_KEY_asciitilde, GDK_KEY_v, 0x1E7D,
GDK_KEY_asciitilde, GDK_KEY_y, 0x1EF9,
GDK_KEY_asciitilde, GDK_KEY_bar, 0x236D,
GDK_KEY_asciitilde, GDK_KEY_asciitilde, 0x2248,
GDK_KEY_asciitilde, GDK_KEY_diaeresis, 0x2368,
GDK_KEY_asciitilde, GDK_KEY_Acircumflex, 0x1EAA,
GDK_KEY_asciitilde, GDK_KEY_Ecircumflex, 0x1EC4,
@@ -3029,12 +2927,10 @@ GDK_KEY_breve, GDK_KEY_g, 0x011F,
0x0654, 0x06D5, 0x06C0,
0x0655, GDK_KEY_Arabic_alef, 0x0625,
GDK_KEY_Cyrillic_pe, GDK_KEY_Cyrillic_a, 0x00A7,
GDK_KEY_Cyrillic_ze, GDK_KEY_equal, 0x20BD,
GDK_KEY_Cyrillic_IE, GDK_KEY_equal, 0x20AC,
GDK_KEY_Cyrillic_EN, GDK_KEY_Cyrillic_o, 0x2116,
GDK_KEY_Cyrillic_EN, GDK_KEY_Cyrillic_O, 0x2116,
GDK_KEY_Cyrillic_ES, GDK_KEY_equal, 0x20AC,
GDK_KEY_Cyrillic_ZE, GDK_KEY_equal, 0x20BD,
GDK_KEY_Greek_ALPHA, GDK_KEY_apostrophe, 0x0386,
GDK_KEY_Greek_EPSILON, GDK_KEY_apostrophe, 0x0388,
GDK_KEY_Greek_ETA, GDK_KEY_apostrophe, 0x0389,
@@ -3048,7 +2944,6 @@ GDK_KEY_Greek_alpha, GDK_KEY_apostrophe, 0x03AC,
GDK_KEY_Greek_epsilon, GDK_KEY_apostrophe, 0x03AD,
GDK_KEY_Greek_eta, GDK_KEY_apostrophe, 0x03AE,
GDK_KEY_Greek_iota, GDK_KEY_quotedbl, 0x03CA,
GDK_KEY_Greek_iota, GDK_KEY_apostrophe, 0x03AF,
GDK_KEY_Greek_iota, GDK_KEY_Greek_alphaaccent, 0x1FB4,
GDK_KEY_Greek_iota, GDK_KEY_Greek_etaaccent, 0x1FC4,
GDK_KEY_Greek_iota, GDK_KEY_Greek_omegaaccent, 0x1FF4,
@@ -3582,9 +3477,6 @@ GDK_KEY_exclam, GDK_KEY_dead_horn, GDK_KEY_O, 0x1EE2,
GDK_KEY_exclam, GDK_KEY_dead_horn, GDK_KEY_U, 0x1EF0,
GDK_KEY_exclam, GDK_KEY_dead_horn, GDK_KEY_o, 0x1EE3,
GDK_KEY_exclam, GDK_KEY_dead_horn, GDK_KEY_u, 0x1EF1,
GDK_KEY_quotedbl, GDK_KEY_apostrophe, GDK_KEY_space, 0x0385,
GDK_KEY_quotedbl, GDK_KEY_apostrophe, GDK_KEY_Greek_iota, 0x0390,
GDK_KEY_quotedbl, GDK_KEY_apostrophe, GDK_KEY_Greek_upsilon, 0x03B0,
GDK_KEY_quotedbl, GDK_KEY_underscore, GDK_KEY_U, 0x1E7A,
GDK_KEY_quotedbl, GDK_KEY_underscore, GDK_KEY_u, 0x1E7B,
GDK_KEY_quotedbl, GDK_KEY_asciitilde, GDK_KEY_O, 0x1E4E,
-29
View File
@@ -124,35 +124,6 @@ gtk_kinetic_scrolling_new (gdouble lower,
return data;
}
GtkKineticScrollingChange
gtk_kinetic_scrolling_update_size (GtkKineticScrolling *data,
gdouble lower,
gdouble upper)
{
GtkKineticScrollingChange change = GTK_KINETIC_SCROLLING_CHANGE_NONE;
if (lower != data->lower)
{
if (data->position <= lower)
change |= GTK_KINETIC_SCROLLING_CHANGE_LOWER;
data->lower = lower;
}
if (upper != data->upper)
{
if (data->position >= data->upper)
change |= GTK_KINETIC_SCROLLING_CHANGE_UPPER;
data->upper = upper;
}
if (data->phase == GTK_KINETIC_SCROLLING_PHASE_OVERSHOOTING)
change |= GTK_KINETIC_SCROLLING_CHANGE_IN_OVERSHOOT;
return change;
}
void
gtk_kinetic_scrolling_free (GtkKineticScrolling *kinetic)
{
-11
View File
@@ -23,13 +23,6 @@
G_BEGIN_DECLS
typedef enum {
GTK_KINETIC_SCROLLING_CHANGE_NONE = 0,
GTK_KINETIC_SCROLLING_CHANGE_LOWER = 1 << 0,
GTK_KINETIC_SCROLLING_CHANGE_UPPER = 1 << 1,
GTK_KINETIC_SCROLLING_CHANGE_IN_OVERSHOOT = 1 << 2,
} GtkKineticScrollingChange;
typedef struct _GtkKineticScrolling GtkKineticScrolling;
GtkKineticScrolling * gtk_kinetic_scrolling_new (gdouble lower,
@@ -41,10 +34,6 @@ GtkKineticScrolling * gtk_kinetic_scrolling_new (gdouble lower
gdouble initial_velocity);
void gtk_kinetic_scrolling_free (GtkKineticScrolling *kinetic);
GtkKineticScrollingChange gtk_kinetic_scrolling_update_size (GtkKineticScrolling *data,
gdouble lower,
gdouble upper);
gboolean gtk_kinetic_scrolling_tick (GtkKineticScrolling *data,
gdouble time_delta,
gdouble *position,
-11
View File
@@ -4228,12 +4228,6 @@ gtk_label_style_updated (GtkWidget *widget)
context = gtk_widget_get_style_context (widget);
change = gtk_style_context_get_change (context);
if (change == NULL || gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_FONT))
{
gtk_label_clear_layout (GTK_LABEL (widget));
gtk_widget_queue_resize (label);
}
if (change == NULL || gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_TEXT_ATTRS) ||
(priv->select_info && priv->select_info->links))
gtk_label_update_layout_attributes (label);
@@ -6761,11 +6755,6 @@ emit_activate_link (GtkLabel *label,
GtkStateFlags state;
g_signal_emit (label, signals[ACTIVATE_LINK], 0, link->uri, &handled);
/* signal handler might have invalidated the layout */
if (!priv->layout)
return;
if (handled && priv->track_links && !link->visited &&
priv->select_info && priv->select_info->links)
{
+2 -5
View File
@@ -43,7 +43,7 @@
* @See_also: #GtkScrolledWindow
*
* A GtkListBox is a vertical container that contains GtkListBoxRow
* children. These rows can be dynamically sorted and filtered, and
* children. These rows can by dynamically sorted and filtered, and
* headers can be added dynamically depending on the row content.
* It also allows keyboard and mouse navigation and selection like
* a typical list.
@@ -1765,10 +1765,7 @@ gtk_list_box_update_selection_full (GtkListBox *box,
g_signal_emit (box, signals[ROW_SELECTED], 0, row);
}
else
{
priv->selected_row = selected_row;
gtk_list_box_select_all_between (box, selected_row, row, FALSE);
}
gtk_list_box_select_all_between (box, selected_row, row, FALSE);
}
else
{
-5
View File
@@ -777,11 +777,6 @@ gtk_overlay_class_init (GtkOverlayClass *klass)
* Whether to pass input through the overlay child to the main child.
* (Of course, this has no effect when set on the main child itself.)
*
* Note that this is implemented by calling gdk_window_set_pass_through()
* on the window that the overlay child is placed in. If the descendents
* of the overlay child have their own windows, you need to manually call
* that function on them to achieve the desired effect.
*
* Since: 3.18
*/
gtk_container_class_install_child_property (container_class, CHILD_PROP_PASS_THROUGH,
-9
View File
@@ -1267,11 +1267,6 @@ server_mount_ready_cb (GObject *source_file,
GMount *mount;
GFile *root;
/*
* If the mount is not found at this point, it is probably user-
* invisible, which happens e.g for smb-browse, but the location
* should be opened anyway...
*/
mount = g_file_find_enclosing_mount (location, priv->cancellable, NULL);
if (mount)
{
@@ -1282,10 +1277,6 @@ server_mount_ready_cb (GObject *source_file,
g_object_unref (root);
g_object_unref (mount);
}
else
{
emit_open_location (view, location, priv->open_flags);
}
}
}
-2
View File
@@ -111,8 +111,6 @@ gboolean gtk_simulate_touchscreen (void);
guint gtk_get_display_debug_flags (GdkDisplay *display);
GBytes *get_emoji_data (void);
#ifdef G_ENABLE_DEBUG
#define GTK_DISPLAY_DEBUG_CHECK(display,type) G_UNLIKELY (gtk_get_display_debug_flags (display) & GTK_DEBUG_##type)
+7 -10
View File
@@ -2020,26 +2020,23 @@ gtk_scale_get_layout (GtkScale *scale)
if (!priv->layout && priv->draw_value)
{
PangoLayout *layout;
int min_layout_width;
layout = gtk_widget_create_pango_layout (GTK_WIDGET (scale), NULL);
gtk_css_node_update_layout_attributes (gtk_css_gadget_get_node (priv->value_gadget), layout);
priv->layout = gtk_widget_create_pango_layout (GTK_WIDGET (scale), NULL);
gtk_css_node_update_layout_attributes (gtk_css_gadget_get_node (priv->value_gadget), priv->layout);
gtk_css_gadget_get_preferred_size (priv->value_gadget,
GTK_ORIENTATION_HORIZONTAL, -1,
&min_layout_width, NULL,
NULL, NULL);
pango_layout_set_width (layout, min_layout_width * PANGO_SCALE);
pango_layout_set_width (priv->layout, min_layout_width * PANGO_SCALE);
if (priv->value_pos == GTK_POS_LEFT)
pango_layout_set_alignment (layout, PANGO_ALIGN_RIGHT);
pango_layout_set_alignment (priv->layout, PANGO_ALIGN_RIGHT);
else if (priv->value_pos == GTK_POS_RIGHT)
pango_layout_set_alignment (layout, PANGO_ALIGN_LEFT);
pango_layout_set_alignment (priv->layout, PANGO_ALIGN_LEFT);
else
pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER);
priv->layout = layout;
pango_layout_set_alignment (priv->layout, PANGO_ALIGN_CENTER);
}
if (priv->draw_value)
+39 -66
View File
@@ -1005,7 +1005,9 @@ scrolled_window_drag_update_cb (GtkScrolledWindow *scrolled_window,
GtkScrolledWindowPrivate *priv = scrolled_window->priv;
GtkAdjustment *hadjustment;
GtkAdjustment *vadjustment;
gdouble dx, dy;
GtkScrollable *child;
GtkBorder border;
double dx, dy, scale, size;
gtk_scrolled_window_invalidate_overshoot (scrolled_window);
@@ -1018,10 +1020,25 @@ scrolled_window_drag_update_cb (GtkScrolledWindow *scrolled_window,
GTK_EVENT_SEQUENCE_CLAIMED);
}
child = GTK_SCROLLABLE (gtk_bin_get_child (GTK_BIN (scrolled_window)));
hadjustment = gtk_range_get_adjustment (GTK_RANGE (priv->hscrollbar));
if (hadjustment && may_hscroll (scrolled_window))
{
dx = priv->drag_start_x - offset_x;
if (child && gtk_widget_get_visible (child))
{
size = gtk_widget_get_allocated_width (GTK_WIDGET (child));
if (gtk_scrollable_get_border (child, &border))
size -= border.left + border.right;
scale = gtk_adjustment_get_page_size (hadjustment) / size;
}
else
{
scale = 1.0;
}
dx = priv->drag_start_x - offset_x * scale;
_gtk_scrolled_window_set_adjustment_value (scrolled_window,
hadjustment, dx);
}
@@ -1029,7 +1046,20 @@ scrolled_window_drag_update_cb (GtkScrolledWindow *scrolled_window,
vadjustment = gtk_range_get_adjustment (GTK_RANGE (priv->vscrollbar));
if (vadjustment && may_vscroll (scrolled_window))
{
dy = priv->drag_start_y - offset_y;
if (child && gtk_widget_get_visible (child))
{
size = gtk_widget_get_allocated_height (GTK_WIDGET (child));
if (gtk_scrollable_get_border (child, &border))
size -= border.top + border.bottom;
scale = gtk_adjustment_get_page_size (vadjustment) / size;
}
else
{
scale = 1.0;
}
dy = priv->drag_start_y - offset_y * scale;
_gtk_scrolled_window_set_adjustment_value (scrolled_window,
vadjustment, dy);
}
@@ -1900,19 +1930,10 @@ gtk_scrolled_window_measure (GtkCssGadget *gadget,
*/
if (policy_may_be_visible (priv->hscrollbar_policy))
{
int vscrollbar_extra_size;
minimum_req.width = MAX (minimum_req.width, hscrollbar_requisition.width + sborder.left + sborder.right);
natural_req.width = MAX (natural_req.width, hscrollbar_requisition.width + sborder.left + sborder.right);
if (!priv->use_indicators && policy_may_be_visible (priv->vscrollbar_policy))
vscrollbar_extra_size = vscrollbar_requisition.width;
else
vscrollbar_extra_size = 0;
minimum_req.width = MAX (minimum_req.width,
hscrollbar_requisition.width + sborder.left + sborder.right + vscrollbar_extra_size);
natural_req.width = MAX (natural_req.width,
hscrollbar_requisition.width + sborder.left + sborder.right + vscrollbar_extra_size);
if (!priv->use_indicators)
if (!priv->use_indicators && priv->hscrollbar_policy == GTK_POLICY_ALWAYS)
{
minimum_req.height += scrollbar_spacing + hscrollbar_requisition.height;
natural_req.height += scrollbar_spacing + hscrollbar_requisition.height;
@@ -1921,19 +1942,10 @@ gtk_scrolled_window_measure (GtkCssGadget *gadget,
if (policy_may_be_visible (priv->vscrollbar_policy))
{
int hscrollbar_extra_size;
minimum_req.height = MAX (minimum_req.height, vscrollbar_requisition.height + sborder.top + sborder.bottom);
natural_req.height = MAX (natural_req.height, vscrollbar_requisition.height + sborder.top + sborder.bottom);
if (!priv->use_indicators && policy_may_be_visible (priv->hscrollbar_policy))
hscrollbar_extra_size = hscrollbar_requisition.height;
else
hscrollbar_extra_size = 0;
minimum_req.height = MAX (minimum_req.height,
vscrollbar_requisition.height + sborder.top + sborder.bottom + hscrollbar_extra_size);
natural_req.height = MAX (natural_req.height,
vscrollbar_requisition.height + sborder.top + sborder.bottom + hscrollbar_extra_size);
if (!priv->use_indicators)
if (!priv->use_indicators && priv->vscrollbar_policy == GTK_POLICY_ALWAYS)
{
minimum_req.width += scrollbar_spacing + vscrollbar_requisition.width;
natural_req.width += scrollbar_spacing + vscrollbar_requisition.width;
@@ -3918,24 +3930,6 @@ gtk_scrolled_window_adjustment_changed (GtkAdjustment *adjustment,
if (priv->hscrollbar_visible != visible)
gtk_widget_queue_resize (GTK_WIDGET (scrolled_window));
if (priv->hscrolling)
{
GtkKineticScrollingChange change;
gdouble lower = gtk_adjustment_get_lower (adjustment);
gdouble upper = gtk_adjustment_get_upper (adjustment);
upper -= gtk_adjustment_get_page_size (adjustment);
change = gtk_kinetic_scrolling_update_size (priv->hscrolling, lower, upper);
if ((change & GTK_KINETIC_SCROLLING_CHANGE_IN_OVERSHOOT) &&
(change & (GTK_KINETIC_SCROLLING_CHANGE_UPPER | GTK_KINETIC_SCROLLING_CHANGE_LOWER)))
{
g_clear_pointer (&priv->hscrolling, gtk_kinetic_scrolling_free);
priv->unclamped_hadj_value = gtk_adjustment_get_value (adjustment);
gtk_scrolled_window_invalidate_overshoot (scrolled_window);
}
}
}
}
else if (adjustment == gtk_range_get_adjustment (GTK_RANGE (priv->vscrollbar)))
@@ -3950,29 +3944,8 @@ gtk_scrolled_window_adjustment_changed (GtkAdjustment *adjustment,
if (priv->vscrollbar_visible != visible)
gtk_widget_queue_resize (GTK_WIDGET (scrolled_window));
if (priv->vscrolling)
{
GtkKineticScrollingChange change;
gdouble lower = gtk_adjustment_get_lower (adjustment);
gdouble upper = gtk_adjustment_get_upper (adjustment);
upper -= gtk_adjustment_get_page_size (adjustment);
change = gtk_kinetic_scrolling_update_size (priv->vscrolling, lower, upper);
if ((change & GTK_KINETIC_SCROLLING_CHANGE_IN_OVERSHOOT) &&
(change & (GTK_KINETIC_SCROLLING_CHANGE_UPPER | GTK_KINETIC_SCROLLING_CHANGE_LOWER)))
{
g_clear_pointer (&priv->vscrolling, gtk_kinetic_scrolling_free);
priv->unclamped_vadj_value = gtk_adjustment_get_value (adjustment);
gtk_scrolled_window_invalidate_overshoot (scrolled_window);
}
}
}
}
if (!priv->hscrolling && !priv->vscrolling)
gtk_scrolled_window_cancel_deceleration (scrolled_window);
}
static void
+4 -33
View File
@@ -1883,41 +1883,12 @@ gtk_spin_button_default_input (GtkSpinButton *spin_button,
gdouble *new_val)
{
gchar *err = NULL;
const char *text;
text = gtk_entry_get_text (GTK_ENTRY (spin_button));
*new_val = g_strtod (text, &err);
*new_val = g_strtod (gtk_entry_get_text (GTK_ENTRY (spin_button)), &err);
if (*err)
{
/* try to convert with local digits */
gint64 val = 0;
int sign = 1;
const char *p;
for (p = text; *p; p = g_utf8_next_char (p))
{
gunichar ch = g_utf8_get_char (p);
if (p == text && ch == '-')
{
sign = -1;
continue;
}
if (!g_unichar_isdigit (ch))
break;
val = val * 10 + g_unichar_digit_value (ch);
}
if (*p)
return GTK_INPUT_ERROR;
*new_val = sign * val;
}
return FALSE;
return GTK_INPUT_ERROR;
else
return FALSE;
}
static void
-18
View File
@@ -1027,24 +1027,6 @@ libgtk_dep = declare_dependency(sources: gtk_dep_sources,
link_with: libgtk,
link_args: common_ldflags)
foreach lang : [ 'de', 'fr', 'es', 'zh' ]
conf = configuration_data()
conf.set('lang', lang)
resxml = configure_file(input: 'emoji/gresource.xml.in',
output: lang + '.gresource.xml',
configuration: conf
)
gnome.compile_resources(lang,
resxml,
source_dir: 'emoji',
gresource_bundle: true,
install: true,
install_dir: join_paths(gtk_datadir, 'gtk-3.0', 'emoji'),
)
endforeach
if quartz_enabled
install_data(['gtk-keys.css.mac'],
install_dir: join_paths(get_option('datadir'), 'themes/Mac/gtk-3.0'),
+4 -6
View File
@@ -2324,7 +2324,7 @@ popover.background {
}
.csd & {
$_popover_border: if($variant=='light', transparentize(black, 0.77), transparentize(black, 0.25));
$_popover_border: if($variant=='light', transparentize(black, 0.77), transparentize($borders_color, 0.1));
background-clip: padding-box;
border-color: $_popover_border;
@@ -4556,8 +4556,8 @@ decoration {
// this needs to be transparent
// see bug #722563
$_wm_border: if($variant=='light', transparentize(black, 0.77), transparentize(black, 0.25));
$_wm_border_backdrop: if($variant=='light', transparentize(black, 0.82), transparentize(black, 0.25));
$_wm_border: if($variant=='light', transparentize(black, 0.77), transparentize($borders_color, 0.1));
$_wm_border_backdrop: if($variant=='light', transparentize(black, 0.82), transparentize($borders_color, 0.1));
box-shadow: 0 3px 9px 1px transparentize(black, 0.5),
0 0 0 1px $_wm_border; //doing borders with box-shadow
@@ -4598,9 +4598,7 @@ decoration {
.popup & { box-shadow: none; }
// server-side decorations as used by mutter
// just doing borders, wm draws actual shadows
.ssd & { box-shadow: 0 0 0 1px $_wm_border; }
.ssd &:backdrop { box-shadow: 0 0 0 1px $_wm_border_backdrop; }
.ssd & { box-shadow: 0 0 0 1px $_wm_border; } //just doing borders, wm draws actual shadows
.csd.popup & {
border-radius: $menu_radius;
+8 -10
View File
@@ -822,7 +822,7 @@ popover.background { padding: 2px; background-color: #353535; box-shadow: 0 1px
.csd popover.background, popover.background { border: 1px solid #1b1b1b; border-radius: 9px; }
.csd popover.background { background-clip: padding-box; border-color: rgba(0, 0, 0, 0.75); }
.csd popover.background { background-clip: padding-box; border-color: rgba(27, 27, 27, 0.9); }
popover.background:backdrop { background-color: #353535; box-shadow: none; }
@@ -1834,27 +1834,25 @@ colorchooser .popover.osd { border-radius: 5px; }
.scale-popup button:hover { background-color: rgba(238, 238, 236, 0.1); border-radius: 5px; }
/********************** Window Decorations * */
decoration { border-radius: 8px 8px 0 0; border-width: 0px; box-shadow: 0 3px 9px 1px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.75); margin: 10px; }
decoration { border-radius: 8px 8px 0 0; border-width: 0px; box-shadow: 0 3px 9px 1px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(27, 27, 27, 0.9); margin: 10px; }
decoration:backdrop { box-shadow: 0 3px 9px 1px transparent, 0 2px 6px 2px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.75); transition: 200ms ease-out; }
decoration:backdrop { box-shadow: 0 3px 9px 1px transparent, 0 2px 6px 2px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(27, 27, 27, 0.9); transition: 200ms ease-out; }
.maximized decoration, .fullscreen decoration { border-radius: 0; box-shadow: none; }
.tiled decoration, .tiled-top decoration, .tiled-right decoration, .tiled-bottom decoration, .tiled-left decoration { border-radius: 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.75), 0 0 0 20px transparent; }
.tiled decoration, .tiled-top decoration, .tiled-right decoration, .tiled-bottom decoration, .tiled-left decoration { border-radius: 0; box-shadow: 0 0 0 1px rgba(27, 27, 27, 0.9), 0 0 0 20px transparent; }
.tiled decoration:backdrop, .tiled-top decoration:backdrop, .tiled-right decoration:backdrop, .tiled-bottom decoration:backdrop, .tiled-left decoration:backdrop { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.75), 0 0 0 20px transparent; }
.tiled decoration:backdrop, .tiled-top decoration:backdrop, .tiled-right decoration:backdrop, .tiled-bottom decoration:backdrop, .tiled-left decoration:backdrop { box-shadow: 0 0 0 1px rgba(27, 27, 27, 0.9), 0 0 0 20px transparent; }
.popup decoration { box-shadow: none; }
.ssd decoration { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.75); }
.ssd decoration { box-shadow: 0 0 0 1px rgba(27, 27, 27, 0.9); }
.ssd decoration:backdrop { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.75); }
.csd.popup decoration { border-radius: 5px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.65); }
.csd.popup decoration { border-radius: 5px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(27, 27, 27, 0.8); }
tooltip.csd decoration { border-radius: 5px; box-shadow: none; }
messagedialog.csd decoration { border-radius: 8px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.65); }
messagedialog.csd decoration { border-radius: 8px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(27, 27, 27, 0.8); }
.solid-csd decoration { margin: 0; padding: 4px; background-color: #1b1b1b; border: solid 1px #1b1b1b; border-radius: 0; box-shadow: inset 0 0 0 3px #2d2d2d, inset 0 1px rgba(238, 238, 236, 0.07); }
-2
View File
@@ -1864,8 +1864,6 @@ decoration:backdrop { box-shadow: 0 3px 9px 1px transparent, 0 2px 6px 2px rgba(
.ssd decoration { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.23); }
.ssd decoration:backdrop { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18); }
.csd.popup decoration { border-radius: 5px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.13); }
tooltip.csd decoration { border-radius: 5px; box-shadow: none; }
@@ -902,7 +902,7 @@ popover.background { padding: 2px; background-color: #353535; box-shadow: 0 1px
.csd popover.background, popover.background { border: 1px solid #686868; border-radius: 9px; }
.csd popover.background { background-clip: padding-box; border-color: rgba(0, 0, 0, 0.75); }
.csd popover.background { background-clip: padding-box; border-color: rgba(104, 104, 104, 0.9); }
popover.background:backdrop { background-color: #353535; box-shadow: none; }
@@ -1914,27 +1914,25 @@ colorchooser .popover.osd { border-radius: 5px; }
.scale-popup button:hover { background-color: rgba(243, 243, 241, 0.1); border-radius: 5px; }
/********************** Window Decorations * */
decoration { border-radius: 8px 8px 0 0; border-width: 0px; box-shadow: 0 3px 9px 1px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.75); margin: 10px; }
decoration { border-radius: 8px 8px 0 0; border-width: 0px; box-shadow: 0 3px 9px 1px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(104, 104, 104, 0.9); margin: 10px; }
decoration:backdrop { box-shadow: 0 3px 9px 1px transparent, 0 2px 6px 2px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.75); transition: 200ms ease-out; }
decoration:backdrop { box-shadow: 0 3px 9px 1px transparent, 0 2px 6px 2px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(104, 104, 104, 0.9); transition: 200ms ease-out; }
.maximized decoration, .fullscreen decoration { border-radius: 0; box-shadow: none; }
.tiled decoration, .tiled-top decoration, .tiled-right decoration, .tiled-bottom decoration, .tiled-left decoration { border-radius: 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.75), 0 0 0 20px transparent; }
.tiled decoration, .tiled-top decoration, .tiled-right decoration, .tiled-bottom decoration, .tiled-left decoration { border-radius: 0; box-shadow: 0 0 0 1px rgba(104, 104, 104, 0.9), 0 0 0 20px transparent; }
.tiled decoration:backdrop, .tiled-top decoration:backdrop, .tiled-right decoration:backdrop, .tiled-bottom decoration:backdrop, .tiled-left decoration:backdrop { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.75), 0 0 0 20px transparent; }
.tiled decoration:backdrop, .tiled-top decoration:backdrop, .tiled-right decoration:backdrop, .tiled-bottom decoration:backdrop, .tiled-left decoration:backdrop { box-shadow: 0 0 0 1px rgba(104, 104, 104, 0.9), 0 0 0 20px transparent; }
.popup decoration { box-shadow: none; }
.ssd decoration { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.75); }
.ssd decoration { box-shadow: 0 0 0 1px rgba(104, 104, 104, 0.9); }
.ssd decoration:backdrop { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.75); }
.csd.popup decoration { border-radius: 5px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.65); }
.csd.popup decoration { border-radius: 5px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(104, 104, 104, 0.8); }
tooltip.csd decoration { border-radius: 5px; box-shadow: none; }
messagedialog.csd decoration { border-radius: 8px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.65); }
messagedialog.csd decoration { border-radius: 8px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(104, 104, 104, 0.8); }
.solid-csd decoration { margin: 0; padding: 4px; background-color: #686868; border: solid 1px #686868; border-radius: 0; box-shadow: inset 0 0 0 3px #2d2d2d, inset 0 1px rgba(238, 238, 236, 0.07); }
-2
View File
@@ -1944,8 +1944,6 @@ decoration:backdrop { box-shadow: 0 3px 9px 1px transparent, 0 2px 6px 2px rgba(
.ssd decoration { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.23); }
.ssd decoration:backdrop { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18); }
.csd.popup decoration { border-radius: 5px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.13); }
tooltip.csd decoration { border-radius: 5px; box-shadow: none; }

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