Compare commits
23 Commits
stack
...
touch-sele
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2992461c2a | ||
|
|
7f36b9665a | ||
|
|
314fdec2b2 | ||
|
|
39d1638997 | ||
|
|
5065f87560 | ||
|
|
d5607bc8df | ||
|
|
5799d6efa9 | ||
|
|
6b6f52faf8 | ||
|
|
c6eff1ad06 | ||
|
|
5b88fdd683 | ||
|
|
f9d25a040d | ||
|
|
9c30f6dd64 | ||
|
|
5495d477e2 | ||
|
|
18da48edf9 | ||
|
|
2de4b5bd7a | ||
|
|
463ef2ed50 | ||
|
|
d43bc5cdd8 | ||
|
|
879bfba4cc | ||
|
|
c487b5878e | ||
|
|
b1499832c0 | ||
|
|
fefb55c088 | ||
|
|
757386cc97 | ||
|
|
b952930639 |
52
NEWS
52
NEWS
@@ -1,55 +1,3 @@
|
||||
Overview of Changes in GTK+ 3.7.12
|
||||
==================================
|
||||
|
||||
* We now support touch friendly popups on entries and text views
|
||||
in place of context menus, on touch devices
|
||||
|
||||
* The print dialog now shows printers that are discovered
|
||||
using avahi, if configured with --enable-avahi-browsing
|
||||
|
||||
* Bugs fixed:
|
||||
650424 treeview: expander is not easily themable
|
||||
674207 window: Compiler warning when not building on X11
|
||||
675333 Cannot forget association in Open With dialog: program...
|
||||
688956 Print dialog needs to support Bonjour broadcasting of ...
|
||||
691426 get_current_desktop does not interpret property data c...
|
||||
692955 GtkIconCache fails to load non-builtin icons
|
||||
693995 GkColorChooserWidget crashes in select_swatch if palet...
|
||||
694059 GtkTreeView accessible object:state-changed-expanded e...
|
||||
694162 Memory leaks due to extra ref in gtk_ui_manager_builda...
|
||||
694217 drag&drop half-broken – items get stuck while dragging
|
||||
694274 wayland: don't attempt to unqueue events when events a...
|
||||
694302 Convert pixbuf animation demo (both copies) to GdkFram...
|
||||
694395 Remove unused code
|
||||
694406 Excessive amount of accessible text events when changi...
|
||||
694451 Containers shouldn't special case RTL positions
|
||||
694732 gdk: prevent NULL pointer access when debugging is ena...
|
||||
694742 Fix possible memory leak when GlobalAlloc() fails
|
||||
694924 Dead code in GtkClipboard
|
||||
694925 non-expose based draw() doesn't render window background
|
||||
694968 GtkIconTheme: fix failed assertion when asynchrnously ...
|
||||
694990 use primary icon slot for search icon
|
||||
695131 gtkbin: initialize minimum and natural size to zero fo...
|
||||
|
||||
Translation updates:
|
||||
Brazilian Portuguese
|
||||
Czech
|
||||
Estonian
|
||||
German
|
||||
Greek
|
||||
Gujarati
|
||||
Lithuanian
|
||||
Polish
|
||||
Punjabi
|
||||
Russian
|
||||
Serbian
|
||||
Simplified Chinese
|
||||
Slovenian
|
||||
Spanish
|
||||
Traditional Chinese
|
||||
Vietnamese
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.7.10
|
||||
==================================
|
||||
|
||||
|
||||
12
README.in
12
README.in
@@ -69,17 +69,7 @@ to that bug report.
|
||||
Otherwise, enter a new bug report that describes the patch,
|
||||
and attach the patch to that bug report.
|
||||
|
||||
Patches should be in unified diff form. (The -up option to GNU diff)
|
||||
Even better are git-formatted patches. (Use git format-patch)
|
||||
|
||||
|
||||
Release notes for 3.10
|
||||
======================
|
||||
|
||||
* GDK has been changed to allow only a single screen per display.
|
||||
Only the X11 backend had multiple screens before, and multi-screen
|
||||
setups (not multi-monitor!) are very rare nowadays. If you really
|
||||
need multiple X screens, open them as separate displays.
|
||||
Patches should be in unified diff form. (The -up option to GNU diff.)
|
||||
|
||||
Release notes for 3.8
|
||||
=====================
|
||||
|
||||
@@ -4,8 +4,4 @@ SUBDIRS = \
|
||||
vs9 \
|
||||
vs10
|
||||
|
||||
EXTRA_DIST += \
|
||||
gen-file-list-gtk.py \
|
||||
gengir_gtk.bat
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
||||
@@ -1,140 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# vim: encoding=utf-8
|
||||
# Generate the file lists for processing with g-ir-scanner
|
||||
import os
|
||||
import sys
|
||||
import re
|
||||
import string
|
||||
import subprocess
|
||||
import optparse
|
||||
|
||||
def gen_gdk_filelist(srcroot, subdir, dest):
|
||||
vars = read_vars_from_AM(os.path.join(srcroot, subdir, 'Makefile.am'),
|
||||
vars = {},
|
||||
conds = {},
|
||||
filters = ['gdk_public_h_sources', 'gdk_c_sources'])
|
||||
|
||||
vars['gdk_enums'] = 'gdkenumtypes.c gdkenumtypes.h'
|
||||
|
||||
files = vars['gdk_public_h_sources'].split() + \
|
||||
vars['gdk_c_sources'].split() + \
|
||||
vars['gdk_enums'].split()
|
||||
|
||||
sources = [i for i in files if (i != 'gdkkeysyms-compat.h')]
|
||||
|
||||
with open(dest, 'w') as d:
|
||||
for i in sources:
|
||||
d.write(srcroot + '\\' + subdir + '\\' + i.replace('/', '\\') + '\n')
|
||||
|
||||
def gen_filelist_gtk(srcroot, subdir, dest):
|
||||
vars = read_vars_from_AM(os.path.join(srcroot, 'gtk', 'Makefile.am'),
|
||||
vars = {},
|
||||
conds = {'USE_WIN32':True},
|
||||
filters = ['gtkinclude_HEADERS',
|
||||
'deprecatedinclude_HEADERS',
|
||||
'gtk_base_c_sources'])
|
||||
|
||||
vars['gtk_other_src'] = 'gtkprintoperation-win32.c gtktypebuiltins.h gtktypebuiltins.c'
|
||||
|
||||
files = vars['gtkinclude_HEADERS'].split() + \
|
||||
vars['deprecatedinclude_HEADERS'].split() + \
|
||||
vars['gtk_base_c_sources'].split() + \
|
||||
vars['gtk_other_src'].split()
|
||||
|
||||
sources = [i for i in files if not (i.endswith('private.h')) and i != 'gtktextdisplay.h' and i != 'gtktextlayout.h']
|
||||
|
||||
with open(dest, 'w') as d:
|
||||
for i in sources:
|
||||
d.write(srcroot + '\\' + subdir + '\\' + i.replace('/', '\\') + '\n')
|
||||
|
||||
def read_vars_from_AM(path, vars = {}, conds = {}, filters = None):
|
||||
'''
|
||||
path: path to the Makefile.am
|
||||
vars: predefined variables
|
||||
conds: condition variables for Makefile
|
||||
filters: if None, all variables defined are returned,
|
||||
otherwise, it is a list contains that variables should be returned
|
||||
'''
|
||||
cur_vars = vars.copy()
|
||||
RE_AM_VAR_REF = re.compile(r'\$\((\w+?)\)')
|
||||
RE_AM_VAR = re.compile(r'^\s*(\w+)\s*=(.*)$')
|
||||
RE_AM_INCLUDE = re.compile(r'^\s*include\s+(\w+)')
|
||||
RE_AM_CONTINUING = re.compile(r'\\\s*$')
|
||||
RE_AM_IF = re.compile(r'^\s*if\s+(\w+)')
|
||||
RE_AM_ELSE = re.compile(r'^\s*else')
|
||||
RE_AM_ENDIF = re.compile(r'^\s*endif')
|
||||
def am_eval(cont):
|
||||
return RE_AM_VAR_REF.sub(lambda x: cur_vars.get(x.group(1), ''), cont)
|
||||
with open(path, 'r') as f:
|
||||
contents = f.readlines()
|
||||
#combine continuing lines
|
||||
i = 0
|
||||
ncont = []
|
||||
while i < len(contents):
|
||||
line = contents[i]
|
||||
if RE_AM_CONTINUING.search(line):
|
||||
line = RE_AM_CONTINUING.sub('', line)
|
||||
j = i + 1
|
||||
while j < len(contents) and RE_AM_CONTINUING.search(contents[j]):
|
||||
line += RE_AM_CONTINUING.sub('', contents[j])
|
||||
j += 1
|
||||
else:
|
||||
if j < len(contents):
|
||||
line += contents[j]
|
||||
i = j
|
||||
else:
|
||||
i += 1
|
||||
ncont.append(line)
|
||||
|
||||
#include, var define, var evaluation
|
||||
i = -1
|
||||
skip = False
|
||||
oldskip = []
|
||||
while i < len(ncont) - 1:
|
||||
i += 1
|
||||
line = ncont[i]
|
||||
mo = RE_AM_IF.search(line)
|
||||
if mo:
|
||||
oldskip.append(skip)
|
||||
skip = False if mo.group(1) in conds and conds[mo.group(1)] \
|
||||
else True
|
||||
continue
|
||||
mo = RE_AM_ELSE.search(line)
|
||||
if mo:
|
||||
skip = not skip
|
||||
continue
|
||||
mo = RE_AM_ENDIF.search(line)
|
||||
if mo:
|
||||
if oldskip:
|
||||
skip = oldskip.pop()
|
||||
continue
|
||||
if not skip:
|
||||
mo = RE_AM_INCLUDE.search(line)
|
||||
if mo:
|
||||
cur_vars.update(read_vars_from_AM(am_eval(mo.group(1)), cur_vars, conds, None))
|
||||
continue
|
||||
mo = RE_AM_VAR.search(line)
|
||||
if mo:
|
||||
cur_vars[mo.group(1)] = am_eval(mo.group(2).strip())
|
||||
continue
|
||||
|
||||
#filter:
|
||||
if filters != None:
|
||||
ret = {}
|
||||
for i in filters:
|
||||
ret[i] = cur_vars.get(i, '')
|
||||
return ret
|
||||
else:
|
||||
return cur_vars
|
||||
|
||||
def main(argv):
|
||||
srcroot = '..\\..'
|
||||
subdir_gdk = 'gdk'
|
||||
subdir_gtk = 'gtk'
|
||||
|
||||
gen_gdk_filelist(srcroot, subdir_gdk, 'gdk_list')
|
||||
gen_filelist_gtk(srcroot, subdir_gtk, 'gtk_list')
|
||||
return 0
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main(sys.argv))
|
||||
@@ -1,177 +0,0 @@
|
||||
@echo off
|
||||
|
||||
setlocal EnableDelayedExpansion
|
||||
|
||||
rem Needed environmental variables:
|
||||
rem PLAT: Windows platform-Win32 (i.e. x86) or x64 (i.e. x86-64)
|
||||
rem CONF: Configuration Type, Release or Debug
|
||||
rem VSVER: Visual C++ version used [9, 10 or 11]
|
||||
rem BASEDIR: Where the dependent libraries/headers are located
|
||||
rem PKG_CONFIG_PATH: Where the GLib/ATK/Pango/GDK-Pixbuf and their dependent pkg-config .pc files can be found
|
||||
rem MINGWDIR: Installation path of MINGW GCC, so gcc.exe can be found in %MINGWDIR%\bin.
|
||||
|
||||
rem Note that the Python executable/installation and all the runtime dependencies of the
|
||||
rem library/libraries need to be in your PATH or %BASEBIN%\bin.
|
||||
|
||||
rem Check the environemental variables...
|
||||
if /i "%PLAT%" == "Win32" goto PLAT_OK
|
||||
if /i "%PLAT%" == "x64" goto PLAT_OK
|
||||
if /i "%PLAT%" == "x86" (
|
||||
set PLAT=Win32
|
||||
goto PLAT_OK
|
||||
)
|
||||
if /i "%PLAT%" == "x86-64" (
|
||||
set PLAT=x64
|
||||
goto PLAT_OK
|
||||
)
|
||||
goto ERR_PLAT
|
||||
|
||||
:PLAT_OK
|
||||
if "%VSVER%" == "9" goto VSVER_OK
|
||||
if "%VSVER%" == "10" goto VSVER_OK
|
||||
if "%VSVER%" == "11" goto VSVER_OK
|
||||
goto ERR_VSVER
|
||||
:VSVER_OK
|
||||
if /i "%CONF%" == "Release" goto CONF_OK
|
||||
if /i "%CONF%" == "Debug" goto CONF_OK
|
||||
goto ERR_CONF
|
||||
:CONF_OK
|
||||
if "%BASEDIR%" == "" goto ERR_BASEDIR
|
||||
if not exist %BASEDIR% goto ERR_BASEDIR
|
||||
|
||||
if "%PKG_CONFIG_PATH%" == "" goto ERR_PKGCONFIG
|
||||
if not exist %PKG_CONFIG_PATH%\gobject-2.0.pc goto ERR_PKGCONFIG
|
||||
|
||||
if "%MINGWDIR%" == "" goto ERR_MINGWDIR
|
||||
if not exist %MINGWDIR%\bin\gcc.exe goto ERR_MINGWDIR
|
||||
|
||||
set CC=cl
|
||||
set BINDIR=%CD%\vs%VSVER%\%CONF%\%PLAT%\bin
|
||||
set INCLUDE=%BASEDIR%\include\glib-2.0;%BASEDIR%\lib\glib-2.0\include;%INCLUDE%
|
||||
set LIB=%BINDIR%;%BASEDIR%\lib;%LIB%
|
||||
set PATH=%BINDIR%;%BASEDIR%\bin;%PATH%;%MINGWDIR%\bin
|
||||
set PYTHONPATH=%BASEDIR%\lib\gobject-introspection;%BINDIR%
|
||||
|
||||
echo Creating filelist files for generating GDK3/GTK3 .gir's...
|
||||
call python gen-file-list-gtk.py
|
||||
|
||||
echo Setup .bat for generating GDK3/GTK3 .gir's...
|
||||
|
||||
rem ===============================================================================
|
||||
rem Begin setup of gtk_gir.bat to create Gdk-3.0.gir
|
||||
rem (The ^^ is necessary to span the command to multiple lines on Windows cmd.exe!)
|
||||
rem ===============================================================================
|
||||
|
||||
echo echo Generating Gdk-3.0.gir...> gtk_gir.bat
|
||||
echo @echo off>> gtk_gir.bat
|
||||
echo.>> gtk_gir.bat
|
||||
rem ===============================================================
|
||||
rem Setup the command line flags to g-ir-scanner for Gdk-3.0.gir...
|
||||
rem ===============================================================
|
||||
echo python %BASEDIR%\bin\g-ir-scanner --verbose -I..\.. -I..\..\gdk ^^>> gtk_gir.bat
|
||||
echo -I%BASEDIR%\include\glib-2.0 -I%BASEDIR%\lib\glib-2.0\include ^^>> gtk_gir.bat
|
||||
echo -I%BASEDIR%\include\pango-1.0 -I%BASEDIR%\include\atk-1.0 ^^>> gtk_gir.bat
|
||||
echo -I%BASEDIR%\include\gdk-pixbuf-2.0 -I%BASEDIR%\include ^^>> gtk_gir.bat
|
||||
echo --namespace=Gdk --nsversion=3.0 ^^>> gtk_gir.bat
|
||||
echo --include=Gio-2.0 --include=GdkPixbuf-2.0 ^^>> gtk_gir.bat
|
||||
echo --include=Pango-1.0 --include=cairo-1.0 ^^>> gtk_gir.bat
|
||||
echo --no-libtool --library=gdk-3-vs%VSVER% ^^>> gtk_gir.bat
|
||||
echo --reparse-validate --add-include-path=%BASEDIR%\share\gir-1.0 --add-include-path=. ^^>> gtk_gir.bat
|
||||
echo --pkg-export gdk-3.0 --warn-all --c-include="gdk/gdk.h" ^^>> gtk_gir.bat
|
||||
echo -I..\.. -DG_LOG_DOMAIN=\"Gdk\" -DGDK_COMPILATION ^^>> gtk_gir.bat
|
||||
echo --filelist=gdk_list ^^>> gtk_gir.bat
|
||||
echo -o Gdk-3.0.gir>> gtk_gir.bat
|
||||
echo.>> gtk_gir.bat
|
||||
|
||||
echo Completed setup of .bat for generating Gdk-3.0.gir.
|
||||
echo.>> gtk_gir.bat
|
||||
|
||||
rem =================================================
|
||||
rem Finish setup of gtk_gir.bat to create Gtk-3.0.gir
|
||||
rem =================================================
|
||||
|
||||
rem ===============================================================================
|
||||
rem Begin setup of gtk_gir.bat to create Gtk-3.0.gir
|
||||
rem (The ^^ is necessary to span the command to multiple lines on Windows cmd.exe!)
|
||||
rem ===============================================================================
|
||||
|
||||
echo echo Generating Gtk-3.0.gir...>> gtk_gir.bat
|
||||
echo.>> gtk_gir.bat
|
||||
rem ===============================================================
|
||||
rem Setup the command line flags to g-ir-scanner for Gtk-3.0.gir...
|
||||
rem ===============================================================
|
||||
echo python %BASEDIR%\bin\g-ir-scanner --verbose -I..\.. -I..\..\gtk -I..\..\gdk ^^>> gtk_gir.bat
|
||||
echo -I%BASEDIR%\include\glib-2.0 -I%BASEDIR%\lib\glib-2.0\include ^^>> gtk_gir.bat
|
||||
echo -I%BASEDIR%\include\pango-1.0 -I%BASEDIR%\include\atk-1.0 ^^>> gtk_gir.bat
|
||||
echo -I%BASEDIR%\include\gdk-pixbuf-2.0 -I%BASEDIR%\include ^^>> gtk_gir.bat
|
||||
echo --namespace=Gtk --nsversion=3.0 ^^>> gtk_gir.bat
|
||||
echo --include=Atk-1.0 ^^>> gtk_gir.bat
|
||||
echo --include-uninstalled=./Gdk-3.0.gir ^^>> gtk_gir.bat
|
||||
echo --no-libtool --library=gtk-3-vs%VSVER% ^^>> gtk_gir.bat
|
||||
echo --reparse-validate --add-include-path=%BASEDIR%\share\gir-1.0 --add-include-path=. ^^>> gtk_gir.bat
|
||||
echo --pkg-export gtk+-3.0 --warn-all --c-include="gtk/gtkx.h" ^^>> gtk_gir.bat
|
||||
echo -I..\.. -DG_LOG_DOMAIN=\"Gtk\" -DGTK_LIBDIR=\"/dummy/lib\" ^^>> gtk_gir.bat
|
||||
echo -Dtime_t=long ^^>> gtk_gir.bat
|
||||
echo -DGTK_DATADIR=\"/dummy/share\" -DGTK_DATA_PREFIX=\"/dummy\" ^^>> gtk_gir.bat
|
||||
echo -DGTK_SYSCONFDIR=\"/dummy/etc\" -DGTK_VERSION=\"3.6.2\" ^^>> gtk_gir.bat
|
||||
echo -DGTK_BINARY_VERSION=\"3.0.0\" -DGTK_HOST=\"i686-pc-vs%VSVER%\" ^^>> gtk_gir.bat
|
||||
echo -DGTK_COMPILATION -DGTK_PRINT_BACKENDS=\"file\" ^^>> gtk_gir.bat
|
||||
echo -DGTK_PRINT_PREVIEW_COMMAND=\"undefined-gtk-print-preview-command\" ^^>> gtk_gir.bat
|
||||
echo -DGTK_FILE_SYSTEM_ENABLE_UNSUPPORTED -DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED ^^>> gtk_gir.bat
|
||||
echo -DINCLUDE_IM_am_et -DINCLUDE_IM_cedilla -DINCLUDE_IM_cyrillic_translit ^^>> gtk_gir.bat
|
||||
echo -DINCLUDE_IM_ime -DINCLUDE_IM_inuktitut -DINCLUDE_IM_ipa ^^>> gtk_gir.bat
|
||||
echo -DINCLUDE_IM_multipress -DINCLUDE_IM_thai -DINCLUDE_IM_ti_er ^^>> gtk_gir.bat
|
||||
echo -DINCLUDE_IM_ti_et -DINCLUDE_IM_viqr --filelist=gtk_list ^^>> gtk_gir.bat
|
||||
echo -o Gtk-3.0.gir>> gtk_gir.bat
|
||||
echo.>> gtk_gir.bat
|
||||
|
||||
echo Completed setup of .bat for generating Gtk-3.0.gir.
|
||||
echo.>> gtk_gir.bat
|
||||
|
||||
rem =================================================
|
||||
rem Finish setup of gtk_gir.bat to create Gtk-3.0.gir
|
||||
rem =================================================
|
||||
|
||||
rem =======================
|
||||
rem Now generate the .gir's
|
||||
rem =======================
|
||||
CALL gtk_gir.bat
|
||||
|
||||
rem Clean up the .bat/filelists for generating the .gir files...
|
||||
del gtk_gir.bat
|
||||
del gdk_list
|
||||
del gtk_list
|
||||
|
||||
rem Now compile the generated .gir files
|
||||
%BASEDIR%\bin\g-ir-compiler --includedir=. --debug --verbose Gdk-3.0.gir -o Gdk-3.0.typelib
|
||||
%BASEDIR%\bin\g-ir-compiler --includedir=. --debug --verbose Gtk-3.0.gir -o Gtk-3.0.typelib
|
||||
rem Copy the generated .girs and .typelibs to their appropriate places
|
||||
|
||||
mkdir ..\..\build\win32\vs%VSVER%\%CONF%\%PLAT%\share\gir-1.0
|
||||
move /y *.gir %BASEDIR%\share\gir-1.0\
|
||||
|
||||
mkdir ..\..\build\win32\vs%VSVER%\%CONF%\%PLAT%\lib\girepository-1.0
|
||||
move /y *.typelib %BASEDIR%\lib\girepository-1.0\
|
||||
|
||||
goto DONE
|
||||
|
||||
:ERR_PLAT
|
||||
echo You need to specify a valid Platform [set PLAT=Win32 or PLAT=x64]
|
||||
goto DONE
|
||||
:ERR_VSVER
|
||||
echo You need to specify your Visual Studio version [set VSVER=9 or VSVER=10 or VSVER=11]
|
||||
goto DONE
|
||||
:ERR_CONF
|
||||
echo You need to specify a valid Configuration [set CONF=Release or CONF=Debug]
|
||||
goto DONE
|
||||
:ERR_BASEDIR
|
||||
echo You need to specify a valid BASEDIR.
|
||||
goto DONE
|
||||
:ERR_PKGCONFIG
|
||||
echo You need to specify a valid PKG_CONFIG_PATH
|
||||
goto DONE
|
||||
:ERR_MINGWDIR
|
||||
echo You need to specify a valid MINGWDIR, where a valid gcc installation can be found.
|
||||
goto DONE
|
||||
:DONE
|
||||
|
||||
@@ -1,30 +1,29 @@
|
||||
include $(top_srcdir)/Makefile.decl
|
||||
|
||||
EXTRA_DIST += \
|
||||
README.txt \
|
||||
gtk+.sln \
|
||||
gtk+.props \
|
||||
gdk-win32.vcxproj \
|
||||
gdk-win32.vcxproj.filters \
|
||||
gdk.vcxproj \
|
||||
gdk.vcxprojin \
|
||||
gdk.vcxproj.filters \
|
||||
gdk.vcxproj.filtersin \
|
||||
gtk.vcxproj \
|
||||
gtk.vcxprojin \
|
||||
gtk.vcxproj.filters \
|
||||
gtk.vcxproj.filtersin \
|
||||
gtk3-demo.vcxproj \
|
||||
gtk3-demo.vcxproj.filters \
|
||||
gtk3-demo-application.vcxproj \
|
||||
gtk3-demo-application.vcxproj.filters \
|
||||
gtka11y.vcxproj \
|
||||
gtka11y.vcxproj.filters \
|
||||
gtka11y.vcxprojin \
|
||||
gtka11y.vcxproj.filtersin \
|
||||
gailutil.vcxproj \
|
||||
gailutil.vcxproj.filters \
|
||||
gengir.vcxproj \
|
||||
EXTRA_DIST += \
|
||||
README.txt \
|
||||
gtk+.sln \
|
||||
gtk+.props \
|
||||
gdk-win32.vcxproj \
|
||||
gdk-win32.vcxproj.filters \
|
||||
gdk.vcxproj \
|
||||
gdk.vcxprojin \
|
||||
gdk.vcxproj.filters \
|
||||
gdk.vcxproj.filtersin \
|
||||
gtk.vcxproj \
|
||||
gtk.vcxprojin \
|
||||
gtk.vcxproj.filters \
|
||||
gtk.vcxproj.filtersin \
|
||||
gtk3-demo.vcxproj \
|
||||
gtk3-demo.vcxproj.filters \
|
||||
gtk3-demo-application.vcxproj \
|
||||
gtk3-demo-application.vcxproj.filters \
|
||||
gtka11y.vcxproj \
|
||||
gtka11y.vcxproj.filters \
|
||||
gtka11y.vcxprojin \
|
||||
gtka11y.vcxproj.filtersin \
|
||||
gailutil.vcxproj \
|
||||
gailutil.vcxproj.filters \
|
||||
install.vcxproj
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
<PreprocessorDefinitions>_DEBUG;G_ENABLE_DEBUG;$(GdkDefines);INSIDE_GDK_WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
<PreprocessorDefinitions>_DEBUG;G_ENABLE_DEBUG;$(GdkDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{2093D218-190E-4194-9421-3BA7CBF33B15}</ProjectGuid>
|
||||
<RootNamespace>gengir</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Utility</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Utility</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Utility</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Utility</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="gtk+.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="gtk+.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="gtk+.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="gtk+.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(GlibEtcInstallRoot)\</OutDir>
|
||||
<ExtensionsToDeleteOnClean Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(GlibEtcInstallRoot)\</OutDir>
|
||||
<ExtensionsToDeleteOnClean Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(GlibEtcInstallRoot)\</OutDir>
|
||||
<ExtensionsToDeleteOnClean Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(GlibEtcInstallRoot)\</OutDir>
|
||||
<ExtensionsToDeleteOnClean Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<PreBuildEvent>
|
||||
<Command>$(DoGenGir)</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<PreBuildEvent>
|
||||
<Command>$(DoGenGir)</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<PreBuildEvent>
|
||||
<Command>$(DoGenGir)</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<PreBuildEvent>
|
||||
<Command>$(DoGenGir)</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="gdk.vcxproj">
|
||||
<Project>{fc5aadb5-95cd-4bf0-ba8b-0c16fe7073f7}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="gtk.vcxproj">
|
||||
<Project>{fc5aadb5-95cd-4bf0-ba8b-0c16fe7073f5}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -23,6 +23,23 @@ copy $(Configuration)\$(Platform)\bin\*.dll $(CopyDir)\bin
|
||||
copy $(Configuration)\$(Platform)\bin\*.exe $(CopyDir)\bin
|
||||
|
||||
|
||||
mkdir $(CopyDir)\share\gtk-$(ApiVersion)\demo
|
||||
|
||||
copy ..\..\..\demos\gtk-demo\*.c $(CopyDir)\share\gtk-$(ApiVersion)\demo
|
||||
|
||||
copy ..\..\..\demos\gtk-demo\*.css $(CopyDir)\share\gtk-$(ApiVersion)\demo
|
||||
|
||||
copy ..\..\..\demos\gtk-demo\*.h $(CopyDir)\share\gtk-$(ApiVersion)\demo
|
||||
|
||||
copy ..\..\..\demos\gtk-demo\*.ui $(CopyDir)\share\gtk-$(ApiVersion)\demo
|
||||
|
||||
copy ..\..\..\demos\gtk-demo\*.jpg $(CopyDir)\share\gtk-$(ApiVersion)\demo
|
||||
|
||||
copy ..\..\..\demos\gtk-demo\*.png $(CopyDir)\share\gtk-$(ApiVersion)\demo
|
||||
|
||||
copy ..\..\..\demos\gtk-demo\*.gif $(CopyDir)\share\gtk-$(ApiVersion)\demo
|
||||
|
||||
|
||||
mkdir $(CopyDir)\lib
|
||||
|
||||
copy $(Configuration)\$(Platform)\bin\*-$(ApiVersion).lib $(CopyDir)\lib
|
||||
@@ -576,7 +593,7 @@ copy ..\..\..\gtk\deprecated\gtkvseparator.h $(CopyDir)\include\gtk-$(ApiVersion
|
||||
copy ..\..\..\gtk\deprecated\gtkvpaned.h $(CopyDir)\include\gtk-$(ApiVersion)\gtk\deprecated
|
||||
|
||||
|
||||
mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y
|
||||
mkdir $(CopyDir)\include\gtk-$(ApiVersion)\a11y
|
||||
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkarrowaccessible.h $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y
|
||||
|
||||
@@ -16,8 +16,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gailutil", "gailutil.vcxpro
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "install", "install.vcxproj", "{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gengir", "gengir.vcxproj", "{2093D218-190E-4194-9421-3BA7CBF33B15}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
@@ -90,10 +88,6 @@ Global
|
||||
{3281202A-CD26-4C67-B892-EB34BDBC612F}.Release|Win32.Build.0 = Release|Win32
|
||||
{3281202A-CD26-4C67-B892-EB34BDBC612F}.Release|x64.ActiveCfg = Release|x64
|
||||
{3281202A-CD26-4C67-B892-EB34BDBC612F}.Release|x64.Build.0 = Release|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|x64.ActiveCfg = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
<PreprocessorDefinitions>_DEBUG;G_ENABLE_DEBUG;$(GtkDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
<PreprocessorDefinitions>_DEBUG;$(GtkPrefixDefine);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
include $(top_srcdir)/Makefile.decl
|
||||
|
||||
EXTRA_DIST += \
|
||||
README.txt \
|
||||
gtk+.sln \
|
||||
gtk+.vsprops \
|
||||
gdk-win32.vcproj \
|
||||
gdk.vcproj \
|
||||
gdk.vcprojin \
|
||||
gtk.vcproj \
|
||||
gtk.vcprojin \
|
||||
gtk3-demo.vcproj \
|
||||
gtk3-demo-application.vcproj \
|
||||
gtka11y.vcproj \
|
||||
gtka11y.vcprojin \
|
||||
gailutil.vcproj \
|
||||
gengir.vcproj \
|
||||
EXTRA_DIST += \
|
||||
README.txt \
|
||||
gtk+.sln \
|
||||
gtk+.vsprops \
|
||||
gdk-win32.vcproj \
|
||||
gdk.vcproj \
|
||||
gdk.vcprojin \
|
||||
gtk.vcproj \
|
||||
gtk.vcprojin \
|
||||
gtk3-demo.vcproj \
|
||||
gtk3-demo-application.vcproj \
|
||||
gtka11y.vcproj \
|
||||
gtka11y.vcprojin \
|
||||
gailutil.vcproj \
|
||||
install.vcproj
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
PreprocessorDefinitions="_DEBUG;G_ENABLE_DEBUG;$(GdkDefines);INSIDE_GDK_WIN32"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
PreprocessorDefinitions="_DEBUG;G_ENABLE_DEBUG;$(GdkDefines)"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="gengir"
|
||||
ProjectGUID="{2093D218-190E-4194-9421-3BA7CBF33B15}"
|
||||
RootNamespace="gengir"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="131072"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
<Platform
|
||||
Name="x64"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
InheritedPropertySheets=".\gtk+.vsprops"
|
||||
OutputDirectory="$(GlibEtcInstallRoot)"
|
||||
ConfigurationType="10"
|
||||
CharacterSet="2"
|
||||
DeleteExtensionsOnClean=""
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
CommandLine="$(DoGenGir)"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
InheritedPropertySheets=".\gtk+.vsprops"
|
||||
OutputDirectory="$(GlibEtcInstallRoot)"
|
||||
ConfigurationType="10"
|
||||
CharacterSet="2"
|
||||
DeleteExtensionsOnClean=""
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
CommandLine="$(DoGenGir)"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
InheritedPropertySheets=".\gtk+.vsprops"
|
||||
OutputDirectory="$(GlibEtcInstallRoot)"
|
||||
ConfigurationType="10"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
DeleteExtensionsOnClean=""
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
CommandLine="$(DoGenGir)"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
InheritedPropertySheets=".\gtk+.vsprops"
|
||||
OutputDirectory="$(GlibEtcInstallRoot)"
|
||||
ConfigurationType="10"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
DeleteExtensionsOnClean=""
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
CommandLine="$(DoGenGir)"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
</VisualStudioProject>
|
||||
@@ -42,12 +42,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "install", "install.vcproj",
|
||||
{3281202A-CD26-4C67-B892-EB34BDBC612F} = {3281202A-CD26-4C67-B892-EB34BDBC612F}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gengir", "gengir.vcproj", "{2093D218-190E-4194-9421-3BA7CBF33B15}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F7} = {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F7}
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5} = {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
@@ -120,10 +114,6 @@ Global
|
||||
{3281202A-CD26-4C67-B892-EB34BDBC612F}.Release|Win32.Build.0 = Release|Win32
|
||||
{3281202A-CD26-4C67-B892-EB34BDBC612F}.Release|x64.ActiveCfg = Release|x64
|
||||
{3281202A-CD26-4C67-B892-EB34BDBC612F}.Release|x64.Build.0 = Release|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|x64.ActiveCfg = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -79,6 +79,16 @@ mkdir $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\*.dll $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\*.exe $(CopyDir)\bin

|
||||
|
||||
mkdir $(CopyDir)\share\gtk-$(ApiVersion)\demo

|
||||
|
||||
copy ..\..\..\demos\gtk-demo\*.c $(CopyDir)\share\gtk-$(ApiVersion)\demo

|
||||
copy ..\..\..\demos\gtk-demo\*.css $(CopyDir)\share\gtk-$(ApiVersion)\demo

|
||||
copy ..\..\..\demos\gtk-demo\*.h $(CopyDir)\share\gtk-$(ApiVersion)\demo

|
||||
copy ..\..\..\demos\gtk-demo\*.ui $(CopyDir)\share\gtk-$(ApiVersion)\demo

|
||||
copy ..\..\..\demos\gtk-demo\*.jpg $(CopyDir)\share\gtk-$(ApiVersion)\demo

|
||||
copy ..\..\..\demos\gtk-demo\*.png $(CopyDir)\share\gtk-$(ApiVersion)\demo

|
||||
copy ..\..\..\demos\gtk-demo\*.gif $(CopyDir)\share\gtk-$(ApiVersion)\demo

|
||||
|
||||
mkdir $(CopyDir)\lib

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\*-$(ApiVersion).lib $(CopyDir)\lib

|
||||
|
||||
@@ -359,7 +369,7 @@ copy ..\..\..\gtk\deprecated\gtkvscrollbar.h $(CopyDir)\include\gtk-$(ApiVersion
|
||||
copy ..\..\..\gtk\deprecated\gtkvseparator.h $(CopyDir)\include\gtk-$(ApiVersion)\gtk\deprecated

|
||||
copy ..\..\..\gtk\deprecated\gtkvpaned.h $(CopyDir)\include\gtk-$(ApiVersion)\gtk\deprecated

|
||||
|
||||
mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y

|
||||
mkdir $(CopyDir)\include\gtk-$(ApiVersion)\a11y

|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkarrowaccessible.h $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkbooleancellaccessible.h $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y

|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
PreprocessorDefinitions="_DEBUG;G_ENABLE_DEBUG;$(GtkDefines)"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
PreprocessorDefinitions="_DEBUG;$(GtkPrefixDefine)"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
|
||||
13
configure.ac
13
configure.ac
@@ -9,8 +9,8 @@
|
||||
# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
|
||||
|
||||
m4_define([gtk_major_version], [3])
|
||||
m4_define([gtk_minor_version], [9])
|
||||
m4_define([gtk_micro_version], [0])
|
||||
m4_define([gtk_minor_version], [7])
|
||||
m4_define([gtk_micro_version], [11])
|
||||
m4_define([gtk_interface_age], [0])
|
||||
m4_define([gtk_binary_age],
|
||||
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
|
||||
@@ -42,7 +42,7 @@ AC_CANONICAL_TARGET
|
||||
m4_define([gtk_binary_version], [3.0.0])
|
||||
|
||||
# required versions of other packages
|
||||
m4_define([glib_required_version], [2.37.0])
|
||||
m4_define([glib_required_version], [2.35.3])
|
||||
m4_define([pango_required_version], [1.32.4])
|
||||
m4_define([atk_required_version], [2.7.5])
|
||||
m4_define([cairo_required_version], [1.10.0])
|
||||
@@ -350,7 +350,7 @@ if test "$enable_win32_backend" = "yes"; then
|
||||
backend_immodules="$backend_immodules,ime"
|
||||
GDK_WINDOWING="$GDK_WINDOWING
|
||||
#define GDK_WINDOWING_WIN32"
|
||||
GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid -lwinmm"
|
||||
GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid"
|
||||
AM_CONDITIONAL(USE_WIN32, true)
|
||||
PANGO_PACKAGES="pangowin32 pangocairo"
|
||||
else
|
||||
@@ -390,7 +390,6 @@ else
|
||||
AM_CONDITIONAL(USE_BROADWAY, false)
|
||||
fi
|
||||
|
||||
DISABLE_ON_WAYLAND=''
|
||||
if test "x$enable_wayland_backend" = "xyes"; then
|
||||
# For the cairo image backend
|
||||
cairo_backends="$cairo_backends cairo"
|
||||
@@ -398,13 +397,11 @@ if test "x$enable_wayland_backend" = "xyes"; then
|
||||
have_gio_unix=yes
|
||||
GDK_WINDOWING="$GDK_WINDOWING
|
||||
#define GDK_WINDOWING_WAYLAND"
|
||||
DISABLE_ON_WAYLAND='%'
|
||||
WAYLAND_PACKAGES="wayland-client >= 1.0.0 xkbcommon >= 0.2.0 wayland-cursor"
|
||||
AM_CONDITIONAL(USE_WAYLAND, true)
|
||||
else
|
||||
AM_CONDITIONAL(USE_WAYLAND, false)
|
||||
fi
|
||||
AC_SUBST(DISABLE_ON_WAYLAND)
|
||||
|
||||
# strip leading space
|
||||
GDK_BACKENDS=${GDK_BACKENDS#* }
|
||||
@@ -1424,7 +1421,7 @@ else
|
||||
$CUPS_API_MAJOR -eq 1 -a $CUPS_API_MINOR -ge 6; then
|
||||
AC_DEFINE(HAVE_CUPS_API_1_6, 1,
|
||||
[Define to 1 if CUPS 1.6 API is available])
|
||||
have_cups_api_1_6=yes
|
||||
|
||||
fi
|
||||
|
||||
AC_SUBST(CUPS_API_MAJOR)
|
||||
|
||||
@@ -43,7 +43,6 @@ demos = \
|
||||
search_entry.c \
|
||||
sizegroup.c \
|
||||
spinner.c \
|
||||
stack.c \
|
||||
stock_browser.c \
|
||||
textview.c \
|
||||
textscroll.c \
|
||||
@@ -111,7 +110,6 @@ RESOURCES= $(demos) \
|
||||
application.ui \
|
||||
demo.ui \
|
||||
menus.ui \
|
||||
stack.ui \
|
||||
theming.ui \
|
||||
alphatest.png \
|
||||
apple-red.png \
|
||||
|
||||
@@ -1,23 +1,24 @@
|
||||
/* Change Display
|
||||
*
|
||||
* Demonstrates migrating a window between different displays.
|
||||
* A display is a mouse and keyboard with some number of
|
||||
* associated monitors. The neat thing about having multiple
|
||||
* displays is that they can be on a completely separate
|
||||
* Demonstrates migrating a window between different displays and
|
||||
* screens. A display is a mouse and keyboard with some number of
|
||||
* associated monitors. A screen is a set of monitors grouped
|
||||
* into a single physical work area. The neat thing about having
|
||||
* multiple displays is that they can be on a completely separate
|
||||
* computers, as long as there is a network connection to the
|
||||
* computer where the application is running.
|
||||
*
|
||||
* Only some of the windowing systems where GTK+ runs have the
|
||||
* concept of multiple displays. (The X Window System is the
|
||||
* main example.) Other windowing systems can only handle one
|
||||
* keyboard and mouse, and combine all monitors into
|
||||
* a single display.
|
||||
* concept of multiple displays and screens. (The X Window System
|
||||
* is the main example.) Other windowing systems can only
|
||||
* handle one keyboard and mouse, and combine all monitors into
|
||||
* a single screen.
|
||||
*
|
||||
* This is a moderately complex example, and demonstrates:
|
||||
*
|
||||
* - Tracking the currently open displays
|
||||
* - Tracking the currently open displays and screens
|
||||
*
|
||||
* - Changing the display for a window
|
||||
* - Changing the screen for a window
|
||||
*
|
||||
* - Letting the user choose a window by clicking on it
|
||||
*
|
||||
@@ -44,8 +45,11 @@ struct _ChangeDisplayInfo
|
||||
GtkSizeGroup *size_group;
|
||||
|
||||
GtkTreeModel *display_model;
|
||||
GtkTreeModel *screen_model;
|
||||
GtkTreeSelection *screen_selection;
|
||||
|
||||
GdkDisplay *current_display;
|
||||
GdkScreen *current_screen;
|
||||
};
|
||||
|
||||
/* These enumerations provide symbolic names for the columns
|
||||
@@ -173,11 +177,40 @@ query_change_display (ChangeDisplayInfo *info)
|
||||
"to move to the new screen");
|
||||
|
||||
if (toplevel)
|
||||
gtk_window_set_screen (GTK_WINDOW (toplevel), gdk_display_get_screen (info->current_display, 0));
|
||||
gtk_window_set_screen (GTK_WINDOW (toplevel), info->current_screen);
|
||||
else
|
||||
gdk_display_beep (gdk_screen_get_display (screen));
|
||||
}
|
||||
|
||||
/* Fills in the screen list based on the current display
|
||||
*/
|
||||
static void
|
||||
fill_screens (ChangeDisplayInfo *info)
|
||||
{
|
||||
gtk_list_store_clear (GTK_LIST_STORE (info->screen_model));
|
||||
|
||||
if (info->current_display)
|
||||
{
|
||||
gint n_screens = gdk_display_get_n_screens (info->current_display);
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < n_screens; i++)
|
||||
{
|
||||
GdkScreen *screen = gdk_display_get_screen (info->current_display, i);
|
||||
GtkTreeIter iter;
|
||||
|
||||
gtk_list_store_append (GTK_LIST_STORE (info->screen_model), &iter);
|
||||
gtk_list_store_set (GTK_LIST_STORE (info->screen_model), &iter,
|
||||
SCREEN_COLUMN_NUMBER, i,
|
||||
SCREEN_COLUMN_SCREEN, screen,
|
||||
-1);
|
||||
|
||||
if (i == 0)
|
||||
gtk_tree_selection_select_iter (info->screen_selection, &iter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Called when the user clicks on a button in our dialog or
|
||||
* closes the dialog through the window manager. Unless the
|
||||
* "Change" button was clicked, we destroy the dialog.
|
||||
@@ -287,6 +320,28 @@ display_changed_cb (GtkTreeSelection *selection,
|
||||
-1);
|
||||
else
|
||||
info->current_display = NULL;
|
||||
|
||||
fill_screens (info);
|
||||
}
|
||||
|
||||
/* Called when the selected row in the sceen list changes.
|
||||
* Updates info->current_screen.
|
||||
*/
|
||||
static void
|
||||
screen_changed_cb (GtkTreeSelection *selection,
|
||||
ChangeDisplayInfo *info)
|
||||
{
|
||||
GtkTreeModel *model;
|
||||
GtkTreeIter iter;
|
||||
|
||||
if (info->current_screen)
|
||||
g_object_unref (info->current_screen);
|
||||
if (gtk_tree_selection_get_selected (selection, &model, &iter))
|
||||
gtk_tree_model_get (model, &iter,
|
||||
SCREEN_COLUMN_SCREEN, &info->current_screen,
|
||||
-1);
|
||||
else
|
||||
info->current_screen = NULL;
|
||||
}
|
||||
|
||||
/* This function is used both for creating the "Display" and
|
||||
@@ -391,6 +446,37 @@ create_display_frame (ChangeDisplayInfo *info)
|
||||
return frame;
|
||||
}
|
||||
|
||||
/* Creates the "Screen" frame in the main window.
|
||||
*/
|
||||
GtkWidget *
|
||||
create_screen_frame (ChangeDisplayInfo *info)
|
||||
{
|
||||
GtkWidget *frame;
|
||||
GtkWidget *tree_view;
|
||||
GtkWidget *button_vbox;
|
||||
GtkTreeViewColumn *column;
|
||||
|
||||
create_frame (info, "Screen", &frame, &tree_view, &button_vbox);
|
||||
|
||||
info->screen_model = (GtkTreeModel *)gtk_list_store_new (SCREEN_NUM_COLUMNS,
|
||||
G_TYPE_INT,
|
||||
GDK_TYPE_SCREEN);
|
||||
|
||||
gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), info->screen_model);
|
||||
|
||||
column = gtk_tree_view_column_new_with_attributes ("Number",
|
||||
gtk_cell_renderer_text_new (),
|
||||
"text", SCREEN_COLUMN_NUMBER,
|
||||
NULL);
|
||||
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column);
|
||||
|
||||
info->screen_selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
|
||||
g_signal_connect (info->screen_selection, "changed",
|
||||
G_CALLBACK (screen_changed_cb), info);
|
||||
|
||||
return frame;
|
||||
}
|
||||
|
||||
/* Called when one of the currently open displays is closed.
|
||||
* Remove it from our list of displays.
|
||||
*/
|
||||
@@ -494,9 +580,12 @@ destroy_info (ChangeDisplayInfo *info)
|
||||
|
||||
g_object_unref (info->size_group);
|
||||
g_object_unref (info->display_model);
|
||||
g_object_unref (info->screen_model);
|
||||
|
||||
if (info->current_display)
|
||||
g_object_unref (info->current_display);
|
||||
if (info->current_screen)
|
||||
g_object_unref (info->current_screen);
|
||||
|
||||
g_free (info);
|
||||
}
|
||||
@@ -548,6 +637,9 @@ do_changedisplay (GtkWidget *do_widget)
|
||||
frame = create_display_frame (info);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
|
||||
|
||||
frame = create_screen_frame (info);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
|
||||
|
||||
initialize_displays (info);
|
||||
|
||||
gtk_widget_show_all (info->window);
|
||||
|
||||
@@ -55,9 +55,6 @@
|
||||
<file preprocess="to-pixdata">gnome-fs-directory.png</file>
|
||||
<file preprocess="to-pixdata">gnome-fs-regular.png</file>
|
||||
</gresource>
|
||||
<gresource prefix="/stack">
|
||||
<file>stack.ui</file>
|
||||
</gresource>
|
||||
<gresource prefix="/images">
|
||||
<file>alphatest.png</file>
|
||||
<file>floppybuddy.gif</file>
|
||||
@@ -113,7 +110,6 @@
|
||||
<file>rotated_text.c</file>
|
||||
<file>search_entry.c</file>
|
||||
<file>sizegroup.c</file>
|
||||
<file>stack.c</file>
|
||||
<file>spinner.c</file>
|
||||
<file>stock_browser.c</file>
|
||||
<file>textview.c</file>
|
||||
|
||||
@@ -403,7 +403,7 @@ static GtkWidget *create_text (GtkWidget **text_view, gboolean is_source);
|
||||
static void
|
||||
add_data_tab (const gchar *demoname)
|
||||
{
|
||||
gchar *resource_dir, *resource_name, *content_type, *content_mime;
|
||||
gchar *resource_dir, *resource_name, *content_type;
|
||||
gchar **resources;
|
||||
GBytes *bytes;
|
||||
GtkWidget *widget, *label;
|
||||
@@ -427,20 +427,17 @@ add_data_tab (const gchar *demoname)
|
||||
g_bytes_get_data (bytes, NULL),
|
||||
g_bytes_get_size (bytes),
|
||||
NULL);
|
||||
content_mime = g_content_type_get_mime_type (content_type);
|
||||
|
||||
/* In theory we should look at all the mime types gdk-pixbuf supports
|
||||
* and go from there, but we know what file types we've added.
|
||||
*/
|
||||
if (g_content_type_is_a (content_mime, "image/png") ||
|
||||
g_content_type_is_a (content_mime, "image/gif") ||
|
||||
g_content_type_is_a (content_mime, "image/jpeg"))
|
||||
if (g_content_type_is_a (content_type, "image/png") ||
|
||||
g_content_type_is_a (content_type, "image/gif") ||
|
||||
g_content_type_is_a (content_type, "image/jpeg"))
|
||||
{
|
||||
widget = gtk_image_new_from_resource (resource_name);
|
||||
}
|
||||
else if (g_content_type_is_a (content_mime, "text/plain") ||
|
||||
g_content_type_is_a (content_mime, "application/x-ext-ui") ||
|
||||
g_content_type_is_a (content_mime, "text/css"))
|
||||
else if (g_content_type_is_a (content_type, "text/plain"))
|
||||
{
|
||||
GtkTextBuffer *buffer;
|
||||
GtkWidget *textview;
|
||||
@@ -452,8 +449,7 @@ add_data_tab (const gchar *demoname)
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
g_warning ("Don't know how to display resource '%s' of type '%s'\n", resource_name, content_mime);
|
||||
g_warning ("Don't know how to display resource '%s' of type '%s'\n", resource_name, content_type);
|
||||
widget = NULL;
|
||||
}
|
||||
|
||||
@@ -462,7 +458,6 @@ add_data_tab (const gchar *demoname)
|
||||
gtk_widget_show (label);
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), widget, label);
|
||||
|
||||
g_free (content_mime);
|
||||
g_free (content_type);
|
||||
g_free (resource_name);
|
||||
g_bytes_unref (bytes);
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
/* Stack
|
||||
*
|
||||
* GtkStack is a container that shows a single child at a time,
|
||||
* with nice transitions when the visible child changes.
|
||||
*
|
||||
* GtkStackSwitcher adds buttons to control which child is visible.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static GtkBuilder *builder;
|
||||
|
||||
GtkWidget *
|
||||
do_stack (GtkWidget *do_widget)
|
||||
{
|
||||
static GtkWidget *window = NULL;
|
||||
GError *err = NULL;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
builder = gtk_builder_new ();
|
||||
gtk_builder_add_from_resource (builder, "/stack/stack.ui", &err);
|
||||
if (err)
|
||||
{
|
||||
g_error ("ERROR: %s\n", err->message);
|
||||
return NULL;
|
||||
}
|
||||
gtk_builder_connect_signals (builder, NULL);
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
|
||||
gtk_window_set_screen (GTK_WINDOW (window),
|
||||
gtk_widget_get_screen (do_widget));
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
{
|
||||
gtk_widget_show_all (window);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_destroy (window);
|
||||
window = NULL;
|
||||
}
|
||||
|
||||
|
||||
return window;
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 3.6 -->
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="title" translatable="yes">GtkStack</property>
|
||||
<child>
|
||||
<object class="GtkGrid" id="grid1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkStackSwitcher" id="switcher">
|
||||
<property name="visible">True</property>
|
||||
<property name="stack">stack</property>
|
||||
<property name="halign">center</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="width">1</property>
|
||||
<property name="height">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStack" id="stack">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="transition-type">crossfade</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin-top">20</property>
|
||||
<property name="margin-bottom">20</property>
|
||||
<property name="resource">/application/gtk-logo-48.png</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">page1</property>
|
||||
<property name="title" translatable="yes">Page 1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="checkbutton1">
|
||||
<property name="label" translatable="yes">Page 2</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">page2</property>
|
||||
<property name="title" translatable="yes">Page 2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinner" id="spinner1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="active">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">page3</property>
|
||||
<property name="icon-name">face-laugh-symbolic</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="width">1</property>
|
||||
<property name="height">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
@@ -85,7 +85,7 @@ scroll_to_bottom (GtkTextView *textview)
|
||||
gtk_text_iter_set_line_offset (&iter, 0);
|
||||
|
||||
/* and place the mark at iter. the mark will stay there after we
|
||||
* insert some text at the end because it has left gravity.
|
||||
* insert some text at the end because it has right gravity.
|
||||
*/
|
||||
mark = gtk_text_buffer_get_mark (buffer, "scroll");
|
||||
gtk_text_buffer_move_mark (buffer, mark, &iter);
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
<xi:include href="xml/pango_interaction.xml" />
|
||||
<xi:include href="xml/cairo_interaction.xml" />
|
||||
<xi:include href="xml/x_interaction.xml" />
|
||||
<xi:include href="xml/wayland_interaction.xml" />
|
||||
<xi:include href="xml/gdkapplaunchcontext.xml" />
|
||||
<xi:include href="xml/gdktestutils.xml" />
|
||||
</reference>
|
||||
|
||||
@@ -10,7 +10,6 @@ gdk_parse_args
|
||||
gdk_get_display_arg_name
|
||||
gdk_notify_startup_complete
|
||||
gdk_notify_startup_complete_with_id
|
||||
gdk_set_allowed_backends
|
||||
|
||||
<SUBSECTION>
|
||||
gdk_get_program_class
|
||||
@@ -52,7 +51,6 @@ gdk_error_trap_pop_ignored
|
||||
GDK_WINDOWING_X11
|
||||
GDK_WINDOWING_WIN32
|
||||
GDK_WINDOWING_QUARTZ
|
||||
GDK_WINDOWING_WAYLAND
|
||||
|
||||
<SUBSECTION>
|
||||
GDK_VERSION_3_0
|
||||
@@ -172,7 +170,6 @@ GdkDisplayClass
|
||||
<TITLE>GdkDisplayManager</TITLE>
|
||||
GdkDisplayManager
|
||||
gdk_display_manager_get
|
||||
gdk_display_manager_peek
|
||||
gdk_display_manager_get_default_display
|
||||
gdk_display_manager_set_default_display
|
||||
gdk_display_manager_list_displays
|
||||
@@ -1129,54 +1126,6 @@ gdk_x11_window_get_type
|
||||
gdk_window_impl_x11_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<INCLUDE>gdk/gdkwayland.h</INCLUDE>
|
||||
<TITLE>Wayland Interaction</TITLE>
|
||||
<FILE>wayland_interaction</FILE>
|
||||
gdk_wayland_device_get_wl_keyboard
|
||||
gdk_wayland_device_get_wl_pointer
|
||||
gdk_wayland_device_get_wl_seat
|
||||
gdk_wayland_display_get_wl_compositor
|
||||
gdk_wayland_display_get_wl_display
|
||||
gdk_wayland_display_get_wl_shell
|
||||
gdk_wayland_window_get_wl_shell_surface
|
||||
gdk_wayland_window_get_wl_surface
|
||||
gdk_wayland_window_set_use_custom_surface
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GDK_TYPE_WAYLAND_DEVICE
|
||||
GDK_WAYLAND_DEVICE
|
||||
GDK_WAYLAND_DEVICE_CLASS
|
||||
GDK_WAYLAND_DEVICE_GET_CLASS
|
||||
GDK_IS_WAYLAND_DEVICE
|
||||
GDK_IS_WAYLAND_DEVICE_CLASS
|
||||
GDK_TYPE_WAYLAND_DISPLAY
|
||||
GDK_WAYLAND_DISPLAY
|
||||
GDK_WAYLAND_DISPLAY_CLASS
|
||||
GDK_WAYLAND_DISPLAY_GET_CLASS
|
||||
GDK_IS_WAYLAND_DISPLAY
|
||||
GDK_IS_WAYLAND_DISPLAY_CLASS
|
||||
GDK_TYPE_WAYLAND_DISPLAY_MANAGER
|
||||
GDK_WAYLAND_DISPLAY_MANAGER
|
||||
GDK_WAYLAND_DISPLAY_MANAGER_CLASS
|
||||
GDK_WAYLAND_DISPLAY_MANAGER_GET_CLASS
|
||||
GDK_IS_WAYLAND_DISPLAY_MANAGER
|
||||
GDK_IS_WAYLAND_DISPLAY_MANAGER_CLASS
|
||||
GDK_TYPE_WAYLAND_WINDOW
|
||||
GDK_WAYLAND_WINDOW
|
||||
GDK_WAYLAND_WINDOW_CLASS
|
||||
GDK_WAYLAND_WINDOW_GET_CLASS
|
||||
GDK_IS_WAYLAND_WINDOW
|
||||
GDK_IS_WAYLAND_WINDOW_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gdk_wayland_device_get_type
|
||||
gdk_wayland_display_get_type
|
||||
gdk_wayland_display_manager_get_type
|
||||
gdk_wayland_window_get_type
|
||||
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<TITLE>Application launching</TITLE>
|
||||
<FILE>gdkapplaunchcontext</FILE>
|
||||
|
||||
@@ -54,15 +54,6 @@ Start your applications like this:
|
||||
BROADWAY_DISPLAY=:5 gtk3-demo
|
||||
</programlisting>
|
||||
|
||||
You can add password protection for your session by creating a file in
|
||||
<filename>$XDG_CONFIG_HOME/broadway.passwd</filename> or <filename>$HOME/.config/broadway.passwd</filename>
|
||||
with a crypt(3) style password hash.
|
||||
|
||||
A simple way to generate it is with openssl:
|
||||
<programlisting>
|
||||
openssl passwd -1 > ~/.config/broadway.passwd
|
||||
</programlisting>
|
||||
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ this range will trigger compiler warnings.
|
||||
Here is how you would compile hello.c if you want to allow it
|
||||
to use symbols that were not deprecated in 3.2:
|
||||
<programlisting>
|
||||
$ cc -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_2 `pkg-config --cflags --libs gtk+-3.0` hello.c -o hello
|
||||
$ cc -DGDK_VERSION_MIN_REQIRED=GDK_VERSION_3_2 `pkg-config --cflags --libs gtk+-3.0` hello.c -o hello
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
|
||||
@@ -220,7 +220,6 @@
|
||||
<xi:include href="xml/gtkfontbutton.xml" />
|
||||
<xi:include href="xml/gtkfontchooserwidget.xml" />
|
||||
<xi:include href="xml/gtkfontchooserdialog.xml" />
|
||||
<xi:include href="xml/gtkplacessidebar.xml" />
|
||||
</chapter>
|
||||
|
||||
<chapter id="LayoutContainers">
|
||||
@@ -234,11 +233,8 @@
|
||||
<xi:include href="xml/gtkpaned.xml" />
|
||||
<xi:include href="xml/gtklayout.xml" />
|
||||
<xi:include href="xml/gtknotebook.xml" />
|
||||
<xi:include href="xml/gtkstack.xml" />
|
||||
<xi:include href="xml/gtkstackswitcher.xml" />
|
||||
<xi:include href="xml/gtkexpander.xml" />
|
||||
<xi:include href="xml/gtkoverlay.xml" />
|
||||
<xi:include href="xml/gtkheaderbar.xml" />
|
||||
<xi:include href="xml/gtkorientable.xml" />
|
||||
</chapter>
|
||||
|
||||
@@ -420,10 +416,6 @@
|
||||
<title>Index of new symbols in 3.8</title>
|
||||
<xi:include href="xml/api-index-3.8.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-10" role="3.10">
|
||||
<title>Index of new symbols in 3.10</title>
|
||||
<xi:include href="xml/api-index-3.10.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
|
||||
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
|
||||
|
||||
|
||||
@@ -539,9 +539,6 @@ gtk_builder_get_objects
|
||||
gtk_builder_expose_object
|
||||
gtk_builder_connect_signals
|
||||
gtk_builder_connect_signals_full
|
||||
gtk_builder_add_callback_symbol
|
||||
gtk_builder_add_callback_symbols
|
||||
gtk_builder_lookup_callback_symbol
|
||||
gtk_builder_set_translation_domain
|
||||
gtk_builder_get_translation_domain
|
||||
gtk_builder_get_type_from_name
|
||||
@@ -2483,32 +2480,6 @@ GTK_PANED_GET_CLASS
|
||||
gtk_paned_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkplacessidebar</FILE>
|
||||
<TITLE>GtkPlacesSidebar</FILE>
|
||||
GtkPlacesSidebar
|
||||
GtkPlacesOpenFlags
|
||||
gtk_places_sidebar_new
|
||||
gtk_places_sidebar_set_open_flags
|
||||
gtk_places_sidebar_set_location
|
||||
gtk_places_sidebar_get_location
|
||||
gtk_places_sidebar_set_show_desktop
|
||||
gtk_places_sidebar_set_accept_uri_drops
|
||||
gtk_places_sidebar_add_shortcut
|
||||
gtk_places_sidebar_remove_shortcut
|
||||
gtk_places_sidebar_list_shortcuts
|
||||
gtk_places_sidebar_get_nth_bookmark
|
||||
<SUBSECTION Standard>
|
||||
GTK_PLACES_SIDEBAR
|
||||
GTK_IS_PLACES_SIDEBAR
|
||||
GTK_TYPE_PLACES_SIDEBAR
|
||||
GTK_PLACES_SIDEBAR_CLASS
|
||||
GTK_IS_PLACES_SIDEBAR_CLASS
|
||||
GTK_PLACES_SIDEBAR_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
gtk_places_sidebar_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkplug</FILE>
|
||||
<TITLE>GtkPlug</TITLE>
|
||||
@@ -3605,11 +3576,11 @@ gtk_text_mark_get_type
|
||||
<TITLE>GtkTextTag</TITLE>
|
||||
GtkTextTag
|
||||
GtkWrapMode
|
||||
GtkTextAttributes
|
||||
gtk_text_tag_new
|
||||
gtk_text_tag_get_priority
|
||||
gtk_text_tag_set_priority
|
||||
gtk_text_tag_event
|
||||
GtkTextAttributes
|
||||
GtkTextAppearance
|
||||
gtk_text_attributes_new
|
||||
gtk_text_attributes_copy
|
||||
@@ -5411,18 +5382,6 @@ gtk_widget_set_vexpand_set
|
||||
gtk_widget_queue_compute_expand
|
||||
gtk_widget_compute_expand
|
||||
|
||||
<SUBSECTION Templates>
|
||||
gtk_widget_init_template
|
||||
gtk_widget_class_set_template
|
||||
gtk_widget_class_set_template_from_resource
|
||||
gtk_widget_get_automated_child
|
||||
gtk_widget_class_bind_child
|
||||
gtk_widget_class_bind_child_internal
|
||||
gtk_widget_class_automate_child
|
||||
gtk_widget_class_bind_callback
|
||||
gtk_widget_class_declare_callback
|
||||
gtk_widget_class_set_connect_func
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_WIDGET
|
||||
GTK_IS_WIDGET
|
||||
@@ -5554,7 +5513,6 @@ gtk_window_get_resize_grip_area
|
||||
gtk_window_get_application
|
||||
gtk_window_set_application
|
||||
gtk_window_set_has_user_ref_count
|
||||
gtk_window_set_titlebar
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_WINDOW
|
||||
@@ -7279,8 +7237,6 @@ gtk_grid_attach_next_to
|
||||
gtk_grid_get_child_at
|
||||
gtk_grid_insert_row
|
||||
gtk_grid_insert_column
|
||||
gtk_grid_remove_row
|
||||
gtk_grid_remove_column
|
||||
gtk_grid_insert_next_to
|
||||
gtk_grid_set_row_homogeneous
|
||||
gtk_grid_get_row_homogeneous
|
||||
@@ -7538,59 +7494,3 @@ GTK_COLOR_CHOOSER_DIALOG_GET_CLASS
|
||||
GtkColorChooserDialogPrivate
|
||||
gtk_color_chooser_dialog_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkheaderbar</FILE>
|
||||
<TITLE>GtkHeaderBar</TITLE>
|
||||
GtkHeaderBar
|
||||
gtk_header_bar_new
|
||||
gtk_header_bar_set_title
|
||||
gtk_header_bar_get_title
|
||||
gtk_header_bar_set_subtitle
|
||||
gtk_header_bar_get_subtitle
|
||||
gtk_header_bar_set_custom_title
|
||||
gtk_header_bar_get_custom_title
|
||||
gtk_header_bar_pack_start
|
||||
gtk_header_bar_pack_end
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_HEADER_BAR
|
||||
GTK_HEADER_BAR
|
||||
GTK_HEADER_BAR_CLASS
|
||||
GTK_IS_HEADER_BAR
|
||||
GTK_IS_HEADER_BAR_CLASS
|
||||
GTK_HEADER_BAR_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_header_bar_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkstack</FILE>
|
||||
<TITLE>GtkStack</TITLE>
|
||||
GtkStack
|
||||
gtk_stack_new
|
||||
gtk_stack_add_named
|
||||
gtk_stack_add_titled
|
||||
gtk_stack_set_visible_child
|
||||
gtk_stack_get_visible_child
|
||||
gtk_stack_set_visible_child_name
|
||||
gtk_stack_get_visible_child_name
|
||||
gtk_stack_set_visible_child_full
|
||||
gtk_stack_set_homogeneous
|
||||
gtk_stack_get_homogeneous
|
||||
gtk_stack_set_transition_duration
|
||||
gtk_stack_get_transition_duration
|
||||
GtkStackTransitionType
|
||||
gtk_stack_set_transition_type
|
||||
gtk_stack_get_transition_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkstackswitcher</FILE>
|
||||
<TITLE>GtkStackSwitcher</TITLE>
|
||||
GtkStackSwitcher
|
||||
gtk_stack_switcher_new
|
||||
gtk_stack_switcher_set_stack
|
||||
gtk_stack_switcher_get_stack
|
||||
</SECTION>
|
||||
|
||||
@@ -119,7 +119,7 @@ gtk_page_setup_get_type
|
||||
@DISABLE_ON_W32@gtk_page_setup_unix_dialog_get_type
|
||||
gtk_paned_get_type
|
||||
gtk_paper_size_get_type
|
||||
@DISABLE_ON_W32@@DISABLE_ON_QUARTZ@@DISABLE_ON_WAYLAND@gtk_plug_get_type
|
||||
@DISABLE_ON_W32@@DISABLE_ON_QUARTZ@gtk_plug_get_type
|
||||
@DISABLE_ON_W32@gtk_printer_get_type
|
||||
gtk_print_context_get_type
|
||||
@DISABLE_ON_W32@gtk_print_job_get_type
|
||||
@@ -151,7 +151,7 @@ gtk_separator_menu_item_get_type
|
||||
gtk_separator_tool_item_get_type
|
||||
gtk_settings_get_type
|
||||
gtk_size_group_get_type
|
||||
@DISABLE_ON_W32@@DISABLE_ON_QUARTZ@@DISABLE_ON_WAYLAND@gtk_socket_get_type
|
||||
@DISABLE_ON_W32@@DISABLE_ON_QUARTZ@gtk_socket_get_type
|
||||
gtk_spin_button_get_type
|
||||
gtk_spinner_get_type
|
||||
gtk_statusbar_get_type
|
||||
|
||||
@@ -461,9 +461,6 @@ nevertheless.
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
Since 3.10, this environment variable can contain a comma-separated list
|
||||
of backend names, which are tried in order. The list may also contain
|
||||
a *, which means: try all remaining backends.
|
||||
For more information about selecting backends, see the gdk_display_manager_get() function.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
@@ -153,7 +153,7 @@ You can change the default attributes for a given #GtkTextView, and you can
|
||||
apply tags that change the attributes for a region of text. For text features
|
||||
that come from the theme — such as font and foreground color — use
|
||||
standard #GtkWidget functions such as gtk_widget_modify_font() or
|
||||
gtk_widget_override_color(). For other attributes there are dedicated methods on
|
||||
gtk_widget_override_text(). For other attributes there are dedicated methods on
|
||||
#GtkTextView such as gtk_text_view_set_tabs().
|
||||
|
||||
<informalexample><programlisting>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<refentry id="gtk-wayland">
|
||||
<refentry id="gtk-osx">
|
||||
<refmeta>
|
||||
<refentrytitle>Using GTK+ with Wayland</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
|
||||
@@ -34,29 +34,6 @@ change_fullscreen_state (GSimpleAction *action,
|
||||
g_simple_action_set_state (action, state);
|
||||
}
|
||||
|
||||
static void
|
||||
change_busy_state (GSimpleAction *action,
|
||||
GVariant *state,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkWindow *window = user_data;
|
||||
GApplication *application = G_APPLICATION (gtk_window_get_application (window));
|
||||
|
||||
/* do this twice to test multiple busy counter increases */
|
||||
if (g_variant_get_boolean (state))
|
||||
{
|
||||
g_application_mark_busy (application);
|
||||
g_application_mark_busy (application);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_application_unmark_busy (application);
|
||||
g_application_unmark_busy (application);
|
||||
}
|
||||
|
||||
g_simple_action_set_state (action, state);
|
||||
}
|
||||
|
||||
static void
|
||||
change_justify_state (GSimpleAction *action,
|
||||
GVariant *state,
|
||||
@@ -117,7 +94,6 @@ static GActionEntry win_entries[] = {
|
||||
{ "copy", window_copy, NULL, NULL, NULL },
|
||||
{ "paste", window_paste, NULL, NULL, NULL },
|
||||
{ "fullscreen", activate_toggle, NULL, "false", change_fullscreen_state },
|
||||
{ "busy", activate_toggle, NULL, "false", change_busy_state },
|
||||
{ "justify", activate_radio, "s", "'left'", change_justify_state }
|
||||
};
|
||||
|
||||
@@ -380,10 +356,6 @@ bloat_pad_startup (GApplication *application)
|
||||
" <attribute name='action'>win.fullscreen</attribute>"
|
||||
" <attribute name='accel'>F11</attribute>"
|
||||
" </item>"
|
||||
" <item>"
|
||||
" <attribute name='label' translatable='yes'>_Look Busy</attribute>"
|
||||
" <attribute name='action'>win.busy</attribute>"
|
||||
" </item>"
|
||||
" </section>"
|
||||
" </submenu>"
|
||||
" <submenu id='time-menu'>"
|
||||
|
||||
@@ -134,7 +134,6 @@ gdk_c_sources = \
|
||||
gdkframeclockidle.c \
|
||||
gdkpango.c \
|
||||
gdkpixbuf-drawable.c \
|
||||
gdkproperty.c \
|
||||
gdkrectangle.c \
|
||||
gdkrgba.c \
|
||||
gdkscreen.c \
|
||||
|
||||
@@ -60,7 +60,9 @@ libgdk_broadway_la_SOURCES = \
|
||||
gdkeventsource.c \
|
||||
gdkeventsource.h \
|
||||
gdkglobals-broadway.c \
|
||||
gdkim-broadway.c \
|
||||
gdkkeys-broadway.c \
|
||||
gdkmain-broadway.c \
|
||||
gdkproperty-broadway.c \
|
||||
gdkscreen-broadway.c \
|
||||
gdkscreen-broadway.h \
|
||||
@@ -81,7 +83,7 @@ broadwayd_SOURCES = \
|
||||
broadway-output.h \
|
||||
broadway-output.c
|
||||
|
||||
broadwayd_LDADD = $(GDK_DEP_LIBS) -lrt -lcrypt
|
||||
broadwayd_LDADD = $(GDK_DEP_LIBS) -lrt
|
||||
|
||||
MAINTAINERCLEANFILES = $(broadway_built_sources)
|
||||
EXTRA_DIST += $(broadway_built_sources)
|
||||
|
||||
@@ -317,13 +317,6 @@ broadway_output_get_next_serial (BroadwayOutput *output)
|
||||
return output->serial;
|
||||
}
|
||||
|
||||
void
|
||||
broadway_output_set_next_serial (BroadwayOutput *output,
|
||||
guint32 serial)
|
||||
{
|
||||
output->serial = serial;
|
||||
}
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* Core rendering operations *
|
||||
@@ -478,24 +471,6 @@ broadway_output_new_surface(BroadwayOutput *output,
|
||||
append_bool (output, is_temp);
|
||||
}
|
||||
|
||||
void
|
||||
broadway_output_request_auth (BroadwayOutput *output)
|
||||
{
|
||||
write_header (output, BROADWAY_OP_REQUEST_AUTH);
|
||||
}
|
||||
|
||||
void
|
||||
broadway_output_auth_ok (BroadwayOutput *output)
|
||||
{
|
||||
write_header (output, BROADWAY_OP_AUTH_OK);
|
||||
}
|
||||
|
||||
void
|
||||
broadway_output_disconnected (BroadwayOutput *output)
|
||||
{
|
||||
write_header (output, BROADWAY_OP_DISCONNECTED);
|
||||
}
|
||||
|
||||
void
|
||||
broadway_output_show_surface(BroadwayOutput *output, int id)
|
||||
{
|
||||
|
||||
@@ -23,8 +23,6 @@ BroadwayOutput *broadway_output_new (GOutputStream *out,
|
||||
void broadway_output_free (BroadwayOutput *output);
|
||||
int broadway_output_flush (BroadwayOutput *output);
|
||||
int broadway_output_has_error (BroadwayOutput *output);
|
||||
void broadway_output_set_next_serial (BroadwayOutput *output,
|
||||
guint32 serial);
|
||||
guint32 broadway_output_get_next_serial (BroadwayOutput *output);
|
||||
void broadway_output_new_surface (BroadwayOutput *output,
|
||||
int id,
|
||||
@@ -33,9 +31,6 @@ void broadway_output_new_surface (BroadwayOutput *output,
|
||||
int w,
|
||||
int h,
|
||||
gboolean is_temp);
|
||||
void broadway_output_request_auth (BroadwayOutput *output);
|
||||
void broadway_output_auth_ok (BroadwayOutput *output);
|
||||
void broadway_output_disconnected (BroadwayOutput *output);
|
||||
void broadway_output_show_surface (BroadwayOutput *output,
|
||||
int id);
|
||||
void broadway_output_hide_surface (BroadwayOutput *output,
|
||||
|
||||
@@ -36,9 +36,6 @@ typedef enum {
|
||||
BROADWAY_OP_SET_TRANSIENT_FOR = 'p',
|
||||
BROADWAY_OP_PUT_RGB = 'i',
|
||||
BROADWAY_OP_FLUSH = 'f',
|
||||
BROADWAY_OP_REQUEST_AUTH = 'l',
|
||||
BROADWAY_OP_AUTH_OK = 'L',
|
||||
BROADWAY_OP_DISCONNECTED = 'D',
|
||||
} BroadwayOpType;
|
||||
|
||||
typedef struct {
|
||||
@@ -163,7 +160,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
BroadwayRequestBase base;
|
||||
guint32 id;
|
||||
char name[36];
|
||||
char name[34];
|
||||
guint32 width;
|
||||
guint32 height;
|
||||
} BroadwayRequestUpdate;
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
#include "broadway-output.h"
|
||||
|
||||
#define _XOPEN_SOURCE /* for crypt */
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib/gprintf.h>
|
||||
#include "gdktypes.h"
|
||||
@@ -11,10 +9,6 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <crypt.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
@@ -25,7 +19,6 @@ typedef struct BroadwayWindow BroadwayWindow;
|
||||
struct _BroadwayServer {
|
||||
GObject parent_instance;
|
||||
|
||||
char *password;
|
||||
char *address;
|
||||
int port;
|
||||
GSocketService *service;
|
||||
@@ -76,7 +69,6 @@ typedef struct HttpRequest {
|
||||
|
||||
struct BroadwayInput {
|
||||
BroadwayServer *server;
|
||||
BroadwayOutput *output;
|
||||
GSocketConnection *connection;
|
||||
GByteArray *buffer;
|
||||
GSource *source;
|
||||
@@ -84,7 +76,6 @@ struct BroadwayInput {
|
||||
gint64 time_base;
|
||||
gboolean proto_v7_plus;
|
||||
gboolean binary;
|
||||
gboolean active;
|
||||
};
|
||||
|
||||
struct BroadwayWindow {
|
||||
@@ -99,9 +90,6 @@ struct BroadwayWindow {
|
||||
gint32 transient_for;
|
||||
|
||||
cairo_surface_t *last_surface;
|
||||
|
||||
char *cached_surface_name;
|
||||
cairo_surface_t *cached_surface;
|
||||
};
|
||||
|
||||
static void broadway_server_resync_windows (BroadwayServer *server);
|
||||
@@ -112,8 +100,6 @@ static void
|
||||
broadway_server_init (BroadwayServer *server)
|
||||
{
|
||||
BroadwayWindow *root;
|
||||
char *passwd_file;
|
||||
char *password, *p;
|
||||
|
||||
server->service = g_socket_service_new ();
|
||||
server->pointer_grab_window_id = -1;
|
||||
@@ -122,22 +108,6 @@ broadway_server_init (BroadwayServer *server)
|
||||
server->id_ht = g_hash_table_new (NULL, NULL);
|
||||
server->id_counter = 0;
|
||||
|
||||
passwd_file = g_build_filename (g_get_user_config_dir (),
|
||||
"broadway.passwd", NULL);
|
||||
|
||||
if (g_file_get_contents (passwd_file,
|
||||
&password, NULL, NULL))
|
||||
{
|
||||
p = strchr (password, '\n');
|
||||
if (p)
|
||||
*p = 0;
|
||||
g_strstrip (password);
|
||||
if (strlen (password) > 3)
|
||||
server->password = password;
|
||||
else
|
||||
g_free (password);
|
||||
}
|
||||
|
||||
root = g_new0 (BroadwayWindow, 1);
|
||||
root->id = server->id_counter++;
|
||||
root->width = 1024;
|
||||
@@ -169,7 +139,7 @@ broadway_server_class_init (BroadwayServerClass * class)
|
||||
object_class->finalize = broadway_server_finalize;
|
||||
}
|
||||
|
||||
static void start (BroadwayInput *input);
|
||||
static void start_output (HttpRequest *request, gboolean proto_v7_plus, gboolean binary);
|
||||
|
||||
static void
|
||||
http_request_free (HttpRequest *request)
|
||||
@@ -379,14 +349,6 @@ update_future_pointer_info (BroadwayServer *server, BroadwayInputPointerMsg *dat
|
||||
server->future_mouse_in_toplevel = data->mouse_window_id;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
verify_password (BroadwayServer *server, const char *password)
|
||||
{
|
||||
char *hash;
|
||||
hash = crypt (password, server->password);
|
||||
return strcmp (hash, server->password) == 0;
|
||||
}
|
||||
|
||||
static void
|
||||
parse_input_message (BroadwayInput *input, const char *message)
|
||||
{
|
||||
@@ -395,22 +357,6 @@ parse_input_message (BroadwayInput *input, const char *message)
|
||||
char *p;
|
||||
gint64 time_;
|
||||
|
||||
if (!input->active)
|
||||
{
|
||||
/* The input has not been activated yet, handle auth/start */
|
||||
|
||||
if (message[0] != 'l' ||
|
||||
!verify_password (server, message+1))
|
||||
{
|
||||
broadway_output_request_auth (input->output);
|
||||
broadway_output_flush (input->output);
|
||||
}
|
||||
else
|
||||
start (input);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
memset (&msg, 0, sizeof (msg));
|
||||
|
||||
p = (char *)message;
|
||||
@@ -624,7 +570,7 @@ parse_input (BroadwayInput *input)
|
||||
}
|
||||
break;
|
||||
case BROADWAY_WS_CNX_PING:
|
||||
broadway_output_pong (input->output);
|
||||
broadway_output_pong (server->output);
|
||||
break;
|
||||
case BROADWAY_WS_CNX_PONG:
|
||||
break; /* we never send pings, but tolerate pongs */
|
||||
@@ -650,8 +596,7 @@ parse_input (BroadwayInput *input)
|
||||
|
||||
if (buf[0] != 0)
|
||||
{
|
||||
if (server->input == input)
|
||||
server->input = NULL;
|
||||
server->input = NULL;
|
||||
broadway_input_free (input);
|
||||
return;
|
||||
}
|
||||
@@ -668,8 +613,7 @@ parse_input (BroadwayInput *input)
|
||||
|
||||
if (len > 0 && buf[0] != 0)
|
||||
{
|
||||
if (server->input == input)
|
||||
server->input = NULL;
|
||||
server->input = NULL;
|
||||
broadway_input_free (input);
|
||||
break;
|
||||
}
|
||||
@@ -696,16 +640,19 @@ queue_process_input_at_idle (BroadwayServer *server)
|
||||
}
|
||||
|
||||
static void
|
||||
broadway_server_read_all_input_nonblocking (BroadwayInput *input)
|
||||
broadway_server_read_all_input_nonblocking (BroadwayServer *server)
|
||||
{
|
||||
GInputStream *in;
|
||||
gssize res;
|
||||
guint8 buffer[1024];
|
||||
GError *error;
|
||||
BroadwayInput *input;
|
||||
|
||||
if (input == NULL)
|
||||
if (server->input == NULL)
|
||||
return;
|
||||
|
||||
input = server->input;
|
||||
|
||||
in = g_io_stream_get_input_stream (G_IO_STREAM (input->connection));
|
||||
|
||||
error = NULL;
|
||||
@@ -721,8 +668,7 @@ broadway_server_read_all_input_nonblocking (BroadwayInput *input)
|
||||
return;
|
||||
}
|
||||
|
||||
if (input->server->input == input)
|
||||
input->server->input = NULL;
|
||||
server->input = NULL;
|
||||
broadway_input_free (input);
|
||||
if (res < 0)
|
||||
{
|
||||
@@ -740,7 +686,7 @@ broadway_server_read_all_input_nonblocking (BroadwayInput *input)
|
||||
static void
|
||||
broadway_server_consume_all_input (BroadwayServer *server)
|
||||
{
|
||||
broadway_server_read_all_input_nonblocking (server->input);
|
||||
broadway_server_read_all_input_nonblocking (server);
|
||||
|
||||
/* Since we're parsing input but not processing the resulting messages
|
||||
we might not get a readable callback on the stream, so queue an idle to
|
||||
@@ -755,10 +701,9 @@ input_data_cb (GObject *stream,
|
||||
{
|
||||
BroadwayServer *server = input->server;
|
||||
|
||||
broadway_server_read_all_input_nonblocking (input);
|
||||
broadway_server_read_all_input_nonblocking (server);
|
||||
|
||||
if (input->active)
|
||||
process_input_messages (server);
|
||||
process_input_messages (server);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -933,14 +878,15 @@ start_input (HttpRequest *request, gboolean binary)
|
||||
gsize len;
|
||||
GChecksum *checksum;
|
||||
char *origin, *host;
|
||||
BroadwayServer *server;
|
||||
BroadwayInput *input;
|
||||
const void *data_buffer;
|
||||
gsize data_buffer_size;
|
||||
GInputStream *in;
|
||||
char *key_v7;
|
||||
gboolean proto_v7_plus;
|
||||
GSocket *socket;
|
||||
int flag = 1;
|
||||
|
||||
server = request->server;
|
||||
|
||||
#ifdef DEBUG_WEBSOCKETS
|
||||
g_print ("incoming request:\n%s\n", request->request->str);
|
||||
@@ -1087,11 +1033,15 @@ start_input (HttpRequest *request, gboolean binary)
|
||||
proto_v7_plus = FALSE;
|
||||
}
|
||||
|
||||
socket = g_socket_connection_get_socket (request->connection);
|
||||
setsockopt (g_socket_get_fd (socket), IPPROTO_TCP,
|
||||
TCP_NODELAY, (char *) &flag, sizeof(int));
|
||||
|
||||
if (server->input != NULL)
|
||||
{
|
||||
broadway_input_free (server->input);
|
||||
server->input = NULL;
|
||||
}
|
||||
|
||||
input = g_new0 (BroadwayInput, 1);
|
||||
|
||||
input->server = request->server;
|
||||
input->connection = g_object_ref (request->connection);
|
||||
input->proto_v7_plus = proto_v7_plus;
|
||||
@@ -1101,9 +1051,9 @@ start_input (HttpRequest *request, gboolean binary)
|
||||
input->buffer = g_byte_array_sized_new (data_buffer_size);
|
||||
g_byte_array_append (input->buffer, data_buffer, data_buffer_size);
|
||||
|
||||
input->output =
|
||||
broadway_output_new (g_io_stream_get_output_stream (G_IO_STREAM (request->connection)),
|
||||
0, proto_v7_plus, binary);
|
||||
server->input = input;
|
||||
|
||||
start_output (request, proto_v7_plus, binary);
|
||||
|
||||
/* This will free and close the data input stream, but we got all the buffered content already */
|
||||
http_request_free (request);
|
||||
@@ -1113,53 +1063,35 @@ start_input (HttpRequest *request, gboolean binary)
|
||||
g_source_set_callback (input->source, (GSourceFunc)input_data_cb, input, NULL);
|
||||
g_source_attach (input->source, NULL);
|
||||
|
||||
if (input->server->password)
|
||||
{
|
||||
broadway_output_request_auth (input->output);
|
||||
broadway_output_flush (input->output);
|
||||
}
|
||||
else
|
||||
start (input);
|
||||
|
||||
/* Process any data in the pipe already */
|
||||
parse_input (input);
|
||||
process_input_messages (server);
|
||||
|
||||
g_strfreev (lines);
|
||||
}
|
||||
|
||||
static void
|
||||
start (BroadwayInput *input)
|
||||
start_output (HttpRequest *request, gboolean proto_v7_plus, gboolean binary)
|
||||
{
|
||||
GSocket *socket;
|
||||
BroadwayServer *server;
|
||||
int flag = 1;
|
||||
|
||||
input->active = TRUE;
|
||||
socket = g_socket_connection_get_socket (request->connection);
|
||||
setsockopt(g_socket_get_fd (socket), IPPROTO_TCP,
|
||||
TCP_NODELAY, (char *) &flag, sizeof(int));
|
||||
|
||||
server = BROADWAY_SERVER (input->server);
|
||||
|
||||
if (server->output)
|
||||
{
|
||||
broadway_output_disconnected (server->output);
|
||||
broadway_output_flush (server->output);
|
||||
}
|
||||
|
||||
if (server->input != NULL)
|
||||
{
|
||||
broadway_input_free (server->input);
|
||||
server->input = NULL;
|
||||
}
|
||||
|
||||
server->input = input;
|
||||
server = BROADWAY_SERVER (request->server);
|
||||
|
||||
if (server->output)
|
||||
{
|
||||
server->saved_serial = broadway_output_get_next_serial (server->output);
|
||||
broadway_output_free (server->output);
|
||||
}
|
||||
server->output = input->output;
|
||||
|
||||
broadway_output_set_next_serial (server->output, server->saved_serial);
|
||||
broadway_output_auth_ok (server->output);
|
||||
broadway_output_flush (server->output);
|
||||
server->output =
|
||||
broadway_output_new (g_io_stream_get_output_stream (G_IO_STREAM (request->connection)),
|
||||
server->saved_serial, proto_v7_plus, binary);
|
||||
|
||||
broadway_server_resync_windows (server);
|
||||
|
||||
@@ -1167,8 +1099,6 @@ start (BroadwayInput *input)
|
||||
broadway_output_grab_pointer (server->output,
|
||||
server->pointer_grab_window_id,
|
||||
server->pointer_grab_owner_events);
|
||||
|
||||
process_input_messages (server);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1419,12 +1349,6 @@ broadway_server_destroy_window (BroadwayServer *server,
|
||||
server->toplevels = g_list_remove (server->toplevels, window);
|
||||
g_hash_table_remove (server->id_ht,
|
||||
GINT_TO_POINTER (id));
|
||||
|
||||
if (window->cached_surface_name != NULL)
|
||||
g_free (window->cached_surface_name);
|
||||
if (window->cached_surface != NULL)
|
||||
cairo_surface_destroy (window->cached_surface);
|
||||
|
||||
g_free (window);
|
||||
}
|
||||
}
|
||||
@@ -1659,11 +1583,6 @@ broadway_server_window_update (BroadwayServer *server,
|
||||
window->width,
|
||||
window->height);
|
||||
|
||||
g_assert (window->width == cairo_image_surface_get_width (window->last_surface));
|
||||
g_assert (window->width == cairo_image_surface_get_width (surface));
|
||||
g_assert (window->height == cairo_image_surface_get_height (window->last_surface));
|
||||
g_assert (window->height == cairo_image_surface_get_height (surface));
|
||||
|
||||
if (server->output != NULL)
|
||||
{
|
||||
if (window->last_synced)
|
||||
@@ -1820,86 +1739,6 @@ broadway_server_ungrab_pointer (BroadwayServer *server,
|
||||
return serial;
|
||||
}
|
||||
|
||||
static const cairo_user_data_key_t shm_cairo_key;
|
||||
|
||||
typedef struct {
|
||||
void *data;
|
||||
gsize data_size;
|
||||
} ShmSurfaceData;
|
||||
|
||||
static void
|
||||
shm_data_unmap (void *_data)
|
||||
{
|
||||
ShmSurfaceData *data = _data;
|
||||
munmap (data->data, data->data_size);
|
||||
g_free (data);
|
||||
}
|
||||
|
||||
cairo_surface_t *
|
||||
broadway_server_open_surface (BroadwayServer *server,
|
||||
guint32 id,
|
||||
char *name,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
BroadwayWindow *window;
|
||||
ShmSurfaceData *data;
|
||||
cairo_surface_t *surface;
|
||||
gsize size;
|
||||
void *ptr;
|
||||
int fd;
|
||||
|
||||
window = g_hash_table_lookup (server->id_ht,
|
||||
GINT_TO_POINTER (id));
|
||||
if (window == NULL)
|
||||
return NULL;
|
||||
|
||||
if (window->cached_surface_name != NULL &&
|
||||
strcmp (name, window->cached_surface_name) == 0)
|
||||
return cairo_surface_reference (window->cached_surface);
|
||||
|
||||
size = width * height * sizeof (guint32);
|
||||
|
||||
fd = shm_open(name, O_RDONLY, 0600);
|
||||
if (fd == -1)
|
||||
{
|
||||
perror ("Failed to shm_open");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ptr = mmap(0, size, PROT_READ, MAP_SHARED, fd, 0);
|
||||
(void) close(fd);
|
||||
|
||||
shm_unlink (name);
|
||||
|
||||
if (ptr == NULL)
|
||||
return NULL;
|
||||
|
||||
data = g_new0 (ShmSurfaceData, 1);
|
||||
|
||||
data->data = ptr;
|
||||
data->data_size = size;
|
||||
|
||||
surface = cairo_image_surface_create_for_data ((guchar *)data->data,
|
||||
CAIRO_FORMAT_RGB24,
|
||||
width, height,
|
||||
width * sizeof (guint32));
|
||||
g_assert (surface != NULL);
|
||||
|
||||
cairo_surface_set_user_data (surface, &shm_cairo_key,
|
||||
data, shm_data_unmap);
|
||||
|
||||
if (window->cached_surface_name != NULL)
|
||||
g_free (window->cached_surface_name);
|
||||
window->cached_surface_name = g_strdup (name);
|
||||
|
||||
if (window->cached_surface != NULL)
|
||||
cairo_surface_destroy (window->cached_surface);
|
||||
window->cached_surface = cairo_surface_reference (surface);
|
||||
|
||||
return surface;
|
||||
}
|
||||
|
||||
guint32
|
||||
broadway_server_new_window (BroadwayServer *server,
|
||||
int x,
|
||||
|
||||
@@ -78,10 +78,5 @@ gboolean broadway_server_window_move_resize (BroadwayServer *
|
||||
int y,
|
||||
int width,
|
||||
int height);
|
||||
cairo_surface_t * broadway_server_open_surface (BroadwayServer *server,
|
||||
guint32 id,
|
||||
char *name,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
#endif /* __BROADWAY_SERVER__ */
|
||||
|
||||
@@ -225,16 +225,34 @@ function flushSurface(surface)
|
||||
context.save();
|
||||
context.beginPath();
|
||||
|
||||
var minx;
|
||||
var miny;
|
||||
var maxx;
|
||||
var maxy;
|
||||
for (var j = 0; j < cmd.rects.length; j++) {
|
||||
var rect = cmd.rects[j];
|
||||
context.rect(rect.x, rect.y, rect.w, rect.h);
|
||||
if (j == 0) {
|
||||
minx = rect.x;
|
||||
miny = rect.y;
|
||||
maxx = rect.x + rect.w;
|
||||
maxy = rect.y + rect.h;
|
||||
} else {
|
||||
if (rect.x < minx)
|
||||
minx = rect.x;
|
||||
if (rect.y < miny)
|
||||
miny = rect.y;
|
||||
if (rect.x + rect.w > maxx)
|
||||
maxx = rect.x + rect.w;
|
||||
if (rect.y + rect.h > maxy)
|
||||
maxy = rect.y + rect.h;
|
||||
}
|
||||
}
|
||||
context.clip();
|
||||
// This seems to break chrome when src overlaps dest
|
||||
// But source-over should be fine for rgb surfaces anyway
|
||||
//context.globalCompositeOperation = "copy";
|
||||
context.drawImage(surface.canvas,
|
||||
cmd.dx, cmd.dy);
|
||||
context.globalCompositeOperation = "copy";
|
||||
context.drawImage(context.canvas,
|
||||
minx - cmd.dx, miny - cmd.dy, maxx - minx, maxy - miny,
|
||||
minx, miny, maxx - minx, maxy - miny);
|
||||
context.restore();
|
||||
break;
|
||||
|
||||
@@ -478,6 +496,12 @@ function cmdMoveResizeSurface(id, has_pos, x, y, has_size, w, h)
|
||||
var xOffset = surface.x;
|
||||
var yOffset = surface.y;
|
||||
|
||||
var transientToplevel = getTransientToplevel(surface);
|
||||
if (transientToplevel) {
|
||||
xOffset = surface.x - transientToplevel.x;
|
||||
yOffset = surface.y - transientToplevel.y;
|
||||
}
|
||||
|
||||
var element = surface.canvas;
|
||||
if (surface.frame) {
|
||||
element = surface.frame;
|
||||
@@ -519,21 +543,6 @@ function handleCommands(cmd)
|
||||
var command = cmd.get_char();
|
||||
lastSerial = cmd.get_32();
|
||||
switch (command) {
|
||||
case 'l':
|
||||
login ();
|
||||
break;
|
||||
|
||||
case 'L':
|
||||
if (loginDiv != null)
|
||||
loginDiv.parentNode.removeChild(loginDiv);
|
||||
start ();
|
||||
break;
|
||||
|
||||
case 'D':
|
||||
alert ("disconnected");
|
||||
inputSocket = null;
|
||||
break;
|
||||
|
||||
case 's': // create new surface
|
||||
id = cmd.get_16();
|
||||
x = cmd.get_16s();
|
||||
@@ -733,12 +742,8 @@ BinCommands.prototype.get_32 = function() {
|
||||
};
|
||||
BinCommands.prototype.get_image_url = function() {
|
||||
var size = this.get_32();
|
||||
var png_blob = new Blob ([new Uint8Array (this.arraybuffer, this.pos, size)], {type:"image/png"});
|
||||
var url;
|
||||
if (window.webkitURL)
|
||||
url = window.webkitURL.createObjectURL(png_blob);
|
||||
else
|
||||
url = window.URL.createObjectURL(png_blob, {oneTimeOnly: true});
|
||||
var png_blob = new Blob ([this.arraybuffer.slice (this.pos, this.pos + size)], {type:"image/png"});
|
||||
var url = URL.createObjectURL(png_blob, {oneTimeOnly: true});
|
||||
this.pos = this.pos + size;
|
||||
return url;
|
||||
};
|
||||
@@ -2585,7 +2590,7 @@ function onMouseWheel(ev)
|
||||
var id = getSurfaceId(ev);
|
||||
var pos = getPositionsFromEvent(ev, id);
|
||||
|
||||
var offset = ev.detail ? ev.detail : -ev.wheelDelta;
|
||||
var offset = ev.detail ? ev.detail : ev.wheelDelta;
|
||||
var dir = 0;
|
||||
if (offset > 0)
|
||||
dir = 1;
|
||||
@@ -2626,47 +2631,6 @@ function newWS(loc) {
|
||||
return ws;
|
||||
}
|
||||
|
||||
function start()
|
||||
{
|
||||
setupDocument(document);
|
||||
|
||||
var w, h;
|
||||
w = window.innerWidth;
|
||||
h = window.innerHeight;
|
||||
window.onresize = function(ev) {
|
||||
var w, h;
|
||||
w = window.innerWidth;
|
||||
h = window.innerHeight;
|
||||
sendInput ("d", [w, h]);
|
||||
};
|
||||
sendInput ("d", [w, h]);
|
||||
}
|
||||
|
||||
var loginDiv = null;
|
||||
function login()
|
||||
{
|
||||
if (loginDiv == null) {
|
||||
var div = document.createElement('div');
|
||||
document.body.appendChild(div);
|
||||
div.innerHTML = "Please enter password<br>";
|
||||
div.style.marginTop = "40px";
|
||||
div.style.textAlign = "center";
|
||||
|
||||
var input = document.createElement("input");
|
||||
input.setAttribute("type", "password");
|
||||
div.appendChild(input);
|
||||
input.focus ();
|
||||
input.onkeyup = function(e) {
|
||||
if (e.keyCode === 13 && input.value != "") {
|
||||
inputSocket.send ("l" + input.value);
|
||||
}
|
||||
}
|
||||
loginDiv = div;
|
||||
} else {
|
||||
alert ("Wrong password");
|
||||
}
|
||||
}
|
||||
|
||||
function connect()
|
||||
{
|
||||
var url = window.location.toString();
|
||||
@@ -2675,7 +2639,7 @@ function connect()
|
||||
var params = query_string[1].split("&");
|
||||
}
|
||||
|
||||
var loc = window.location.toString().replace("http:", "ws:").replace("https:", "wss:");
|
||||
var loc = window.location.toString().replace("http:", "ws:");
|
||||
loc = loc.substr(0, loc.lastIndexOf('/')) + "/socket";
|
||||
|
||||
var supports_binary = newWS (loc + "-test").binaryType == "blob";
|
||||
@@ -2688,13 +2652,23 @@ function connect()
|
||||
|
||||
ws.onopen = function() {
|
||||
inputSocket = ws;
|
||||
var w, h;
|
||||
w = window.innerWidth;
|
||||
h = window.innerHeight;
|
||||
window.onresize = function(ev) {
|
||||
var w, h;
|
||||
w = window.innerWidth;
|
||||
h = window.innerHeight;
|
||||
sendInput ("d", [w, h]);
|
||||
};
|
||||
sendInput ("d", [w, h]);
|
||||
};
|
||||
ws.onclose = function() {
|
||||
if (inputSocket != null)
|
||||
alert ("disconnected");
|
||||
inputSocket = null;
|
||||
};
|
||||
ws.onmessage = function(event) {
|
||||
handleMessage(event.data);
|
||||
};
|
||||
|
||||
setupDocument(document);
|
||||
}
|
||||
|
||||
@@ -140,6 +140,62 @@ region_from_rects (BroadwayRect *rects, int n_rects)
|
||||
return region;
|
||||
}
|
||||
|
||||
static const cairo_user_data_key_t shm_cairo_key;
|
||||
|
||||
typedef struct {
|
||||
void *data;
|
||||
gsize data_size;
|
||||
} ShmSurfaceData;
|
||||
|
||||
static void
|
||||
shm_data_unmap (void *_data)
|
||||
{
|
||||
ShmSurfaceData *data = _data;
|
||||
munmap (data->data, data->data_size);
|
||||
g_free (data);
|
||||
}
|
||||
|
||||
cairo_surface_t *
|
||||
open_surface (char *name, int width, int height)
|
||||
{
|
||||
ShmSurfaceData *data;
|
||||
cairo_surface_t *surface;
|
||||
gsize size;
|
||||
void *ptr;
|
||||
int fd;
|
||||
|
||||
size = width * height * sizeof (guint32);
|
||||
|
||||
fd = shm_open(name, O_RDONLY, 0600);
|
||||
if (fd == -1)
|
||||
{
|
||||
perror ("Failed to shm_open");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ptr = mmap(0, size, PROT_READ, MAP_SHARED, fd, 0);
|
||||
(void) close(fd);
|
||||
|
||||
if (ptr == NULL)
|
||||
return NULL;
|
||||
|
||||
data = g_new0 (ShmSurfaceData, 1);
|
||||
|
||||
data->data = ptr;
|
||||
data->data_size = size;
|
||||
|
||||
surface = cairo_image_surface_create_for_data ((guchar *)data->data,
|
||||
CAIRO_FORMAT_RGB24,
|
||||
width, height,
|
||||
width * sizeof (guint32));
|
||||
g_assert (surface != NULL);
|
||||
|
||||
cairo_surface_set_user_data (surface, &shm_cairo_key,
|
||||
data, shm_data_unmap);
|
||||
|
||||
return surface;
|
||||
}
|
||||
|
||||
void
|
||||
add_client_serial_mapping (BroadwayClient *client,
|
||||
guint32 client_serial,
|
||||
@@ -281,11 +337,9 @@ client_handle_request (BroadwayClient *client,
|
||||
cairo_region_destroy (area);
|
||||
break;
|
||||
case BROADWAY_REQUEST_UPDATE:
|
||||
surface = broadway_server_open_surface (server,
|
||||
request->update.id,
|
||||
request->update.name,
|
||||
request->update.width,
|
||||
request->update.height);
|
||||
surface = open_surface (request->update.name,
|
||||
request->update.width,
|
||||
request->update.height);
|
||||
if (surface != NULL)
|
||||
{
|
||||
broadway_server_window_update (server,
|
||||
@@ -355,6 +409,7 @@ client_fill_cb (GObject *source_object,
|
||||
guint32 size;
|
||||
gsize count, remaining;
|
||||
guint8 *buffer;
|
||||
BroadwayRequest request;
|
||||
|
||||
buffer = (guint8 *)g_buffered_input_stream_peek_buffer (client->in, &count);
|
||||
|
||||
@@ -362,10 +417,14 @@ client_fill_cb (GObject *source_object,
|
||||
while (remaining >= sizeof (guint32))
|
||||
{
|
||||
memcpy (&size, buffer, sizeof (guint32));
|
||||
|
||||
|
||||
if (size <= remaining)
|
||||
{
|
||||
client_handle_request (client, (BroadwayRequest *)buffer);
|
||||
g_assert (size >= sizeof (BroadwayRequestBase));
|
||||
g_assert (size <= sizeof (BroadwayRequest));
|
||||
|
||||
memcpy (&request, buffer, size);
|
||||
client_handle_request (client, &request);
|
||||
|
||||
remaining -= size;
|
||||
buffer += size;
|
||||
|
||||
@@ -506,7 +506,7 @@ make_valid_fs_char (char c)
|
||||
{
|
||||
char chars[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890";
|
||||
|
||||
return chars[c % (sizeof (chars) - 1)];
|
||||
return chars[c % sizeof (chars)];
|
||||
}
|
||||
|
||||
/* name must have at least space for 34 bytes */
|
||||
@@ -550,7 +550,7 @@ create_random_shm (char *name)
|
||||
static const cairo_user_data_key_t gdk_broadway_shm_cairo_key;
|
||||
|
||||
typedef struct {
|
||||
char name[36];
|
||||
char name[34];
|
||||
void *data;
|
||||
gsize data_size;
|
||||
} BroadwayShmSurfaceData;
|
||||
@@ -582,13 +582,6 @@ _gdk_broadway_server_create_surface (int width,
|
||||
res = ftruncate (fd, data->data_size);
|
||||
g_assert (res != -1);
|
||||
|
||||
res = posix_fallocate (fd, 0, data->data_size);
|
||||
if (res != 0)
|
||||
{
|
||||
shm_unlink (data->name);
|
||||
g_error ("Not enough shared memory for window surface");
|
||||
}
|
||||
|
||||
data->data = mmap(0, data->data_size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
|
||||
(void) close(fd);
|
||||
|
||||
@@ -617,7 +610,7 @@ _gdk_broadway_server_window_update (GdkBroadwayServer *server,
|
||||
g_assert (data != NULL);
|
||||
|
||||
msg.id = id;
|
||||
memcpy (msg.name, data->name, 36);
|
||||
memcpy (msg.name, data->name, 34);
|
||||
msg.width = cairo_image_surface_get_width (surface);
|
||||
msg.height = cairo_image_surface_get_height (surface);
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ gdk_broadway_device_get_state (GdkDevice *device,
|
||||
{
|
||||
gint x_int, y_int;
|
||||
|
||||
gdk_window_get_device_position (window, device, &x_int, &y_int, mask);
|
||||
gdk_window_get_pointer (window, &x_int, &y_int, mask);
|
||||
|
||||
if (axes)
|
||||
{
|
||||
@@ -188,7 +188,7 @@ gdk_broadway_device_query_state (GdkDevice *device,
|
||||
if (root_y)
|
||||
*root_y = device_root_y;
|
||||
if (win_x)
|
||||
*win_x = device_root_x - toplevel->x;
|
||||
*win_x = device_root_y - toplevel->x;
|
||||
if (win_y)
|
||||
*win_y = device_root_y - toplevel->y;
|
||||
if (mask)
|
||||
@@ -211,29 +211,6 @@ gdk_broadway_device_query_state (GdkDevice *device,
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_broadway_window_grab_check_unmap (GdkWindow *window,
|
||||
gulong serial)
|
||||
{
|
||||
GdkDisplay *display = gdk_window_get_display (window);
|
||||
GdkDeviceManager *device_manager;
|
||||
GList *devices, *d;
|
||||
|
||||
device_manager = gdk_display_get_device_manager (display);
|
||||
|
||||
/* Get all devices */
|
||||
devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER);
|
||||
devices = g_list_concat (devices, gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_SLAVE));
|
||||
devices = g_list_concat (devices, gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_FLOATING));
|
||||
|
||||
/* End all grabs on the newly hidden window */
|
||||
for (d = devices; d; d = d->next)
|
||||
_gdk_display_end_device_grab (display, d->data, serial, window, TRUE);
|
||||
|
||||
g_list_free (devices);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_gdk_broadway_window_grab_check_destroy (GdkWindow *window)
|
||||
{
|
||||
|
||||
@@ -55,6 +55,8 @@ G_DEFINE_TYPE (GdkBroadwayDisplay, gdk_broadway_display, GDK_TYPE_DISPLAY)
|
||||
static void
|
||||
gdk_broadway_display_init (GdkBroadwayDisplay *display)
|
||||
{
|
||||
_gdk_broadway_display_manager_add_display (gdk_display_manager_get (),
|
||||
GDK_DISPLAY_OBJECT (display));
|
||||
display->id_ht = g_hash_table_new (NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -171,6 +173,7 @@ _gdk_broadway_display_open (const gchar *display_name)
|
||||
}
|
||||
|
||||
g_signal_emit_by_name (display, "opened");
|
||||
g_signal_emit_by_name (gdk_display_manager_get (), "display-opened", display);
|
||||
|
||||
return display;
|
||||
}
|
||||
@@ -183,6 +186,24 @@ gdk_broadway_display_get_name (GdkDisplay *display)
|
||||
return (gchar *) "Broadway";
|
||||
}
|
||||
|
||||
static gint
|
||||
gdk_broadway_display_get_n_screens (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), 0);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static GdkScreen *
|
||||
gdk_broadway_display_get_screen (GdkDisplay *display,
|
||||
gint screen_num)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
g_return_val_if_fail (screen_num == 0, NULL);
|
||||
|
||||
return GDK_BROADWAY_DISPLAY (display)->screens[screen_num];
|
||||
}
|
||||
|
||||
static GdkScreen *
|
||||
gdk_broadway_display_get_default_screen (GdkDisplay *display)
|
||||
{
|
||||
@@ -236,6 +257,9 @@ gdk_broadway_display_dispose (GObject *object)
|
||||
{
|
||||
GdkBroadwayDisplay *broadway_display = GDK_BROADWAY_DISPLAY (object);
|
||||
|
||||
_gdk_broadway_display_manager_remove_display (gdk_display_manager_get (),
|
||||
GDK_DISPLAY_OBJECT (object));
|
||||
|
||||
g_list_foreach (broadway_display->input_devices, (GFunc) g_object_run_dispose, NULL);
|
||||
|
||||
_gdk_screen_close (broadway_display->screens[0]);
|
||||
@@ -370,6 +394,8 @@ gdk_broadway_display_class_init (GdkBroadwayDisplayClass * class)
|
||||
display_class->window_type = GDK_TYPE_BROADWAY_WINDOW;
|
||||
|
||||
display_class->get_name = gdk_broadway_display_get_name;
|
||||
display_class->get_n_screens = gdk_broadway_display_get_n_screens;
|
||||
display_class->get_screen = gdk_broadway_display_get_screen;
|
||||
display_class->get_default_screen = gdk_broadway_display_get_default_screen;
|
||||
display_class->beep = gdk_broadway_display_beep;
|
||||
display_class->sync = gdk_broadway_display_sync;
|
||||
|
||||
@@ -66,8 +66,6 @@ struct _GdkBroadwayDisplay
|
||||
GdkWindow *active_offscreen_window;
|
||||
|
||||
GdkBroadwayServer *server;
|
||||
|
||||
gpointer move_resize_data;
|
||||
};
|
||||
|
||||
struct _GdkBroadwayDisplayClass
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "gdkdisplay-broadway.h"
|
||||
#include "gdkbroadwaydisplaymanager.h"
|
||||
#include "gdkprivate-broadway.h"
|
||||
@@ -34,63 +33,68 @@ struct _GdkBroadwayDisplayManager
|
||||
{
|
||||
GdkDisplayManager parent;
|
||||
|
||||
gboolean init_failed;
|
||||
GdkDisplay *default_display;
|
||||
GSList *displays;
|
||||
};
|
||||
|
||||
static void g_initable_iface_init (GInitableIface *iface);
|
||||
G_DEFINE_TYPE (GdkBroadwayDisplayManager, gdk_broadway_display_manager, GDK_TYPE_DISPLAY_MANAGER)
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GdkBroadwayDisplayManager, gdk_broadway_display_manager, GDK_TYPE_DISPLAY_MANAGER,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, g_initable_iface_init))
|
||||
|
||||
static gboolean
|
||||
gdk_broadway_display_manager_initable_init (GInitable *initable,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
static GdkDisplay *
|
||||
gdk_broadway_display_manager_open_display (GdkDisplayManager *manager,
|
||||
const gchar *name)
|
||||
{
|
||||
const gchar *display_name;
|
||||
gint port;
|
||||
GdkBroadwayServer *server;
|
||||
|
||||
display_name = g_getenv ("BROADWAY_DISPLAY");
|
||||
|
||||
port = 0;
|
||||
if (display_name != NULL)
|
||||
{
|
||||
if (*display_name == ':')
|
||||
display_name++;
|
||||
port = strtol(display_name, NULL, 10);
|
||||
}
|
||||
if (port == 0)
|
||||
port = 1;
|
||||
|
||||
server = _gdk_broadway_server_new (port, NULL);
|
||||
if (server == NULL)
|
||||
{
|
||||
GDK_BROADWAY_DISPLAY_MANAGER (initable)->init_failed = TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
g_object_unref (server);
|
||||
|
||||
return TRUE;
|
||||
return _gdk_broadway_display_open (name);
|
||||
}
|
||||
|
||||
void
|
||||
g_initable_iface_init (GInitableIface *iface)
|
||||
static GSList *
|
||||
gdk_broadway_display_manager_list_displays (GdkDisplayManager *manager)
|
||||
{
|
||||
iface->init = gdk_broadway_display_manager_initable_init;
|
||||
GdkBroadwayDisplayManager *manager_broadway = GDK_BROADWAY_DISPLAY_MANAGER (manager);
|
||||
|
||||
return g_slist_copy (manager_broadway->displays);
|
||||
}
|
||||
|
||||
static GdkDisplay *
|
||||
gdk_broadway_display_manager_get_default_display (GdkDisplayManager *manager)
|
||||
{
|
||||
return GDK_BROADWAY_DISPLAY_MANAGER (manager)->default_display;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_display_manager_set_default_display (GdkDisplayManager *manager,
|
||||
GdkDisplay *display)
|
||||
{
|
||||
GdkBroadwayDisplayManager *manager_broadway = GDK_BROADWAY_DISPLAY_MANAGER (manager);
|
||||
|
||||
manager_broadway->default_display = display;
|
||||
}
|
||||
|
||||
#include "../gdkkeynames.c"
|
||||
|
||||
static gchar *
|
||||
gdk_broadway_display_manager_get_keyval_name (GdkDisplayManager *manager,
|
||||
guint keyval)
|
||||
{
|
||||
return _gdk_keyval_name (keyval);
|
||||
}
|
||||
|
||||
static guint
|
||||
gdk_broadway_display_manager_lookup_keyval (GdkDisplayManager *manager,
|
||||
const gchar *name)
|
||||
{
|
||||
return _gdk_keyval_from_name (name);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_display_manager_init (GdkBroadwayDisplayManager *manager)
|
||||
{
|
||||
_gdk_broadway_windowing_init ();
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_display_manager_finalize (GObject *object)
|
||||
{
|
||||
if (!GDK_BROADWAY_DISPLAY_MANAGER (object)->init_failed)
|
||||
g_error ("A GdkBroadwayDisplayManager object was finalized. This should not happen");
|
||||
g_error ("A GdkBroadwayDisplayManager object was finalized. This should not happen");
|
||||
G_OBJECT_CLASS (gdk_broadway_display_manager_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
@@ -98,6 +102,45 @@ static void
|
||||
gdk_broadway_display_manager_class_init (GdkBroadwayDisplayManagerClass *class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
GdkDisplayManagerClass *manager_class = GDK_DISPLAY_MANAGER_CLASS (class);
|
||||
|
||||
object_class->finalize = gdk_broadway_display_manager_finalize;
|
||||
|
||||
manager_class->open_display = gdk_broadway_display_manager_open_display;
|
||||
manager_class->list_displays = gdk_broadway_display_manager_list_displays;
|
||||
manager_class->set_default_display = gdk_broadway_display_manager_set_default_display;
|
||||
manager_class->get_default_display = gdk_broadway_display_manager_get_default_display;
|
||||
manager_class->atom_intern = _gdk_broadway_display_manager_atom_intern;
|
||||
manager_class->get_atom_name = _gdk_broadway_display_manager_get_atom_name;
|
||||
manager_class->lookup_keyval = gdk_broadway_display_manager_lookup_keyval;
|
||||
manager_class->get_keyval_name = gdk_broadway_display_manager_get_keyval_name;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_broadway_display_manager_add_display (GdkDisplayManager *manager,
|
||||
GdkDisplay *display)
|
||||
{
|
||||
GdkBroadwayDisplayManager *manager_broadway = GDK_BROADWAY_DISPLAY_MANAGER (manager);
|
||||
|
||||
if (manager_broadway->displays == NULL)
|
||||
gdk_display_manager_set_default_display (manager, display);
|
||||
|
||||
manager_broadway->displays = g_slist_prepend (manager_broadway->displays, display);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_broadway_display_manager_remove_display (GdkDisplayManager *manager,
|
||||
GdkDisplay *display)
|
||||
{
|
||||
GdkBroadwayDisplayManager *manager_broadway = GDK_BROADWAY_DISPLAY_MANAGER (manager);
|
||||
|
||||
manager_broadway->displays = g_slist_remove (manager_broadway->displays, display);
|
||||
|
||||
if (manager_broadway->default_display == display)
|
||||
{
|
||||
if (manager_broadway->displays)
|
||||
gdk_display_manager_set_default_display (manager, manager_broadway->displays->data);
|
||||
else
|
||||
gdk_display_manager_set_default_display (manager, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
break;
|
||||
case BROADWAY_EVENT_GRAB_NOTIFY:
|
||||
case BROADWAY_EVENT_UNGRAB_NOTIFY:
|
||||
_gdk_display_device_grab_update (display, display->core_pointer, display->core_pointer, message->base.serial);
|
||||
_gdk_display_device_grab_update (display, display->core_pointer, NULL, message->base.serial);
|
||||
break;
|
||||
|
||||
case BROADWAY_EVENT_CONFIGURE_NOTIFY:
|
||||
@@ -256,6 +256,10 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
{
|
||||
window->x = message->configure_notify.x;
|
||||
window->y = message->configure_notify.y;
|
||||
window->width = message->configure_notify.width;
|
||||
window->height = message->configure_notify.height;
|
||||
_gdk_window_update_size (window);
|
||||
_gdk_broadway_window_resize_surface (window);
|
||||
|
||||
event = gdk_event_new (GDK_CONFIGURE);
|
||||
event->configure.window = g_object_ref (window);
|
||||
|
||||
38
gdk/broadway/gdkim-broadway.c
Normal file
38
gdk/broadway/gdkim-broadway.c
Normal file
@@ -0,0 +1,38 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
||||
* files for a list of changes. These files are distributed with
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkmain.h"
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkdisplay-broadway.h"
|
||||
|
||||
#include <locale.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
void
|
||||
_gdk_broadway_initialize_locale (void)
|
||||
{
|
||||
}
|
||||
44
gdk/broadway/gdkmain-broadway.c
Normal file
44
gdk/broadway/gdkmain-broadway.c
Normal file
@@ -0,0 +1,44 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
||||
* files for a list of changes. These files are distributed with
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkdisplay-broadway.h"
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkprivate-broadway.h"
|
||||
#include "gdkintl.h"
|
||||
#include "gdkdeviceprivate.h"
|
||||
|
||||
#include <glib/gprintf.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <limits.h>
|
||||
#include <errno.h>
|
||||
|
||||
void
|
||||
_gdk_broadway_windowing_init (void)
|
||||
{
|
||||
_gdk_broadway_initialize_locale ();
|
||||
}
|
||||
@@ -40,6 +40,20 @@
|
||||
#include "gdkbroadwaywindow.h"
|
||||
|
||||
void _gdk_broadway_resync_windows (void);
|
||||
void _gdk_broadway_windowing_init (void);
|
||||
|
||||
gchar * _gdk_broadway_display_manager_get_atom_name (GdkDisplayManager *manager,
|
||||
GdkAtom atom);
|
||||
void _gdk_broadway_display_manager_add_display (GdkDisplayManager *manager,
|
||||
GdkDisplay *display);
|
||||
void _gdk_broadway_display_manager_remove_display (GdkDisplayManager *manager,
|
||||
GdkDisplay *display);
|
||||
GdkAtom _gdk_broadway_display_manager_atom_intern_static_string (GdkDisplayManager *manager,
|
||||
const gchar *atom_name);
|
||||
GdkAtom _gdk_broadway_display_manager_atom_intern (GdkDisplayManager *manager,
|
||||
const gchar *atom_name,
|
||||
gboolean only_if_exists);
|
||||
|
||||
|
||||
void _gdk_broadway_window_register_dnd (GdkWindow *window);
|
||||
GdkDragContext * _gdk_broadway_window_drag_begin (GdkWindow *window,
|
||||
@@ -78,8 +92,6 @@ gboolean _gdk_broadway_moveresize_configure_done (GdkDisplay *display,
|
||||
|
||||
void _gdk_broadway_selection_window_destroyed (GdkWindow *window);
|
||||
void _gdk_broadway_window_grab_check_destroy (GdkWindow *window);
|
||||
void _gdk_broadway_window_grab_check_unmap (GdkWindow *window,
|
||||
gulong serial);
|
||||
|
||||
void _gdk_keymap_keys_changed (GdkDisplay *display);
|
||||
gint _gdk_broadway_get_group_for_state (GdkDisplay *display,
|
||||
@@ -89,6 +101,8 @@ void _gdk_keymap_add_virtual_modifiers_compat (GdkKeymap *keymap,
|
||||
gboolean _gdk_keymap_key_is_modifier (GdkKeymap *keymap,
|
||||
guint keycode);
|
||||
|
||||
void _gdk_broadway_initialize_locale (void);
|
||||
|
||||
void _gdk_broadway_screen_events_init (GdkScreen *screen);
|
||||
GdkVisual *_gdk_broadway_screen_get_system_visual (GdkScreen * screen);
|
||||
gint _gdk_broadway_screen_visual_get_best_depth (GdkScreen * screen);
|
||||
@@ -203,6 +217,9 @@ void _gdk_broadway_window_resize_surface (GdkWindow *window);
|
||||
void _gdk_broadway_cursor_update_theme (GdkCursor *cursor);
|
||||
void _gdk_broadway_cursor_display_finalize (GdkDisplay *display);
|
||||
|
||||
#define GDK_SCREEN_DISPLAY(screen) (GDK_BROADWAY_SCREEN (screen)->display)
|
||||
#define GDK_WINDOW_SCREEN(win) (GDK_WINDOW_IMPL_BROADWAY (((GdkWindow *)win)->impl)->screen)
|
||||
#define GDK_WINDOW_DISPLAY(win) (GDK_BROADWAY_SCREEN (GDK_WINDOW_SCREEN (win))->display)
|
||||
#define GDK_WINDOW_IS_BROADWAY(win) (GDK_IS_WINDOW_IMPL_BROADWAY (((GdkWindow *)win)->impl))
|
||||
|
||||
#endif /* __GDK_PRIVATE_BROADWAY_H__ */
|
||||
|
||||
@@ -35,6 +35,34 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
GdkAtom
|
||||
_gdk_broadway_display_manager_atom_intern (GdkDisplayManager *manager,
|
||||
const gchar *atom_name,
|
||||
gboolean only_if_exists)
|
||||
{
|
||||
return _GDK_MAKE_ATOM (g_quark_from_string (atom_name));
|
||||
}
|
||||
|
||||
GdkAtom
|
||||
_gdk_broadway_display_manager_atom_intern_static_string (GdkDisplayManager *manager,
|
||||
const gchar *atom_name)
|
||||
{
|
||||
return _GDK_MAKE_ATOM (g_quark_from_static_string (atom_name));
|
||||
}
|
||||
|
||||
static const char *
|
||||
get_atom_name (GdkAtom atom)
|
||||
{
|
||||
return g_quark_to_string (GPOINTER_TO_UINT(atom));
|
||||
}
|
||||
|
||||
gchar *
|
||||
_gdk_broadway_display_manager_get_atom_name (GdkDisplayManager *manager,
|
||||
GdkAtom atom)
|
||||
{
|
||||
return g_strdup (get_atom_name (atom));
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_broadway_window_get_property (GdkWindow *window,
|
||||
GdkAtom property,
|
||||
|
||||
@@ -83,16 +83,18 @@ G_DEFINE_TYPE (GdkWindowImplBroadway,
|
||||
gdk_window_impl_broadway,
|
||||
GDK_TYPE_WINDOW_IMPL)
|
||||
|
||||
static void
|
||||
update_dirty_windows_and_sync (void)
|
||||
static guint dirty_flush_id = 0;
|
||||
|
||||
static gboolean
|
||||
dirty_flush_idle (gpointer data)
|
||||
{
|
||||
GList *l;
|
||||
GdkBroadwayDisplay *display;
|
||||
gboolean updated_surface;
|
||||
|
||||
dirty_flush_id = 0;
|
||||
|
||||
display = GDK_BROADWAY_DISPLAY (gdk_display_get_default ());
|
||||
|
||||
updated_surface = FALSE;
|
||||
for (l = display->toplevels; l != NULL; l = l->next)
|
||||
{
|
||||
GdkWindowImplBroadway *impl = l->data;
|
||||
@@ -100,7 +102,6 @@ update_dirty_windows_and_sync (void)
|
||||
if (impl->dirty)
|
||||
{
|
||||
impl->dirty = FALSE;
|
||||
updated_surface = TRUE;
|
||||
_gdk_broadway_server_window_update (display->server,
|
||||
impl->id,
|
||||
impl->surface);
|
||||
@@ -109,32 +110,16 @@ update_dirty_windows_and_sync (void)
|
||||
|
||||
/* We sync here to ensure all references to the impl->surface memory
|
||||
is done, as we may later paint new data in them. */
|
||||
if (updated_surface)
|
||||
gdk_display_sync (GDK_DISPLAY (display));
|
||||
else
|
||||
gdk_display_flush (GDK_DISPLAY (display));
|
||||
}
|
||||
|
||||
static guint flush_id = 0;
|
||||
|
||||
static gboolean
|
||||
flush_idle (gpointer data)
|
||||
{
|
||||
flush_id = 0;
|
||||
|
||||
gdk_display_flush (gdk_display_get_default ());
|
||||
gdk_display_sync (GDK_DISPLAY (display));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* We need to flush in an idle rather than AFTER_PAINT, as the clock
|
||||
is frozen during e.g. window resizes so the paint will not happen
|
||||
and the window resize request is never flushed. */
|
||||
static void
|
||||
queue_flush (GdkWindow *window)
|
||||
queue_dirty_flush (GdkBroadwayDisplay *display)
|
||||
{
|
||||
if (flush_id == 0)
|
||||
flush_id = gdk_threads_add_idle (flush_idle, NULL);
|
||||
if (dirty_flush_id == 0)
|
||||
dirty_flush_id = gdk_threads_add_idle (dirty_flush_idle, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -212,25 +197,6 @@ _gdk_broadway_screen_init_root_window (GdkScreen * screen)
|
||||
_gdk_window_update_size (broadway_screen->root_window);
|
||||
}
|
||||
|
||||
static void
|
||||
on_frame_clock_after_paint (GdkFrameClock *clock,
|
||||
GdkWindow *window)
|
||||
{
|
||||
update_dirty_windows_and_sync ();
|
||||
}
|
||||
|
||||
static void
|
||||
connect_frame_clock (GdkWindow *window)
|
||||
{
|
||||
if (WINDOW_IS_TOPLEVEL (window))
|
||||
{
|
||||
GdkFrameClock *frame_clock = gdk_window_get_frame_clock (window);
|
||||
|
||||
g_signal_connect (frame_clock, "after-paint",
|
||||
G_CALLBACK (on_frame_clock_after_paint), window);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_broadway_display_create_window_impl (GdkDisplay *display,
|
||||
GdkWindow *window,
|
||||
@@ -263,21 +229,22 @@ _gdk_broadway_display_create_window_impl (GdkDisplay *display,
|
||||
g_assert (GDK_WINDOW_TYPE (window->parent) == GDK_WINDOW_ROOT);
|
||||
|
||||
broadway_display->toplevels = g_list_prepend (broadway_display->toplevels, impl);
|
||||
|
||||
connect_frame_clock (window);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_broadway_window_resize_surface (GdkWindow *window)
|
||||
{
|
||||
GdkWindowImplBroadway *impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
|
||||
cairo_surface_t *old;
|
||||
|
||||
if (impl->surface)
|
||||
{
|
||||
cairo_surface_destroy (impl->surface);
|
||||
old = impl->surface;
|
||||
|
||||
impl->surface = _gdk_broadway_server_create_surface (gdk_window_get_width (impl->wrapper),
|
||||
gdk_window_get_height (impl->wrapper));
|
||||
|
||||
cairo_surface_destroy (old);
|
||||
}
|
||||
|
||||
if (impl->ref_surface)
|
||||
@@ -417,7 +384,7 @@ gdk_window_broadway_show (GdkWindow *window, gboolean already_mapped)
|
||||
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window));
|
||||
if (_gdk_broadway_server_window_show (broadway_display->server, impl->id))
|
||||
queue_flush (window);
|
||||
queue_dirty_flush (broadway_display);
|
||||
|
||||
}
|
||||
|
||||
@@ -437,12 +404,8 @@ gdk_window_broadway_hide (GdkWindow *window)
|
||||
_gdk_make_event (GDK_WINDOW (window), GDK_UNMAP, NULL, FALSE);
|
||||
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window));
|
||||
|
||||
_gdk_broadway_window_grab_check_unmap (window,
|
||||
_gdk_broadway_server_get_next_serial (broadway_display->server));
|
||||
|
||||
if (_gdk_broadway_server_window_hide (broadway_display->server, impl->id))
|
||||
queue_flush (window);
|
||||
queue_dirty_flush (broadway_display);
|
||||
|
||||
_gdk_window_clear_update_area (window);
|
||||
}
|
||||
@@ -497,7 +460,7 @@ gdk_window_broadway_move_resize (GdkWindow *window,
|
||||
with_move,
|
||||
x, y,
|
||||
window->width, window->height);
|
||||
queue_flush (window);
|
||||
queue_dirty_flush (broadway_display);
|
||||
if (size_changed)
|
||||
window->resize_count++;
|
||||
}
|
||||
@@ -582,12 +545,6 @@ gdk_broadway_window_set_geometry_hints (GdkWindow *window,
|
||||
const GdkGeometry *geometry,
|
||||
GdkWindowHints geom_mask)
|
||||
{
|
||||
GdkWindowImplBroadway *impl;
|
||||
|
||||
impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
|
||||
|
||||
impl->geometry_hints = *geometry;
|
||||
impl->geometry_hints_mask = geom_mask;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -653,7 +610,7 @@ gdk_window_broadway_set_device_cursor (GdkWindow *window,
|
||||
{
|
||||
_gdk_broadway_cursor_update_theme (cursor);
|
||||
g_hash_table_replace (impl->device_cursor,
|
||||
device, g_object_ref (cursor));
|
||||
device, gdk_cursor_ref (cursor));
|
||||
}
|
||||
|
||||
if (!GDK_WINDOW_DESTROYED (window))
|
||||
@@ -1035,8 +992,6 @@ struct _MoveResizeData
|
||||
gint moveresize_orig_width;
|
||||
gint moveresize_orig_height;
|
||||
long moveresize_process_time;
|
||||
GdkWindowHints moveresize_geom_mask;
|
||||
GdkGeometry moveresize_geometry;
|
||||
BroadwayInputMsg *moveresize_pending_event;
|
||||
};
|
||||
|
||||
@@ -1044,19 +999,20 @@ static MoveResizeData *
|
||||
get_move_resize_data (GdkDisplay *display,
|
||||
gboolean create)
|
||||
{
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
MoveResizeData *mv_resize;
|
||||
static GQuark move_resize_quark = 0;
|
||||
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (display);
|
||||
if (!move_resize_quark)
|
||||
move_resize_quark = g_quark_from_static_string ("gdk-window-moveresize");
|
||||
|
||||
mv_resize = broadway_display->move_resize_data;
|
||||
mv_resize = g_object_get_qdata (G_OBJECT (display), move_resize_quark);
|
||||
|
||||
if (!mv_resize && create)
|
||||
{
|
||||
mv_resize = g_new0 (MoveResizeData, 1);
|
||||
mv_resize->display = display;
|
||||
|
||||
broadway_display->move_resize_data = mv_resize;
|
||||
g_object_set_qdata (G_OBJECT (display), move_resize_quark, mv_resize);
|
||||
}
|
||||
|
||||
return mv_resize;
|
||||
@@ -1125,13 +1081,6 @@ update_pos (MoveResizeData *mv_resize,
|
||||
w = MAX (w, 1);
|
||||
h = MAX (h, 1);
|
||||
|
||||
if (mv_resize->moveresize_geom_mask)
|
||||
{
|
||||
gdk_window_constrain_size (&mv_resize->moveresize_geometry,
|
||||
mv_resize->moveresize_geom_mask,
|
||||
w, h, &w, &h);
|
||||
}
|
||||
|
||||
gdk_window_move_resize (mv_resize->moveresize_window, x, y, w, h);
|
||||
}
|
||||
else
|
||||
@@ -1186,7 +1135,7 @@ _gdk_broadway_moveresize_handle_event (GdkDisplay *display,
|
||||
|
||||
switch (event->base.type)
|
||||
{
|
||||
case BROADWAY_EVENT_POINTER_MOVE:
|
||||
case 'm':
|
||||
if (mv_resize->moveresize_window->resize_count > 0)
|
||||
{
|
||||
if (mv_resize->moveresize_pending_event)
|
||||
@@ -1214,7 +1163,7 @@ _gdk_broadway_moveresize_handle_event (GdkDisplay *display,
|
||||
finish_drag (mv_resize);
|
||||
break;
|
||||
|
||||
case BROADWAY_EVENT_BUTTON_RELEASE:
|
||||
case 'B':
|
||||
update_pos (mv_resize,
|
||||
event->pointer.root_x,
|
||||
event->pointer.root_y);
|
||||
@@ -1275,7 +1224,6 @@ create_moveresize_window (MoveResizeData *mv_resize,
|
||||
|
||||
gdk_window_show (mv_resize->moveresize_emulation_window);
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
status = gdk_pointer_grab (mv_resize->moveresize_emulation_window,
|
||||
FALSE,
|
||||
GDK_BUTTON_RELEASE_MASK |
|
||||
@@ -1283,7 +1231,6 @@ create_moveresize_window (MoveResizeData *mv_resize,
|
||||
NULL,
|
||||
NULL,
|
||||
timestamp);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
|
||||
if (status != GDK_GRAB_SUCCESS)
|
||||
{
|
||||
@@ -1296,71 +1243,6 @@ create_moveresize_window (MoveResizeData *mv_resize,
|
||||
mv_resize->moveresize_process_time = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
calculate_unmoving_origin (MoveResizeData *mv_resize)
|
||||
{
|
||||
GdkRectangle rect;
|
||||
gint width, height;
|
||||
|
||||
if (mv_resize->moveresize_geom_mask & GDK_HINT_WIN_GRAVITY &&
|
||||
mv_resize->moveresize_geometry.win_gravity == GDK_GRAVITY_STATIC)
|
||||
{
|
||||
gdk_window_get_origin (mv_resize->moveresize_window,
|
||||
&mv_resize->moveresize_orig_x,
|
||||
&mv_resize->moveresize_orig_y);
|
||||
}
|
||||
else
|
||||
{
|
||||
gdk_window_get_frame_extents (mv_resize->moveresize_window, &rect);
|
||||
gdk_window_get_geometry (mv_resize->moveresize_window,
|
||||
NULL, NULL, &width, &height);
|
||||
|
||||
switch (mv_resize->moveresize_geometry.win_gravity)
|
||||
{
|
||||
case GDK_GRAVITY_NORTH_WEST:
|
||||
mv_resize->moveresize_orig_x = rect.x;
|
||||
mv_resize->moveresize_orig_y = rect.y;
|
||||
break;
|
||||
case GDK_GRAVITY_NORTH:
|
||||
mv_resize->moveresize_orig_x = rect.x + rect.width / 2 - width / 2;
|
||||
mv_resize->moveresize_orig_y = rect.y;
|
||||
break;
|
||||
case GDK_GRAVITY_NORTH_EAST:
|
||||
mv_resize->moveresize_orig_x = rect.x + rect.width - width;
|
||||
mv_resize->moveresize_orig_y = rect.y;
|
||||
break;
|
||||
case GDK_GRAVITY_WEST:
|
||||
mv_resize->moveresize_orig_x = rect.x;
|
||||
mv_resize->moveresize_orig_y = rect.y + rect.height / 2 - height / 2;
|
||||
break;
|
||||
case GDK_GRAVITY_CENTER:
|
||||
mv_resize->moveresize_orig_x = rect.x + rect.width / 2 - width / 2;
|
||||
mv_resize->moveresize_orig_y = rect.y + rect.height / 2 - height / 2;
|
||||
break;
|
||||
case GDK_GRAVITY_EAST:
|
||||
mv_resize->moveresize_orig_x = rect.x + rect.width - width;
|
||||
mv_resize->moveresize_orig_y = rect.y + rect.height / 2 - height / 2;
|
||||
break;
|
||||
case GDK_GRAVITY_SOUTH_WEST:
|
||||
mv_resize->moveresize_orig_x = rect.x;
|
||||
mv_resize->moveresize_orig_y = rect.y + rect.height - height;
|
||||
break;
|
||||
case GDK_GRAVITY_SOUTH:
|
||||
mv_resize->moveresize_orig_x = rect.x + rect.width / 2 - width / 2;
|
||||
mv_resize->moveresize_orig_y = rect.y + rect.height - height;
|
||||
break;
|
||||
case GDK_GRAVITY_SOUTH_EAST:
|
||||
mv_resize->moveresize_orig_x = rect.x + rect.width - width;
|
||||
mv_resize->moveresize_orig_y = rect.y + rect.height - height;
|
||||
break;
|
||||
default:
|
||||
mv_resize->moveresize_orig_x = rect.x;
|
||||
mv_resize->moveresize_orig_y = rect.y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_window_begin_resize_drag (GdkWindow *window,
|
||||
GdkWindowEdge edge,
|
||||
@@ -1371,15 +1253,12 @@ gdk_broadway_window_begin_resize_drag (GdkWindow *window,
|
||||
guint32 timestamp)
|
||||
{
|
||||
MoveResizeData *mv_resize;
|
||||
GdkWindowImplBroadway *impl;
|
||||
|
||||
impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window) ||
|
||||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
||||
return;
|
||||
|
||||
mv_resize = get_move_resize_data (gdk_window_get_display (window), TRUE);
|
||||
mv_resize = get_move_resize_data (GDK_WINDOW_DISPLAY (window), TRUE);
|
||||
|
||||
mv_resize->is_resize = TRUE;
|
||||
mv_resize->moveresize_button = button;
|
||||
@@ -1388,14 +1267,12 @@ gdk_broadway_window_begin_resize_drag (GdkWindow *window,
|
||||
mv_resize->moveresize_y = root_y;
|
||||
mv_resize->moveresize_window = g_object_ref (window);
|
||||
|
||||
gdk_window_get_origin (mv_resize->moveresize_window,
|
||||
&mv_resize->moveresize_orig_x,
|
||||
&mv_resize->moveresize_orig_y);
|
||||
mv_resize->moveresize_orig_width = gdk_window_get_width (window);
|
||||
mv_resize->moveresize_orig_height = gdk_window_get_height (window);
|
||||
|
||||
mv_resize->moveresize_geom_mask = impl->geometry_hints_mask;
|
||||
mv_resize->moveresize_geometry = impl->geometry_hints;
|
||||
|
||||
calculate_unmoving_origin (mv_resize);
|
||||
|
||||
create_moveresize_window (mv_resize, timestamp);
|
||||
}
|
||||
|
||||
@@ -1451,6 +1328,7 @@ gdk_broadway_window_process_updates_recurse (GdkWindow *window,
|
||||
|
||||
impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
|
||||
impl->dirty = TRUE;
|
||||
queue_dirty_flush (GDK_BROADWAY_DISPLAY (gdk_window_get_display (window)));
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1516,7 +1394,7 @@ _gdk_broadway_window_translate (GdkWindow *window,
|
||||
if (_gdk_broadway_server_window_translate (broadway_display->server,
|
||||
impl->id,
|
||||
area, dx, dy))
|
||||
queue_flush (window);
|
||||
queue_dirty_flush (broadway_display);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,9 +64,6 @@ struct _GdkWindowImplBroadway
|
||||
gint8 toplevel_window_type;
|
||||
gboolean dirty;
|
||||
gboolean last_synced;
|
||||
|
||||
GdkGeometry geometry_hints;
|
||||
GdkWindowHints geometry_hints_mask;
|
||||
};
|
||||
|
||||
struct _GdkWindowImplBroadwayClass
|
||||
|
||||
@@ -42,15 +42,3 @@ isinf (double x)
|
||||
return (!_finite (x) && !_isnan (x));
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Workaround for round() for non-GCC/non-C99 compilers */
|
||||
#ifndef HAVE_ROUND
|
||||
static inline double
|
||||
round (double x)
|
||||
{
|
||||
if (x >= 0)
|
||||
return floor (x + 0.5);
|
||||
else
|
||||
return ceil (x - 0.5);
|
||||
}
|
||||
#endif
|
||||
|
||||
26
gdk/gdk.c
26
gdk/gdk.c
@@ -275,6 +275,9 @@ gdk_pre_parse_libgtk_only (void)
|
||||
else if (g_str_equal (rendering_mode, "recording"))
|
||||
_gdk_rendering_mode = GDK_RENDERING_MODE_RECORDING;
|
||||
}
|
||||
|
||||
/* Do any setup particular to the windowing system */
|
||||
gdk_display_manager_get ();
|
||||
}
|
||||
|
||||
|
||||
@@ -325,24 +328,6 @@ gdk_parse_args (int *argc,
|
||||
GDK_NOTE (MISC, g_message ("progname: \"%s\"", g_get_prgname ()));
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_get_display:
|
||||
*
|
||||
* Gets the name of the display, which usually comes from the
|
||||
* <envar>DISPLAY</envar> environment variable or the
|
||||
* <option>--display</option> command line option.
|
||||
*
|
||||
* Returns: the name of the display.
|
||||
*
|
||||
* Deprecated: 3.8: Call gdk_display_get_name (gdk_display_get_default ()))
|
||||
* instead.
|
||||
*/
|
||||
gchar *
|
||||
gdk_get_display (void)
|
||||
{
|
||||
return g_strdup (gdk_display_get_name (gdk_display_get_default ()));
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_get_display_arg_name:
|
||||
*
|
||||
@@ -368,7 +353,7 @@ gdk_get_display_arg_name (void)
|
||||
*
|
||||
* Opens the default display specified by command line arguments or
|
||||
* environment variables, sets it as the default display, and returns
|
||||
* it. gdk_parse_args() must have been called first. If the default
|
||||
* it. gdk_parse_args must have been called first. If the default
|
||||
* display has previously been set, simply returns that. An internal
|
||||
* function that should not be used by applications.
|
||||
*
|
||||
@@ -382,9 +367,6 @@ gdk_display_open_default_libgtk_only (void)
|
||||
|
||||
g_return_val_if_fail (gdk_initialized, NULL);
|
||||
|
||||
if (gdk_display_manager_peek () == NULL)
|
||||
return NULL;
|
||||
|
||||
display = gdk_display_get_default ();
|
||||
if (display)
|
||||
return display;
|
||||
|
||||
@@ -101,7 +101,6 @@ gdk_display_is_closed
|
||||
gdk_display_keyboard_ungrab
|
||||
gdk_display_list_devices
|
||||
gdk_display_manager_get
|
||||
gdk_display_manager_peek
|
||||
gdk_display_manager_get_default_display
|
||||
gdk_display_manager_get_type
|
||||
gdk_display_manager_list_displays
|
||||
@@ -336,7 +335,6 @@ gdk_set_program_class
|
||||
gdk_set_show_events
|
||||
gdk_setting_action_get_type
|
||||
gdk_setting_get
|
||||
gdk_set_allowed_backends
|
||||
gdk_status_get_type
|
||||
gdk_synthesize_window_state
|
||||
gdk_test_render_sync
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "gdkdisplayprivate.h"
|
||||
|
||||
#include "gdkdeviceprivate.h"
|
||||
#include "gdkdisplaymanagerprivate.h"
|
||||
#include "gdkevents.h"
|
||||
#include "gdkwindowimpl.h"
|
||||
#include "gdkinternals.h"
|
||||
@@ -82,36 +81,6 @@ static guint signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
G_DEFINE_TYPE (GdkDisplay, gdk_display, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
gdk_display_real_make_default (GdkDisplay *display)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
device_removed_cb (GdkDeviceManager *device_manager,
|
||||
GdkDevice *device,
|
||||
GdkDisplay *display)
|
||||
{
|
||||
g_hash_table_remove (display->multiple_click_info, device);
|
||||
g_hash_table_remove (display->device_grabs, device);
|
||||
g_hash_table_remove (display->pointers_info, device);
|
||||
|
||||
/* FIXME: change core pointer and remove from device list */
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_display_real_opened (GdkDisplay *display)
|
||||
{
|
||||
GdkDeviceManager *device_manager;
|
||||
|
||||
device_manager = gdk_display_get_device_manager (display);
|
||||
|
||||
g_signal_connect (device_manager, "device-removed",
|
||||
G_CALLBACK (device_removed_cb), display);
|
||||
|
||||
_gdk_display_manager_add_display (gdk_display_manager_get (), display);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_display_class_init (GdkDisplayClass *class)
|
||||
{
|
||||
@@ -123,9 +92,6 @@ gdk_display_class_init (GdkDisplayClass *class)
|
||||
class->get_app_launch_context = gdk_display_real_get_app_launch_context;
|
||||
class->window_type = GDK_TYPE_WINDOW;
|
||||
|
||||
class->opened = gdk_display_real_opened;
|
||||
class->make_default = gdk_display_real_make_default;
|
||||
|
||||
/**
|
||||
* GdkDisplay::opened:
|
||||
* @display: the object on which the signal is emitted
|
||||
@@ -137,8 +103,7 @@ gdk_display_class_init (GdkDisplayClass *class)
|
||||
g_signal_new (g_intern_static_string ("opened"),
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GdkDisplayClass, opened),
|
||||
NULL, NULL,
|
||||
0, NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
@@ -192,6 +157,29 @@ free_device_grabs_foreach (gpointer key,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
device_removed_cb (GdkDeviceManager *device_manager,
|
||||
GdkDevice *device,
|
||||
GdkDisplay *display)
|
||||
{
|
||||
g_hash_table_remove (display->multiple_click_info, device);
|
||||
g_hash_table_remove (display->device_grabs, device);
|
||||
g_hash_table_remove (display->pointers_info, device);
|
||||
|
||||
/* FIXME: change core pointer and remove from device list */
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_display_opened (GdkDisplay *display)
|
||||
{
|
||||
GdkDeviceManager *device_manager;
|
||||
|
||||
device_manager = gdk_display_get_device_manager (display);
|
||||
|
||||
g_signal_connect (device_manager, "device-removed",
|
||||
G_CALLBACK (device_removed_cb), display);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_display_init (GdkDisplay *display)
|
||||
{
|
||||
@@ -208,6 +196,9 @@ gdk_display_init (GdkDisplay *display)
|
||||
|
||||
display->multiple_click_info = g_hash_table_new_full (NULL, NULL, NULL,
|
||||
(GDestroyNotify) g_free);
|
||||
|
||||
g_signal_connect (display, "opened",
|
||||
G_CALLBACK (gdk_display_opened), NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -218,8 +209,6 @@ gdk_display_dispose (GObject *object)
|
||||
|
||||
device_manager = gdk_display_get_device_manager (GDK_DISPLAY (object));
|
||||
|
||||
_gdk_display_manager_remove_display (gdk_display_manager_get (), display);
|
||||
|
||||
g_list_free_full (display->queued_events, (GDestroyNotify) gdk_event_free);
|
||||
display->queued_events = NULL;
|
||||
display->queued_tail = NULL;
|
||||
@@ -1426,6 +1415,12 @@ gdk_display_get_name (GdkDisplay *display)
|
||||
return GDK_DISPLAY_GET_CLASS (display)->get_name (display);
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_get_display (void)
|
||||
{
|
||||
return g_strdup (gdk_display_get_name (gdk_display_get_default ()));
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_display_get_n_screens:
|
||||
* @display: a #GdkDisplay
|
||||
@@ -1435,15 +1430,13 @@ gdk_display_get_name (GdkDisplay *display)
|
||||
* Returns: number of screens.
|
||||
*
|
||||
* Since: 2.2
|
||||
*
|
||||
* Deprecated: 3.10: The number of screens is always 1.
|
||||
*/
|
||||
gint
|
||||
gdk_display_get_n_screens (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), 0);
|
||||
|
||||
return 1;
|
||||
return GDK_DISPLAY_GET_CLASS (display)->get_n_screens (display);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1462,9 +1455,8 @@ gdk_display_get_screen (GdkDisplay *display,
|
||||
gint screen_num)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
g_return_val_if_fail (screen_num == 0, NULL);
|
||||
|
||||
return gdk_display_get_default_screen (display);
|
||||
return GDK_DISPLAY_GET_CLASS (display)->get_screen (display, screen_num);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -45,7 +45,6 @@ GdkDisplay *gdk_display_open (const gchar *display_name);
|
||||
|
||||
const gchar * gdk_display_get_name (GdkDisplay *display);
|
||||
|
||||
GDK_DEPRECATED_IN_3_10
|
||||
gint gdk_display_get_n_screens (GdkDisplay *display);
|
||||
GdkScreen * gdk_display_get_screen (GdkDisplay *display,
|
||||
gint screen_num);
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
|
||||
#include "gdkconfig.h"
|
||||
#include "gdkdisplaymanagerprivate.h"
|
||||
#include "gdkdisplayprivate.h"
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkkeysprivate.h"
|
||||
#include "gdkmarshalers.h"
|
||||
@@ -34,7 +33,6 @@
|
||||
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
#include "x11/gdkx.h"
|
||||
#include "x11/gdkprivate-x11.h"
|
||||
#endif
|
||||
|
||||
#ifdef GDK_WINDOWING_QUARTZ
|
||||
@@ -43,22 +41,18 @@
|
||||
* "generic" GDK source code.
|
||||
*/
|
||||
#include "quartz/gdkquartzdisplaymanager.h"
|
||||
#include "quartz/gdkprivate-quartz.h"
|
||||
#endif
|
||||
|
||||
#ifdef GDK_WINDOWING_BROADWAY
|
||||
#include "broadway/gdkbroadwaydisplaymanager.h"
|
||||
#include "broadway/gdkprivate-broadway.h"
|
||||
#endif
|
||||
|
||||
#ifdef GDK_WINDOWING_WIN32
|
||||
#include "win32/gdkwin32.h"
|
||||
#include "win32/gdkprivate-win32.h"
|
||||
#endif
|
||||
|
||||
#ifdef GDK_WINDOWING_WAYLAND
|
||||
#include "wayland/gdkwayland.h"
|
||||
#include "wayland/gdkprivate-wayland.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -131,24 +125,7 @@ static void gdk_display_manager_get_property (GObject *object,
|
||||
|
||||
static guint signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
static void g_initable_iface_init (GInitableIface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GdkDisplayManager, gdk_display_manager, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, g_initable_iface_init))
|
||||
|
||||
static gboolean
|
||||
gdk_display_manager_initable_init (GInitable *initable,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
g_initable_iface_init (GInitableIface *iface)
|
||||
{
|
||||
iface->init = gdk_display_manager_initable_init;
|
||||
}
|
||||
G_DEFINE_TYPE (GdkDisplayManager, gdk_display_manager, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
gdk_display_manager_class_init (GdkDisplayManagerClass *klass)
|
||||
@@ -158,6 +135,8 @@ gdk_display_manager_class_init (GdkDisplayManagerClass *klass)
|
||||
object_class->set_property = gdk_display_manager_set_property;
|
||||
object_class->get_property = gdk_display_manager_get_property;
|
||||
|
||||
klass->keyval_convert_case = _gdk_display_manager_real_keyval_convert_case;
|
||||
|
||||
/**
|
||||
* GdkDisplayManager::display-opened:
|
||||
* @manager: the object on which the signal is emitted
|
||||
@@ -229,50 +208,6 @@ gdk_display_manager_get_property (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
static const gchar *allowed_backends;
|
||||
|
||||
/**
|
||||
* gdk_set_allowed_backends:
|
||||
* @backends: a comma-separated list of backends
|
||||
*
|
||||
* Sets a list of backends that GDK should try to use.
|
||||
*
|
||||
* This can be be useful if your application does not
|
||||
* work with certain GDK backends.
|
||||
*
|
||||
* By default, GDK tries all included backends.
|
||||
*
|
||||
* For example,
|
||||
* <programlisting>
|
||||
* gdk_set_allowed_backends ("wayland,quartz,*");
|
||||
* </programlisting>
|
||||
* instructs GDK to try the Wayland backend first,
|
||||
* followed by the Quartz backend, and then all
|
||||
* others.
|
||||
*
|
||||
* If the <envvar>GDK_BACKEND</envvar> environment variable
|
||||
* is set, it determines what backends are tried in what
|
||||
* order, while still respecting the set of allowed backends
|
||||
* that are specified by this function.
|
||||
*
|
||||
* The possible backend names are x11, win32, quartz,
|
||||
* broadway, wayland. You can also include a * in the
|
||||
* list to try all remaining backends.
|
||||
*
|
||||
* This call must happen prior to gdk_display_open(),
|
||||
* gtk_init(), gtk_init_with_args() or gtk_init_check()
|
||||
* in order to take effect.
|
||||
*
|
||||
* Since: 3.10
|
||||
*/
|
||||
void
|
||||
gdk_set_allowed_backends (const gchar *backends)
|
||||
{
|
||||
allowed_backends = g_strdup (backends);
|
||||
}
|
||||
|
||||
static GdkDisplayManager *manager = NULL;
|
||||
|
||||
/**
|
||||
* gdk_display_manager_get:
|
||||
*
|
||||
@@ -281,8 +216,7 @@ static GdkDisplayManager *manager = NULL;
|
||||
* When called for the first time, this function consults the
|
||||
* <envar>GDK_BACKEND</envar> environment variable to find out which
|
||||
* of the supported GDK backends to use (in case GDK has been compiled
|
||||
* with multiple backends). Applications can use gdk_set_allowed_backends()
|
||||
* to limit what backends can be used.
|
||||
* with multiple backends).
|
||||
*
|
||||
* Returns: (transfer none): The global #GdkDisplayManager singleton;
|
||||
* gdk_parse_args(), gdk_init(), or gdk_init_check() must have
|
||||
@@ -293,95 +227,42 @@ static GdkDisplayManager *manager = NULL;
|
||||
GdkDisplayManager*
|
||||
gdk_display_manager_get (void)
|
||||
{
|
||||
gdk_display_manager_peek ();
|
||||
static GdkDisplayManager *manager = NULL;
|
||||
|
||||
if (manager == NULL)
|
||||
g_error ("No GDK backend found (%s)", allowed_backends);
|
||||
if (!manager)
|
||||
{
|
||||
const gchar *backend;
|
||||
|
||||
return manager;
|
||||
}
|
||||
|
||||
typedef struct _GdkBackend GdkBackend;
|
||||
|
||||
struct _GdkBackend {
|
||||
const char *name;
|
||||
GType (* get_backend_type) (void);
|
||||
GdkDisplay * (* open_display) (const char *name);
|
||||
};
|
||||
|
||||
GdkBackend gdk_backends[] = {
|
||||
backend = g_getenv ("GDK_BACKEND");
|
||||
#ifdef GDK_WINDOWING_QUARTZ
|
||||
{ "quartz", gdk_quartz_display_manager_get_type, _gdk_quartz_display_open },
|
||||
if (backend == NULL || strcmp (backend, "quartz") == 0)
|
||||
manager = g_object_new (gdk_quartz_display_manager_get_type (), NULL);
|
||||
else
|
||||
#endif
|
||||
#ifdef GDK_WINDOWING_WIN32
|
||||
{ "win32", gdk_win32_display_manager_get_type, _gdk_win32_display_open },
|
||||
if (backend == NULL || strcmp (backend, "win32") == 0)
|
||||
manager = g_object_new (gdk_win32_display_manager_get_type (), NULL);
|
||||
else
|
||||
#endif
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
{ "x11", gdk_x11_display_manager_get_type, _gdk_x11_display_open },
|
||||
if (backend == NULL || strcmp (backend, "x11") == 0)
|
||||
manager = g_object_new (gdk_x11_display_manager_get_type (), NULL);
|
||||
else
|
||||
#endif
|
||||
#ifdef GDK_WINDOWING_WAYLAND
|
||||
{ "wayland", gdk_wayland_display_manager_get_type, _gdk_wayland_display_open },
|
||||
if (backend == NULL || strcmp (backend, "wayland") == 0)
|
||||
manager = g_object_new (gdk_wayland_display_manager_get_type (), NULL);
|
||||
else
|
||||
#endif
|
||||
#ifdef GDK_WINDOWING_BROADWAY
|
||||
{ "broadway", gdk_broadway_display_manager_get_type, _gdk_broadway_display_open },
|
||||
if (backend == NULL || strcmp (backend, "broadway") == 0)
|
||||
manager = g_object_new (gdk_broadway_display_manager_get_type (), NULL);
|
||||
else
|
||||
#endif
|
||||
/* NULL-terminating this array so we can use commas above */
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
* gdk_display_manager_peek:
|
||||
*
|
||||
* Gets the singleton #GdkDisplayManager object. If GDK could
|
||||
* not be initialized, %NULL is returned.
|
||||
*
|
||||
* Returns: (transfer none): The global #GdkDisplayManager singleton,
|
||||
* or %NULL if GDK could not be initialized. gdk_parse_args(),
|
||||
* gdk_init(), or gdk_init_check() must have been called first
|
||||
*
|
||||
* Since: 3.10
|
||||
*/
|
||||
GdkDisplayManager *
|
||||
gdk_display_manager_peek (void)
|
||||
{
|
||||
if (manager == NULL)
|
||||
{
|
||||
const gchar *backend_list;
|
||||
gchar **backends;
|
||||
gint i, j;
|
||||
gboolean allow_any;
|
||||
|
||||
if (allowed_backends == NULL)
|
||||
allowed_backends = "*";
|
||||
allow_any = strstr (allowed_backends, "*") != NULL;
|
||||
|
||||
backend_list = g_getenv ("GDK_BACKEND");
|
||||
if (backend_list == NULL)
|
||||
backend_list = allowed_backends;
|
||||
backends = g_strsplit (backend_list, ",", 0);
|
||||
|
||||
for (i = 0; manager == NULL && backends[i] != NULL; i++)
|
||||
{
|
||||
const gchar *backend = backends[i];
|
||||
gboolean any = g_str_equal (backend, "*");
|
||||
|
||||
if (!allow_any && !any && !strstr (allowed_backends, backend))
|
||||
continue;
|
||||
|
||||
for (j = 0; gdk_backends[j].name != NULL; j++)
|
||||
{
|
||||
if ((any && allow_any) ||
|
||||
(any && strstr (allowed_backends, gdk_backends[j].name)) ||
|
||||
g_str_equal (backend, gdk_backends[j].name))
|
||||
{
|
||||
GDK_NOTE (MISC, g_message ("Trying %s backend", gdk_backends[j].name));
|
||||
manager = g_initable_new (gdk_backends[j].get_backend_type (), NULL, NULL, NULL);
|
||||
if (manager)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
g_strfreev (backends);
|
||||
if (backend != NULL)
|
||||
g_error ("Unsupported GDK backend: %s", backend);
|
||||
else
|
||||
g_error ("No GDK backend found");
|
||||
}
|
||||
|
||||
return manager;
|
||||
@@ -401,7 +282,7 @@ gdk_display_manager_peek (void)
|
||||
GdkDisplay *
|
||||
gdk_display_manager_get_default_display (GdkDisplayManager *manager)
|
||||
{
|
||||
return manager->default_display;
|
||||
return GDK_DISPLAY_MANAGER_GET_CLASS (manager)->get_default_display (manager);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -458,10 +339,7 @@ void
|
||||
gdk_display_manager_set_default_display (GdkDisplayManager *manager,
|
||||
GdkDisplay *display)
|
||||
{
|
||||
manager->default_display = display;
|
||||
|
||||
if (display)
|
||||
GDK_DISPLAY_GET_CLASS (display)->make_default (display);
|
||||
GDK_DISPLAY_MANAGER_GET_CLASS (manager)->set_default_display (manager, display);
|
||||
|
||||
g_object_notify (G_OBJECT (manager), "default-display");
|
||||
}
|
||||
@@ -481,7 +359,7 @@ gdk_display_manager_set_default_display (GdkDisplayManager *manager,
|
||||
GSList *
|
||||
gdk_display_manager_list_displays (GdkDisplayManager *manager)
|
||||
{
|
||||
return g_slist_copy (manager->displays);
|
||||
return GDK_DISPLAY_MANAGER_GET_CLASS (manager)->list_displays (manager);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -500,45 +378,71 @@ GdkDisplay *
|
||||
gdk_display_manager_open_display (GdkDisplayManager *manager,
|
||||
const gchar *name)
|
||||
{
|
||||
guint i;
|
||||
|
||||
for (i = 0; gdk_backends[i].name != NULL; i++)
|
||||
{
|
||||
if (G_OBJECT_TYPE (manager) == gdk_backends[i].get_backend_type ())
|
||||
{
|
||||
return gdk_backends[i].open_display (name);
|
||||
}
|
||||
}
|
||||
|
||||
g_assert_not_reached ();
|
||||
|
||||
return NULL;
|
||||
return GDK_DISPLAY_MANAGER_GET_CLASS (manager)->open_display (manager, name);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_display_manager_add_display (GdkDisplayManager *manager,
|
||||
GdkDisplay *display)
|
||||
/**
|
||||
* gdk_atom_intern:
|
||||
* @atom_name: a string.
|
||||
* @only_if_exists: if %TRUE, GDK is allowed to not create a new atom, but
|
||||
* just return %GDK_NONE if the requested atom doesn't already
|
||||
* exists. Currently, the flag is ignored, since checking the
|
||||
* existance of an atom is as expensive as creating it.
|
||||
*
|
||||
* Finds or creates an atom corresponding to a given string.
|
||||
*
|
||||
* Returns: (transfer none): the atom corresponding to @atom_name.
|
||||
*/
|
||||
GdkAtom
|
||||
gdk_atom_intern (const gchar *atom_name,
|
||||
gboolean only_if_exists)
|
||||
{
|
||||
if (manager->displays == NULL)
|
||||
gdk_display_manager_set_default_display (manager, display);
|
||||
GdkDisplayManager *manager = gdk_display_manager_get ();
|
||||
|
||||
manager->displays = g_slist_prepend (manager->displays, display);
|
||||
|
||||
g_signal_emit (manager, signals[DISPLAY_OPENED], 0, display);
|
||||
return GDK_DISPLAY_MANAGER_GET_CLASS (manager)->atom_intern (manager, atom_name, TRUE);
|
||||
}
|
||||
|
||||
/* NB: This function can be called multiple times per display. */
|
||||
void
|
||||
_gdk_display_manager_remove_display (GdkDisplayManager *manager,
|
||||
GdkDisplay *display)
|
||||
/**
|
||||
* gdk_atom_intern_static_string:
|
||||
* @atom_name: a static string
|
||||
*
|
||||
* Finds or creates an atom corresponding to a given string.
|
||||
*
|
||||
* Note that this function is identical to gdk_atom_intern() except
|
||||
* that if a new #GdkAtom is created the string itself is used rather
|
||||
* than a copy. This saves memory, but can only be used if the string
|
||||
* will <emphasis>always</emphasis> exist. It can be used with statically
|
||||
* allocated strings in the main program, but not with statically
|
||||
* allocated memory in dynamically loaded modules, if you expect to
|
||||
* ever unload the module again (e.g. do not use this function in
|
||||
* GTK+ theme engines).
|
||||
*
|
||||
* Returns: (transfer none): the atom corresponding to @atom_name
|
||||
*
|
||||
* Since: 2.10
|
||||
*/
|
||||
GdkAtom
|
||||
gdk_atom_intern_static_string (const gchar *atom_name)
|
||||
{
|
||||
manager->displays = g_slist_remove (manager->displays, display);
|
||||
GdkDisplayManager *manager = gdk_display_manager_get ();
|
||||
|
||||
if (manager->default_display == display)
|
||||
{
|
||||
if (manager->displays)
|
||||
gdk_display_manager_set_default_display (manager, manager->displays->data);
|
||||
else
|
||||
gdk_display_manager_set_default_display (manager, NULL);
|
||||
}
|
||||
return GDK_DISPLAY_MANAGER_GET_CLASS (manager)->atom_intern (manager, atom_name, FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_atom_name:
|
||||
* @atom: a #GdkAtom.
|
||||
*
|
||||
* Determines the string corresponding to an atom.
|
||||
*
|
||||
* Returns: a newly-allocated string containing the string
|
||||
* corresponding to @atom. When you are done with the
|
||||
* return value, you should free it using g_free().
|
||||
*/
|
||||
gchar *
|
||||
gdk_atom_name (GdkAtom atom)
|
||||
{
|
||||
GdkDisplayManager *manager = gdk_display_manager_get ();
|
||||
|
||||
return GDK_DISPLAY_MANAGER_GET_CLASS (manager)->get_atom_name (manager, atom);
|
||||
}
|
||||
|
||||
@@ -43,8 +43,6 @@ G_BEGIN_DECLS
|
||||
GType gdk_display_manager_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GdkDisplayManager *gdk_display_manager_get (void);
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
GdkDisplayManager *gdk_display_manager_peek (void);
|
||||
GdkDisplay * gdk_display_manager_get_default_display (GdkDisplayManager *manager);
|
||||
void gdk_display_manager_set_default_display (GdkDisplayManager *manager,
|
||||
GdkDisplay *display);
|
||||
|
||||
@@ -31,26 +31,39 @@ typedef struct _GdkDisplayManagerClass GdkDisplayManagerClass;
|
||||
struct _GdkDisplayManager
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
GdkDisplay *default_display;
|
||||
|
||||
GSList *displays;
|
||||
};
|
||||
|
||||
struct _GdkDisplayManagerClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
GSList * (*list_displays) (GdkDisplayManager *manager);
|
||||
GdkDisplay * (*get_default_display) (GdkDisplayManager *manager);
|
||||
void (*set_default_display) (GdkDisplayManager *manager,
|
||||
GdkDisplay *display);
|
||||
GdkDisplay * (*open_display) (GdkDisplayManager *manager,
|
||||
const gchar *name);
|
||||
|
||||
/* FIXME the following should really be frontend-only, not vfuncs */
|
||||
GdkAtom (*atom_intern) (GdkDisplayManager *manager,
|
||||
const gchar *atom_name,
|
||||
gboolean copy_name);
|
||||
gchar * (*get_atom_name) (GdkDisplayManager *manager,
|
||||
GdkAtom atom);
|
||||
guint (*lookup_keyval) (GdkDisplayManager *manager,
|
||||
const gchar *name);
|
||||
gchar * (*get_keyval_name) (GdkDisplayManager *manager,
|
||||
guint keyval);
|
||||
void (*keyval_convert_case) (GdkDisplayManager *manager,
|
||||
guint keyval,
|
||||
guint *lower,
|
||||
guint *upper);
|
||||
|
||||
/* signals */
|
||||
void (*display_opened) (GdkDisplayManager *manager,
|
||||
GdkDisplay *display);
|
||||
};
|
||||
|
||||
void _gdk_display_manager_add_display (GdkDisplayManager *manager,
|
||||
GdkDisplay *display);
|
||||
void _gdk_display_manager_remove_display (GdkDisplayManager *manager,
|
||||
GdkDisplay *display);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif
|
||||
|
||||
@@ -136,13 +136,15 @@ struct _GdkDisplayClass
|
||||
GType window_type; /* type for native windows for this display, set in class_init */
|
||||
|
||||
const gchar * (*get_name) (GdkDisplay *display);
|
||||
gint (*get_n_screens) (GdkDisplay *display);
|
||||
GdkScreen * (*get_screen) (GdkDisplay *display,
|
||||
gint screen_num);
|
||||
GdkScreen * (*get_default_screen) (GdkDisplay *display);
|
||||
void (*beep) (GdkDisplay *display);
|
||||
void (*sync) (GdkDisplay *display);
|
||||
void (*flush) (GdkDisplay *display);
|
||||
gboolean (*has_pending) (GdkDisplay *display);
|
||||
void (*queue_events) (GdkDisplay *display);
|
||||
void (*make_default) (GdkDisplay *display);
|
||||
GdkWindow * (*get_default_group) (GdkDisplay *display);
|
||||
gboolean (*supports_selection_notification) (GdkDisplay *display);
|
||||
gboolean (*request_selection_notification) (GdkDisplay *display,
|
||||
@@ -237,7 +239,6 @@ struct _GdkDisplayClass
|
||||
const gchar *text);
|
||||
|
||||
/* Signals */
|
||||
void (*opened) (GdkDisplay *display);
|
||||
void (*closed) (GdkDisplay *display,
|
||||
gboolean is_error);
|
||||
};
|
||||
|
||||
@@ -66,7 +66,7 @@ typedef enum
|
||||
/**
|
||||
* GdkDragProtocol:
|
||||
* @GDK_DRAG_PROTO_NONE: no protocol.
|
||||
* @GDK_DRAG_PROTO_MOTIF: The Motif DND protocol. No longer supported
|
||||
* @GDK_DRAG_PROTO_MOTIF: The Motif DND protocol.
|
||||
* @GDK_DRAG_PROTO_XDND: The Xdnd protocol.
|
||||
* @GDK_DRAG_PROTO_ROOTWIN: An extension to the Xdnd protocol for
|
||||
* unclaimed root window drops.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*** BEGIN file-header ***/
|
||||
#include "config.h"
|
||||
#define GDK_ENABLE_BROKEN
|
||||
#include "gdk.h"
|
||||
|
||||
/*** END file-header ***/
|
||||
|
||||
@@ -346,6 +346,8 @@ void _gdk_screen_close (GdkScreen *screen);
|
||||
void _gdk_cursor_destroy (GdkCursor *cursor);
|
||||
|
||||
extern const GOptionEntry _gdk_windowing_args[];
|
||||
gchar *_gdk_windowing_substitute_screen_number (const gchar *display_name,
|
||||
gint screen_number);
|
||||
|
||||
void _gdk_windowing_got_event (GdkDisplay *display,
|
||||
GList *event_link,
|
||||
|
||||
@@ -90,10 +90,7 @@ _gdk_keyval_from_name (const gchar *keyval_name)
|
||||
gdk_key *found;
|
||||
|
||||
g_return_val_if_fail (keyval_name != NULL, 0);
|
||||
|
||||
if (strncmp (keyval_name,"XF86", 4) == 0)
|
||||
keyval_name += 4;
|
||||
|
||||
|
||||
found = bsearch (keyval_name, gdk_keys_by_name,
|
||||
GDK_NUM_KEYS, sizeof (gdk_key),
|
||||
gdk_keys_name_compare);
|
||||
|
||||
@@ -189,6 +189,25 @@ gdk_keymap_init (GdkKeymap *keymap)
|
||||
/* Other key-handling stuff
|
||||
*/
|
||||
|
||||
/**
|
||||
* gdk_keyval_convert_case:
|
||||
* @symbol: a keyval
|
||||
* @lower: (out): return location for lowercase version of @symbol
|
||||
* @upper: (out): return location for uppercase version of @symbol
|
||||
*
|
||||
* Obtains the upper- and lower-case versions of the keyval @symbol.
|
||||
* Examples of keyvals are #GDK_KEY_a, #GDK_KEY_Enter, #GDK_KEY_F1, etc.
|
||||
*/
|
||||
void
|
||||
gdk_keyval_convert_case (guint symbol,
|
||||
guint *lower,
|
||||
guint *upper)
|
||||
{
|
||||
GdkDisplayManager *manager = gdk_display_manager_get ();
|
||||
|
||||
GDK_DISPLAY_MANAGER_GET_CLASS (manager)->keyval_convert_case (manager, symbol, lower, upper);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_keyval_to_upper:
|
||||
* @keyval: a key value.
|
||||
@@ -674,7 +693,6 @@ gdk_keymap_get_modifier_mask (GdkKeymap *keymap,
|
||||
return GDK_KEYMAP_GET_CLASS (keymap)->get_modifier_mask (keymap, intent);
|
||||
}
|
||||
|
||||
#include "gdkkeynames.c"
|
||||
|
||||
/**
|
||||
* gdk_keyval_name:
|
||||
@@ -693,7 +711,10 @@ gdk_keymap_get_modifier_mask (GdkKeymap *keymap,
|
||||
gchar *
|
||||
gdk_keyval_name (guint keyval)
|
||||
{
|
||||
return _gdk_keyval_name (keyval);
|
||||
GdkDisplayManager *manager = gdk_display_manager_get ();
|
||||
|
||||
return GDK_DISPLAY_MANAGER_GET_CLASS (manager)->get_keyval_name (manager,
|
||||
keyval);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -712,27 +733,20 @@ gdk_keyval_name (guint keyval)
|
||||
guint
|
||||
gdk_keyval_from_name (const gchar *keyval_name)
|
||||
{
|
||||
return _gdk_keyval_from_name (keyval_name);
|
||||
GdkDisplayManager *manager = gdk_display_manager_get ();
|
||||
|
||||
return GDK_DISPLAY_MANAGER_GET_CLASS (manager)->lookup_keyval (manager,
|
||||
keyval_name);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_keyval_convert_case:
|
||||
* @symbol: a keyval
|
||||
* @lower: (out): return location for lowercase version of @symbol
|
||||
* @upper: (out): return location for uppercase version of @symbol
|
||||
*
|
||||
* Obtains the upper- and lower-case versions of the keyval @symbol.
|
||||
* Examples of keyvals are #GDK_KEY_a, #GDK_KEY_Enter, #GDK_KEY_F1, etc.
|
||||
*/
|
||||
void
|
||||
gdk_keyval_convert_case (guint symbol,
|
||||
guint *lower,
|
||||
guint *upper)
|
||||
_gdk_display_manager_real_keyval_convert_case (GdkDisplayManager *manager,
|
||||
guint symbol,
|
||||
guint *lower,
|
||||
guint *upper)
|
||||
{
|
||||
guint xlower, xupper;
|
||||
|
||||
xlower = symbol;
|
||||
xupper = symbol;
|
||||
guint xlower = symbol;
|
||||
guint xupper = symbol;
|
||||
|
||||
/* Check for directly encoded 24-bit UCS characters: */
|
||||
if ((symbol & 0xff000000) == 0x01000000)
|
||||
|
||||
@@ -76,6 +76,11 @@ struct _GdkKeymap
|
||||
GdkDisplay *display;
|
||||
};
|
||||
|
||||
void _gdk_display_manager_real_keyval_convert_case (GdkDisplayManager *manager,
|
||||
guint symbol,
|
||||
guint *lower,
|
||||
guint *upper);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2278,7 +2278,6 @@
|
||||
#define GDK_TouchpadToggle 0x1008ffa9
|
||||
#define GDK_TouchpadOn 0x1008ffb0
|
||||
#define GDK_TouchpadOff 0x1008ffb1
|
||||
#define GDK_AudioMicMute 0x1008ffb2
|
||||
#define GDK_Switch_VT_1 0x1008fe01
|
||||
#define GDK_Switch_VT_2 0x1008fe02
|
||||
#define GDK_Switch_VT_3 0x1008fe03
|
||||
|
||||
@@ -2287,7 +2287,6 @@
|
||||
#define GDK_KEY_TouchpadToggle 0x1008ffa9
|
||||
#define GDK_KEY_TouchpadOn 0x1008ffb0
|
||||
#define GDK_KEY_TouchpadOff 0x1008ffb1
|
||||
#define GDK_KEY_AudioMicMute 0x1008ffb2
|
||||
#define GDK_KEY_Switch_VT_1 0x1008fe01
|
||||
#define GDK_KEY_Switch_VT_2 0x1008fe02
|
||||
#define GDK_KEY_Switch_VT_3 0x1008fe03
|
||||
|
||||
@@ -65,7 +65,15 @@ void gdk_error_trap_pop_ignored (void);
|
||||
|
||||
const gchar * gdk_get_display_arg_name (void);
|
||||
|
||||
GDK_DEPRECATED_IN_3_8_FOR(gdk_display_get_name (gdk_display_get_default ()))
|
||||
/**
|
||||
* gdk_get_display:
|
||||
*
|
||||
* Gets the name of the display, which usually comes from the
|
||||
* <envar>DISPLAY</envar> environment variable or the
|
||||
* <option>--display</option> command line option.
|
||||
*
|
||||
* Returns: the name of the display.
|
||||
*/
|
||||
gchar* gdk_get_display (void);
|
||||
|
||||
#ifndef GDK_MULTIDEVICE_SAFE
|
||||
@@ -109,9 +117,6 @@ void gdk_flush (void);
|
||||
|
||||
void gdk_disable_multidevice (void);
|
||||
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
void gdk_set_allowed_backends (const gchar *backends);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_MAIN_H__ */
|
||||
|
||||
@@ -713,16 +713,6 @@ gdk_offscreen_window_process_updates_recurse (GdkWindow *window,
|
||||
_gdk_window_process_updates_recurse (window, region);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_offscreen_window_get_frame_extents (GdkWindow *window,
|
||||
GdkRectangle *rect)
|
||||
{
|
||||
rect->x = window->x;
|
||||
rect->y = window->y;
|
||||
rect->width = window->width;
|
||||
rect->height = window->height;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
|
||||
{
|
||||
@@ -773,7 +763,7 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
|
||||
impl_class->set_startup_id = gdk_offscreen_window_set_string;
|
||||
impl_class->set_transient_for = gdk_offscreen_window_set_transient_for;
|
||||
impl_class->get_root_origin = NULL;
|
||||
impl_class->get_frame_extents = gdk_offscreen_window_get_frame_extents;
|
||||
impl_class->get_frame_extents = NULL;
|
||||
impl_class->set_override_redirect = NULL;
|
||||
impl_class->set_accept_focus = NULL;
|
||||
impl_class->set_focus_on_map = gdk_offscreen_window_set_boolean;
|
||||
|
||||
@@ -29,8 +29,6 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
const char * _gdk_atom_name_const (GdkAtom atom);
|
||||
|
||||
void gdk_window_destroy_notify (GdkWindow *window);
|
||||
|
||||
void gdk_synthesize_window_state (GdkWindow *window,
|
||||
|
||||
@@ -1,254 +0,0 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
* Copyright (C) 2000 Red Hat, Inc.
|
||||
* 2005 Imendio AB
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkproperty.h"
|
||||
|
||||
#include "gdkprivate.h"
|
||||
|
||||
/**
|
||||
* SECTION:properties
|
||||
* @Short_description: Functions to manipulate properties on windows
|
||||
* @Title: Properties and Atoms
|
||||
*
|
||||
* Each window under X can have any number of associated
|
||||
* <firstterm>properties</firstterm> attached to it.
|
||||
* Properties are arbitrary chunks of data identified by
|
||||
* <firstterm>atom</firstterm>s. (An <firstterm>atom</firstterm>
|
||||
* is a numeric index into a string table on the X server. They are used
|
||||
* to transfer strings efficiently between clients without
|
||||
* having to transfer the entire string.) A property
|
||||
* has an associated type, which is also identified
|
||||
* using an atom.
|
||||
*
|
||||
* A property has an associated <firstterm>format</firstterm>,
|
||||
* an integer describing how many bits are in each unit
|
||||
* of data inside the property. It must be 8, 16, or 32.
|
||||
* When data is transferred between the server and client,
|
||||
* if they are of different endianesses it will be byteswapped
|
||||
* as necessary according to the format of the property.
|
||||
* Note that on the client side, properties of format 32
|
||||
* will be stored with one unit per <emphasis>long</emphasis>,
|
||||
* even if a long integer has more than 32 bits on the platform.
|
||||
* (This decision was apparently made for Xlib to maintain
|
||||
* compatibility with programs that assumed longs were 32
|
||||
* bits, at the expense of programs that knew better.)
|
||||
*
|
||||
* The functions in this section are used to add, remove
|
||||
* and change properties on windows, to convert atoms
|
||||
* to and from strings and to manipulate some types of
|
||||
* data commonly stored in X window properties.
|
||||
*/
|
||||
|
||||
static GHashTable *names_to_atoms;
|
||||
static GPtrArray *atoms_to_names;
|
||||
|
||||
static const gchar xatoms_string[] =
|
||||
/* These are all the standard predefined X atoms */
|
||||
"NONE\0"
|
||||
"PRIMARY\0"
|
||||
"SECONDARY\0"
|
||||
"ARC\0"
|
||||
"ATOM\0"
|
||||
"BITMAP\0"
|
||||
"CARDINAL\0"
|
||||
"COLORMAP\0"
|
||||
"CURSOR\0"
|
||||
"CUT_BUFFER0\0"
|
||||
"CUT_BUFFER1\0"
|
||||
"CUT_BUFFER2\0"
|
||||
"CUT_BUFFER3\0"
|
||||
"CUT_BUFFER4\0"
|
||||
"CUT_BUFFER5\0"
|
||||
"CUT_BUFFER6\0"
|
||||
"CUT_BUFFER7\0"
|
||||
"DRAWABLE\0"
|
||||
"FONT\0"
|
||||
"INTEGER\0"
|
||||
"PIXMAP\0"
|
||||
"POINT\0"
|
||||
"RECTANGLE\0"
|
||||
"RESOURCE_MANAGER\0"
|
||||
"RGB_COLOR_MAP\0"
|
||||
"RGB_BEST_MAP\0"
|
||||
"RGB_BLUE_MAP\0"
|
||||
"RGB_DEFAULT_MAP\0"
|
||||
"RGB_GRAY_MAP\0"
|
||||
"RGB_GREEN_MAP\0"
|
||||
"RGB_RED_MAP\0"
|
||||
"STRING\0"
|
||||
"VISUALID\0"
|
||||
"WINDOW\0"
|
||||
"WM_COMMAND\0"
|
||||
"WM_HINTS\0"
|
||||
"WM_CLIENT_MACHINE\0"
|
||||
"WM_ICON_NAME\0"
|
||||
"WM_ICON_SIZE\0"
|
||||
"WM_NAME\0"
|
||||
"WM_NORMAL_HINTS\0"
|
||||
"WM_SIZE_HINTS\0"
|
||||
"WM_ZOOM_HINTS\0"
|
||||
"MIN_SPACE\0"
|
||||
"NORM_SPACE\0"
|
||||
"MAX_SPACE\0"
|
||||
"END_SPACE\0"
|
||||
"SUPERSCRIPT_X\0"
|
||||
"SUPERSCRIPT_Y\0"
|
||||
"SUBSCRIPT_X\0"
|
||||
"SUBSCRIPT_Y\0"
|
||||
"UNDERLINE_POSITION\0"
|
||||
"UNDERLINE_THICKNESS\0"
|
||||
"STRIKEOUT_ASCENT\0"
|
||||
"STRIKEOUT_DESCENT\0"
|
||||
"ITALIC_ANGLE\0"
|
||||
"X_HEIGHT\0"
|
||||
"QUAD_WIDTH\0"
|
||||
"WEIGHT\0"
|
||||
"POINT_SIZE\0"
|
||||
"RESOLUTION\0"
|
||||
"COPYRIGHT\0"
|
||||
"NOTICE\0"
|
||||
"FONT_NAME\0"
|
||||
"FAMILY_NAME\0"
|
||||
"FULL_NAME\0"
|
||||
"CAP_HEIGHT\0"
|
||||
"WM_CLASS\0"
|
||||
"WM_TRANSIENT_FOR\0"
|
||||
"CLIPBOARD\0" /* = 69 */;
|
||||
|
||||
static const gint xatoms_offset[] = {
|
||||
0, 5, 13, 23, 27, 32, 39, 48, 57, 64, 76, 88,
|
||||
100, 112, 124, 136, 148, 160, 169, 174, 182, 189, 195, 205,
|
||||
222, 236, 249, 262, 278, 291, 305, 317, 324, 333, 340, 351,
|
||||
360, 378, 391, 404, 412, 428, 442, 456, 466, 477, 487, 497,
|
||||
511, 525, 537, 549, 568, 588, 605, 623, 636, 645, 656, 663,
|
||||
674, 685, 695, 702, 712, 724, 734, 745, 754, 771
|
||||
};
|
||||
|
||||
static void
|
||||
ensure_atom_tables (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (names_to_atoms)
|
||||
return;
|
||||
|
||||
names_to_atoms = g_hash_table_new (g_str_hash, g_str_equal);
|
||||
atoms_to_names = g_ptr_array_sized_new (G_N_ELEMENTS (xatoms_offset));
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (xatoms_offset); i++)
|
||||
{
|
||||
g_hash_table_insert(names_to_atoms, (gchar *)xatoms_string + xatoms_offset[i], GINT_TO_POINTER (i));
|
||||
g_ptr_array_add(atoms_to_names, (gchar *)xatoms_string + xatoms_offset[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static GdkAtom
|
||||
intern_atom_internal (const gchar *atom_name, gboolean allocate)
|
||||
{
|
||||
gpointer result;
|
||||
gchar *name;
|
||||
|
||||
ensure_atom_tables ();
|
||||
|
||||
if (g_hash_table_lookup_extended (names_to_atoms, atom_name, NULL, &result))
|
||||
return result;
|
||||
|
||||
result = GINT_TO_POINTER (atoms_to_names->len);
|
||||
name = allocate ? g_strdup (atom_name) : (gchar *)atom_name;
|
||||
g_hash_table_insert(names_to_atoms, name, result);
|
||||
g_ptr_array_add(atoms_to_names, name);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_atom_intern:
|
||||
* @atom_name: a string.
|
||||
* @only_if_exists: if %TRUE, GDK is allowed to not create a new atom, but
|
||||
* just return %GDK_NONE if the requested atom doesn't already
|
||||
* exists. Currently, the flag is ignored, since checking the
|
||||
* existance of an atom is as expensive as creating it.
|
||||
*
|
||||
* Finds or creates an atom corresponding to a given string.
|
||||
*
|
||||
* Returns: (transfer none): the atom corresponding to @atom_name.
|
||||
*/
|
||||
GdkAtom
|
||||
gdk_atom_intern (const gchar *atom_name,
|
||||
gboolean only_if_exists)
|
||||
{
|
||||
g_return_val_if_fail (atom_name != NULL, GDK_NONE);
|
||||
|
||||
return intern_atom_internal (atom_name, TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_atom_intern_static_string:
|
||||
* @atom_name: a static string
|
||||
*
|
||||
* Finds or creates an atom corresponding to a given string.
|
||||
*
|
||||
* Note that this function is identical to gdk_atom_intern() except
|
||||
* that if a new #GdkAtom is created the string itself is used rather
|
||||
* than a copy. This saves memory, but can only be used if the string
|
||||
* will <emphasis>always</emphasis> exist. It can be used with statically
|
||||
* allocated strings in the main program, but not with statically
|
||||
* allocated memory in dynamically loaded modules, if you expect to
|
||||
* ever unload the module again (e.g. do not use this function in
|
||||
* GTK+ theme engines).
|
||||
*
|
||||
* Returns: (transfer none): the atom corresponding to @atom_name
|
||||
*
|
||||
* Since: 2.10
|
||||
*/
|
||||
GdkAtom
|
||||
gdk_atom_intern_static_string (const gchar *atom_name)
|
||||
{
|
||||
g_return_val_if_fail (atom_name != NULL, GDK_NONE);
|
||||
|
||||
return intern_atom_internal (atom_name, FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_atom_name:
|
||||
* @atom: a #GdkAtom.
|
||||
*
|
||||
* Determines the string corresponding to an atom.
|
||||
*
|
||||
* Returns: a newly-allocated string containing the string
|
||||
* corresponding to @atom. When you are done with the
|
||||
* return value, you should free it using g_free().
|
||||
*/
|
||||
gchar *
|
||||
gdk_atom_name (GdkAtom atom)
|
||||
{
|
||||
return g_strdup (_gdk_atom_name_const (atom));
|
||||
}
|
||||
|
||||
const gchar *
|
||||
_gdk_atom_name_const (GdkAtom atom)
|
||||
{
|
||||
ensure_atom_tables ();
|
||||
|
||||
if (GPOINTER_TO_INT (atom) >= atoms_to_names->len)
|
||||
return NULL;
|
||||
|
||||
return g_ptr_array_index (atoms_to_names, GPOINTER_TO_INT (atom));
|
||||
}
|
||||
@@ -297,8 +297,8 @@ typedef enum
|
||||
* viewable.
|
||||
* @GDK_GRAB_FROZEN: the resource is frozen by an active grab of another client.
|
||||
*
|
||||
* Returned by gdk_device_grab(), gdk_pointer_grab() and gdk_keyboard_grab() to
|
||||
* indicate success or the reason for the failure of the grab attempt.
|
||||
* Returned by gdk_pointer_grab() and gdk_keyboard_grab() to indicate
|
||||
* success or the reason for the failure of the grab attempt.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
|
||||
@@ -100,16 +100,6 @@
|
||||
*/
|
||||
#define GDK_VERSION_3_8 (G_ENCODE_VERSION (3, 8))
|
||||
|
||||
/**
|
||||
* GDK_VERSION_3_10:
|
||||
*
|
||||
* A macro that evaluates to the 3.10 version of GDK, in a format
|
||||
* that can be used by the C pre-processor.
|
||||
*
|
||||
* Since: 3.10
|
||||
*/
|
||||
#define GDK_VERSION_3_10 (G_ENCODE_VERSION (3, 10))
|
||||
|
||||
|
||||
/* evaluates to the current stable version; for development cycles,
|
||||
* this means the next stable target
|
||||
@@ -251,18 +241,4 @@
|
||||
# define GDK_AVAILABLE_IN_3_8
|
||||
#endif
|
||||
|
||||
#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_10
|
||||
# define GDK_DEPRECATED_IN_3_10 GDK_DEPRECATED
|
||||
# define GDK_DEPRECATED_IN_3_10_FOR(f) GDK_DEPRECATED_FOR(f)
|
||||
#else
|
||||
# define GDK_DEPRECATED_IN_3_10
|
||||
# define GDK_DEPRECATED_IN_3_10_FOR(f)
|
||||
#endif
|
||||
|
||||
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_10
|
||||
# define GDK_AVAILABLE_IN_3_10 GDK_UNAVAILABLE(3, 10)
|
||||
#else
|
||||
# define GDK_AVAILABLE_IN_3_10
|
||||
#endif
|
||||
|
||||
#endif /* __GDK_VERSION_MACROS_H__ */
|
||||
|
||||
@@ -42,9 +42,6 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
/* for the use of round() */
|
||||
#include "fallback-c89.c"
|
||||
|
||||
#undef DEBUG_WINDOW_PRINTING
|
||||
|
||||
|
||||
@@ -940,26 +937,19 @@ static void
|
||||
apply_clip_as_shape (GdkWindow *window)
|
||||
{
|
||||
GdkRectangle r;
|
||||
cairo_region_t *region;
|
||||
|
||||
r.x = r.y = 0;
|
||||
r.width = window->width;
|
||||
r.height = window->height;
|
||||
|
||||
region = cairo_region_copy (window->clip_region);
|
||||
if (window->layered_region)
|
||||
cairo_region_subtract (region, window->layered_region);
|
||||
|
||||
/* We only apply the clip region if would differ
|
||||
from the actual clip region implied by the size
|
||||
of the window. This is to avoid unneccessarily
|
||||
adding meaningless shapes to all native subwindows */
|
||||
if (!region_rect_equal (region, &r))
|
||||
apply_shape (window, region);
|
||||
if (!region_rect_equal (window->clip_region, &r))
|
||||
apply_shape (window, window->clip_region);
|
||||
else
|
||||
apply_shape (window, NULL);
|
||||
|
||||
cairo_region_destroy (region);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -3499,22 +3489,24 @@ static void
|
||||
gdk_window_flush_outstanding_moves (GdkWindow *window)
|
||||
{
|
||||
GdkWindow *impl_window;
|
||||
GList *l, *outstanding;
|
||||
GdkWindowRegionMove *move;
|
||||
|
||||
impl_window = gdk_window_get_impl_window (window);
|
||||
outstanding = impl_window->outstanding_moves;
|
||||
impl_window->outstanding_moves = NULL;
|
||||
|
||||
while (impl_window->outstanding_moves)
|
||||
for (l = outstanding; l != NULL; l = l->next)
|
||||
{
|
||||
move = impl_window->outstanding_moves->data;
|
||||
impl_window->outstanding_moves =
|
||||
g_list_delete_link (impl_window->outstanding_moves,
|
||||
impl_window->outstanding_moves);
|
||||
move = l->data;
|
||||
|
||||
do_move_region_bits_on_impl (impl_window,
|
||||
move->dest_region, move->dx, move->dy);
|
||||
|
||||
gdk_window_region_move_free (move);
|
||||
}
|
||||
|
||||
g_list_free (outstanding);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4070,7 +4062,6 @@ gdk_window_process_updates_internal (GdkWindow *window)
|
||||
GdkWindowImplClass *impl_class;
|
||||
gboolean save_region = FALSE;
|
||||
GdkRectangle clip_box;
|
||||
int iteration;
|
||||
|
||||
/* Ensure the window lives while updating it */
|
||||
g_object_ref (window);
|
||||
@@ -4078,15 +4069,8 @@ gdk_window_process_updates_internal (GdkWindow *window)
|
||||
/* If an update got queued during update processing, we can get a
|
||||
* window in the update queue that has an empty update_area.
|
||||
* just ignore it.
|
||||
*
|
||||
* We run this multiple times if needed because on win32 the
|
||||
* first run can cause new (synchronous) updates from
|
||||
* gdk_window_flush_outstanding_moves(). However, we
|
||||
* limit it to two iterations to avoid any potential loops.
|
||||
*/
|
||||
iteration = 0;
|
||||
while (window->update_area &&
|
||||
iteration++ < 2)
|
||||
if (window->update_area)
|
||||
{
|
||||
cairo_region_t *update_area = window->update_area;
|
||||
window->update_area = NULL;
|
||||
@@ -10012,9 +9996,6 @@ gdk_window_print (GdkWindow *window,
|
||||
g_print (" alpha[%d]",
|
||||
window->alpha);
|
||||
|
||||
if (window->has_alpha_background)
|
||||
g_print (" alpha_bg");
|
||||
|
||||
s = print_region (window->clip_region);
|
||||
g_print (" clipbox[%s]", s);
|
||||
|
||||
|
||||
7591
gdk/keyname-table.h
7591
gdk/keyname-table.h
File diff suppressed because it is too large
Load Diff
@@ -1,65 +1,28 @@
|
||||
BackSpace
|
||||
Tab
|
||||
Return
|
||||
Pause
|
||||
Scroll_Lock
|
||||
Sys_Req
|
||||
Escape
|
||||
Multi_key
|
||||
Home
|
||||
Left
|
||||
Up
|
||||
Right
|
||||
Down
|
||||
Page_Up
|
||||
Page_Down
|
||||
End
|
||||
Begin
|
||||
Print
|
||||
Insert
|
||||
Num_Lock
|
||||
KP_Space
|
||||
KP_Tab
|
||||
KP_Enter
|
||||
KP_Home
|
||||
KP_Left
|
||||
KP_Up
|
||||
KP_Right
|
||||
KP_Down
|
||||
KP_Page_Up
|
||||
KP_Prior
|
||||
KP_Page_Down
|
||||
KP_Next
|
||||
KP_End
|
||||
KP_Begin
|
||||
KP_Insert
|
||||
KP_Delete
|
||||
Delete
|
||||
MonBrightnessUp
|
||||
MonBrightnessDown
|
||||
KbdBrightnessUp
|
||||
KbdBrightnessDown
|
||||
AudioMute
|
||||
AudioLowerVolume
|
||||
AudioRaiseVolume
|
||||
AudioPlay
|
||||
AudioStop
|
||||
AudioNext
|
||||
AudioPrev
|
||||
AudioRecord
|
||||
AudioPause
|
||||
AudioRewind
|
||||
AudioMedia
|
||||
ScreenSaver
|
||||
Battery
|
||||
Launch1
|
||||
Forward
|
||||
Back
|
||||
Sleep
|
||||
Hibernate
|
||||
WLAN
|
||||
WebCam
|
||||
Display
|
||||
TouchpadToggle
|
||||
WakeUp
|
||||
Suspend
|
||||
XF86MonBrightnessUp
|
||||
XF86MonBrightnessDown
|
||||
XF86KbdBrightnessUp
|
||||
XF86KbdBrightnessDown
|
||||
XF86AudioMute
|
||||
XF86AudioLowerVolume
|
||||
XF86AudioRaiseVolume
|
||||
XF86AudioPlay
|
||||
XF86AudioStop
|
||||
XF86AudioNext
|
||||
XF86AudioPrev
|
||||
XF86AudioRecord
|
||||
XF86AudioPause
|
||||
XF86AudioRewind
|
||||
XF86AudioMedia
|
||||
XF86ScreenSaver
|
||||
XF86Battery
|
||||
XF86Launch1
|
||||
XF86Forward
|
||||
XF86Back
|
||||
XF86Sleep
|
||||
XF86Hibernate
|
||||
XF86WLAN
|
||||
XF86WebCam
|
||||
XF86Display
|
||||
XF86TouchpadToggle
|
||||
XF86WakeUp
|
||||
XF86Suspend
|
||||
|
||||
1069
gdk/keynames.txt
1069
gdk/keynames.txt
File diff suppressed because it is too large
Load Diff
@@ -134,7 +134,8 @@ _gdk_quartz_display_open (const gchar *display_name)
|
||||
_gdk_quartz_dnd_init ();
|
||||
#endif
|
||||
|
||||
g_signal_emit_by_name (_gdk_display, "opened");
|
||||
g_signal_emit_by_name (gdk_display_manager_get (),
|
||||
"display_opened", _gdk_display);
|
||||
|
||||
return _gdk_display;
|
||||
}
|
||||
@@ -154,6 +155,24 @@ gdk_quartz_display_get_name (GdkDisplay *display)
|
||||
return display_name;
|
||||
}
|
||||
|
||||
static gint
|
||||
gdk_quartz_display_get_n_screens (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), 0);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static GdkScreen *
|
||||
gdk_quartz_display_get_screen (GdkDisplay *display,
|
||||
gint screen_num)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
g_return_val_if_fail (screen_num == 0, NULL);
|
||||
|
||||
return _gdk_screen;
|
||||
}
|
||||
|
||||
static GdkScreen *
|
||||
gdk_quartz_display_get_default_screen (GdkDisplay *display)
|
||||
{
|
||||
@@ -264,6 +283,8 @@ G_DEFINE_TYPE (GdkQuartzDisplay, gdk_quartz_display, GDK_TYPE_DISPLAY)
|
||||
static void
|
||||
gdk_quartz_display_init (GdkQuartzDisplay *display)
|
||||
{
|
||||
_gdk_quartz_display_manager_add_display (gdk_display_manager_get (),
|
||||
GDK_DISPLAY_OBJECT (display));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -271,6 +292,9 @@ gdk_quartz_display_dispose (GObject *object)
|
||||
{
|
||||
GdkQuartzDisplay *display_quartz = GDK_QUARTZ_DISPLAY (object);
|
||||
|
||||
_gdk_quartz_display_manager_remove_display (gdk_display_manager_get (),
|
||||
GDK_DISPLAY_OBJECT (object));
|
||||
|
||||
g_list_foreach (display_quartz->input_devices,
|
||||
(GFunc) g_object_run_dispose, NULL);
|
||||
|
||||
@@ -299,6 +323,8 @@ gdk_quartz_display_class_init (GdkQuartzDisplayClass *class)
|
||||
display_class->window_type = GDK_TYPE_QUARTZ_WINDOW;
|
||||
|
||||
display_class->get_name = gdk_quartz_display_get_name;
|
||||
display_class->get_n_screens = gdk_quartz_display_get_n_screens;
|
||||
display_class->get_screen = gdk_quartz_display_get_screen;
|
||||
display_class->get_default_screen = gdk_quartz_display_get_default_screen;
|
||||
display_class->beep = gdk_quartz_display_beep;
|
||||
display_class->sync = gdk_quartz_display_sync;
|
||||
|
||||
@@ -35,11 +35,60 @@
|
||||
struct _GdkQuartzDisplayManager
|
||||
{
|
||||
GdkDisplayManager parent;
|
||||
|
||||
GdkDisplay *default_display;
|
||||
GSList *displays;
|
||||
};
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GdkQuartzDisplayManager, gdk_quartz_display_manager, GDK_TYPE_DISPLAY_MANAGER)
|
||||
|
||||
static GdkDisplay *
|
||||
gdk_quartz_display_manager_open_display (GdkDisplayManager *manager,
|
||||
const gchar *name)
|
||||
{
|
||||
return _gdk_quartz_display_open (name);
|
||||
}
|
||||
|
||||
static GSList *
|
||||
gdk_quartz_display_manager_list_displays (GdkDisplayManager *manager)
|
||||
{
|
||||
GdkQuartzDisplayManager *manager_quartz = GDK_QUARTZ_DISPLAY_MANAGER (manager);
|
||||
|
||||
return g_slist_copy (manager_quartz->displays);
|
||||
}
|
||||
|
||||
static GdkDisplay *
|
||||
gdk_quartz_display_manager_get_default_display (GdkDisplayManager *manager)
|
||||
{
|
||||
return GDK_QUARTZ_DISPLAY_MANAGER (manager)->default_display;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_quartz_display_manager_set_default_display (GdkDisplayManager *manager,
|
||||
GdkDisplay *display)
|
||||
{
|
||||
GdkQuartzDisplayManager *manager_quartz = GDK_QUARTZ_DISPLAY_MANAGER (manager);
|
||||
|
||||
manager_quartz->default_display = display;
|
||||
}
|
||||
|
||||
#include "../gdkkeynames.c"
|
||||
|
||||
static gchar *
|
||||
gdk_quartz_display_manager_get_keyval_name (GdkDisplayManager *manager,
|
||||
guint keyval)
|
||||
{
|
||||
return _gdk_keyval_name (keyval);
|
||||
}
|
||||
|
||||
static guint
|
||||
gdk_quartz_display_manager_lookup_keyval (GdkDisplayManager *manager,
|
||||
const gchar *name)
|
||||
{
|
||||
return _gdk_keyval_from_name (name);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_quartz_display_manager_init (GdkQuartzDisplayManager *manager)
|
||||
{
|
||||
@@ -72,6 +121,41 @@ gdk_quartz_display_manager_class_init (GdkQuartzDisplayManagerClass *class)
|
||||
|
||||
object_class->finalize = gdk_quartz_display_manager_finalize;
|
||||
|
||||
manager_class->open_display = gdk_quartz_display_manager_open_display;
|
||||
manager_class->list_displays = gdk_quartz_display_manager_list_displays;
|
||||
manager_class->set_default_display = gdk_quartz_display_manager_set_default_display;
|
||||
manager_class->get_default_display = gdk_quartz_display_manager_get_default_display;
|
||||
manager_class->atom_intern = _gdk_quartz_display_manager_atom_intern;
|
||||
manager_class->get_atom_name = _gdk_quartz_display_manager_get_atom_name;
|
||||
manager_class->lookup_keyval = gdk_quartz_display_manager_lookup_keyval;
|
||||
manager_class->get_keyval_name = gdk_quartz_display_manager_get_keyval_name;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_quartz_display_manager_add_display (GdkDisplayManager *manager,
|
||||
GdkDisplay *display)
|
||||
{
|
||||
GdkQuartzDisplayManager *manager_quartz = GDK_QUARTZ_DISPLAY_MANAGER (manager);
|
||||
|
||||
if (manager_quartz->displays == NULL)
|
||||
gdk_display_manager_set_default_display (manager, display);
|
||||
|
||||
manager_quartz->displays = g_slist_prepend (manager_quartz->displays, display);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_quartz_display_manager_remove_display (GdkDisplayManager *manager,
|
||||
GdkDisplay *display)
|
||||
{
|
||||
GdkQuartzDisplayManager *manager_quartz = GDK_QUARTZ_DISPLAY_MANAGER (manager);
|
||||
|
||||
manager_quartz->displays = g_slist_remove (manager_quartz->displays, display);
|
||||
|
||||
if (manager_quartz->default_display == display)
|
||||
{
|
||||
if (manager_quartz->displays)
|
||||
gdk_display_manager_set_default_display (manager, manager_quartz->displays->data);
|
||||
else
|
||||
gdk_display_manager_set_default_display (manager, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,6 +155,12 @@ gchar * _gdk_quartz_display_utf8_to_string_target (GdkDisplay *disp
|
||||
const gchar *str);
|
||||
|
||||
|
||||
/* Display manager */
|
||||
void _gdk_quartz_display_manager_add_display (GdkDisplayManager *manager,
|
||||
GdkDisplay *display);
|
||||
void _gdk_quartz_display_manager_remove_display (GdkDisplayManager *manager,
|
||||
GdkDisplay *display);
|
||||
|
||||
/* Display manager methods - events */
|
||||
GdkAtom _gdk_quartz_display_manager_atom_intern (GdkDisplayManager *manager,
|
||||
const gchar *atom_name,
|
||||
|
||||
@@ -55,10 +55,6 @@ typedef enum
|
||||
|
||||
GdkOSXVersion gdk_quartz_osx_version (void);
|
||||
|
||||
GdkAtom gdk_quartz_pasteboard_type_to_atom_libgtk_only (NSString *type);
|
||||
NSString *gdk_quartz_target_to_pasteboard_type_libgtk_only (const gchar *target);
|
||||
NSString *gdk_quartz_atom_to_pasteboard_type_libgtk_only (GdkAtom atom);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#define __GDKQUARTZ_H_INSIDE__
|
||||
|
||||
@@ -301,6 +301,16 @@ gdk_quartz_screen_get_number (GdkScreen *screen)
|
||||
return 0;
|
||||
}
|
||||
|
||||
gchar *
|
||||
_gdk_windowing_substitute_screen_number (const gchar *display_name,
|
||||
int screen_number)
|
||||
{
|
||||
if (screen_number != 0)
|
||||
return NULL;
|
||||
|
||||
return g_strdup (display_name);
|
||||
}
|
||||
|
||||
static gint
|
||||
gdk_quartz_screen_get_width (GdkScreen *screen)
|
||||
{
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
#include "gdkselection.h"
|
||||
#include "gdkproperty.h"
|
||||
#include "gdkquartz.h"
|
||||
|
||||
gboolean
|
||||
_gdk_quartz_display_set_selection_owner (GdkDisplay *display,
|
||||
@@ -172,42 +171,3 @@ _gdk_quartz_display_text_property_to_utf8_list (GdkDisplay *display,
|
||||
}
|
||||
}
|
||||
|
||||
GdkAtom
|
||||
gdk_quartz_pasteboard_type_to_atom_libgtk_only (NSString *type)
|
||||
{
|
||||
if ([type isEqualToString:NSStringPboardType])
|
||||
return gdk_atom_intern_static_string ("UTF8_STRING");
|
||||
else if ([type isEqualToString:NSTIFFPboardType])
|
||||
return gdk_atom_intern_static_string ("image/tiff");
|
||||
else if ([type isEqualToString:NSColorPboardType])
|
||||
return gdk_atom_intern_static_string ("application/x-color");
|
||||
else if ([type isEqualToString:NSURLPboardType])
|
||||
return gdk_atom_intern_static_string ("text/uri-list");
|
||||
else
|
||||
return gdk_atom_intern ([type UTF8String], FALSE);
|
||||
}
|
||||
|
||||
NSString *
|
||||
gdk_quartz_target_to_pasteboard_type_libgtk_only (const char *target)
|
||||
{
|
||||
if (strcmp (target, "UTF8_STRING") == 0)
|
||||
return NSStringPboardType;
|
||||
else if (strcmp (target, "image/tiff") == 0)
|
||||
return NSTIFFPboardType;
|
||||
else if (strcmp (target, "application/x-color") == 0)
|
||||
return NSColorPboardType;
|
||||
else if (strcmp (target, "text/uri-list") == 0)
|
||||
return NSURLPboardType;
|
||||
else
|
||||
return [NSString stringWithUTF8String:target];
|
||||
}
|
||||
|
||||
NSString *
|
||||
gdk_quartz_atom_to_pasteboard_type_libgtk_only (GdkAtom atom)
|
||||
{
|
||||
gchar *target = gdk_atom_name (atom);
|
||||
NSString *ret = gdk_quartz_target_to_pasteboard_type_libgtk_only (target);
|
||||
g_free (target);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -2642,11 +2642,9 @@ gdk_quartz_window_set_decorations (GdkWindow *window,
|
||||
* NSTitledWindowMask. This behaved extremely oddly when
|
||||
* conditionalized upon that and since it has no side effects (i.e.
|
||||
* if NSTitledWindowMask is not requested, the title will not be
|
||||
* displayed) just do it unconditionally. We also must null check
|
||||
* 'title' before setting it to avoid crashing.
|
||||
* displayed) just do it unconditionally.
|
||||
*/
|
||||
if (title)
|
||||
[impl->toplevel setTitle:title];
|
||||
[impl->toplevel setTitle:title];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2666,8 +2664,7 @@ gdk_quartz_window_set_decorations (GdkWindow *window,
|
||||
screen:screen];
|
||||
[impl->toplevel setHasShadow: window_type_hint_to_shadow (impl->type_hint)];
|
||||
[impl->toplevel setLevel: window_type_hint_to_level (impl->type_hint)];
|
||||
if (title)
|
||||
[impl->toplevel setTitle:title];
|
||||
[impl->toplevel setTitle:title];
|
||||
[impl->toplevel setBackgroundColor:bg];
|
||||
[impl->toplevel setHidesOnDeactivate: window_type_hint_to_hides_on_deactivate (impl->type_hint)];
|
||||
[impl->toplevel setContentView:old_view];
|
||||
|
||||
@@ -31,10 +31,6 @@ TEST_PROGS += display
|
||||
display_SOURCES = display.c
|
||||
display_LDADD = $(progs_ldadd)
|
||||
|
||||
TEST_PROGS += keysyms
|
||||
keysyms_SOURCES = keysyms.c
|
||||
keysyms_LDADD = $(progs_ldadd)
|
||||
|
||||
CLEANFILES = \
|
||||
cairosurface.png \
|
||||
gdksurface.png
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
#include <locale.h>
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
static void
|
||||
test_keysyms_basic (void)
|
||||
{
|
||||
struct {
|
||||
guint keyval;
|
||||
const gchar *name;
|
||||
const gchar *other_name;
|
||||
} tests[] = {
|
||||
{ GDK_KEY_space, "space", NULL },
|
||||
{ GDK_KEY_a, "a", NULL },
|
||||
{ GDK_KEY_Thorn, "Thorn", "THORN" },
|
||||
{ GDK_KEY_Hangul_J_RieulTieut, "Hangul_J_RieulTieut", NULL },
|
||||
{ GDK_KEY_Page_Up, "Page_Up", NULL },
|
||||
{ GDK_KEY_KP_Multiply, "KP_Multiply", NULL },
|
||||
{ GDK_KEY_MonBrightnessUp, "MonBrightnessUp", NULL },
|
||||
{ 0, NULL }
|
||||
};
|
||||
gint i;
|
||||
|
||||
for (i = 0; tests[i].keyval != 0; i++)
|
||||
{
|
||||
g_assert_cmpstr (gdk_keyval_name (tests[i].keyval), ==, tests[i].name);
|
||||
g_assert_cmpuint (gdk_keyval_from_name (tests[i].name), ==, tests[i].keyval);
|
||||
if (tests[i].other_name)
|
||||
g_assert_cmpuint (gdk_keyval_from_name (tests[i].other_name), ==, tests[i].keyval);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
test_keysyms_void (void)
|
||||
{
|
||||
g_assert_cmpuint (gdk_keyval_from_name ("NoSuchKeysym"), ==, GDK_KEY_VoidSymbol);
|
||||
g_assert_cmpstr (gdk_keyval_name (GDK_KEY_VoidSymbol), ==, "0xffffff");
|
||||
}
|
||||
|
||||
static void
|
||||
test_keysyms_xf86 (void)
|
||||
{
|
||||
g_assert_cmpuint (gdk_keyval_from_name ("XF86MonBrightnessUp"), ==, GDK_KEY_MonBrightnessUp);
|
||||
g_assert_cmpuint (gdk_keyval_from_name ("XF86MonBrightnessDown"), ==, GDK_KEY_MonBrightnessDown);
|
||||
g_assert_cmpuint (gdk_keyval_from_name ("XF86KbdBrightnessUp"), ==, GDK_KEY_KbdBrightnessUp);
|
||||
g_assert_cmpuint (gdk_keyval_from_name ("XF86KbdBrightnessDown"), ==, GDK_KEY_KbdBrightnessDown);
|
||||
g_assert_cmpuint (gdk_keyval_from_name ("XF86Battery"), ==, GDK_KEY_Battery);
|
||||
g_assert_cmpuint (gdk_keyval_from_name ("XF86Display"), ==, GDK_KEY_Display);
|
||||
|
||||
g_assert_cmpuint (gdk_keyval_from_name ("MonBrightnessUp"), ==, GDK_KEY_MonBrightnessUp);
|
||||
g_assert_cmpuint (gdk_keyval_from_name ("MonBrightnessDown"), ==, GDK_KEY_MonBrightnessDown);
|
||||
g_assert_cmpuint (gdk_keyval_from_name ("KbdBrightnessUp"), ==, GDK_KEY_KbdBrightnessUp);
|
||||
g_assert_cmpuint (gdk_keyval_from_name ("KbdBrightnessDown"), ==, GDK_KEY_KbdBrightnessDown);
|
||||
g_assert_cmpuint (gdk_keyval_from_name ("Battery"), ==, GDK_KEY_Battery);
|
||||
g_assert_cmpuint (gdk_keyval_from_name ("Display"), ==, GDK_KEY_Display);
|
||||
}
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
setlocale (LC_ALL, "");
|
||||
|
||||
g_test_init (&argc, &argv, NULL);
|
||||
gdk_init (&argc, &argv);
|
||||
|
||||
g_test_add_func ("/keysyms/basic", test_keysyms_basic);
|
||||
g_test_add_func ("/keysyms/void", test_keysyms_void);
|
||||
g_test_add_func ("/keysyms/xf86", test_keysyms_xf86);
|
||||
|
||||
return g_test_run ();
|
||||
}
|
||||
@@ -40,8 +40,6 @@ libgdkinclude_HEADERS = \
|
||||
libgdkwaylandinclude_HEADERS = \
|
||||
gdkwaylanddevice.h \
|
||||
gdkwaylanddisplay.h \
|
||||
gdkwaylanddisplaymanager.h \
|
||||
gdkwaylandselection.h \
|
||||
gdkwaylandwindow.h
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
||||
@@ -51,15 +51,9 @@ struct _GdkWaylandCursor
|
||||
GdkCursor cursor;
|
||||
gchar *name;
|
||||
guint serial;
|
||||
|
||||
struct
|
||||
{
|
||||
int hotspot_x, hotspot_y;
|
||||
int width, height;
|
||||
struct wl_buffer *buffer;
|
||||
} pixbuf;
|
||||
|
||||
struct wl_cursor *wl_cursor;
|
||||
int hotspot_x, hotspot_y;
|
||||
int width, height;
|
||||
struct wl_buffer *buffer;
|
||||
};
|
||||
|
||||
struct _GdkWaylandCursorClass
|
||||
@@ -71,105 +65,12 @@ G_DEFINE_TYPE (GdkWaylandCursor, _gdk_wayland_cursor, GDK_TYPE_CURSOR)
|
||||
|
||||
static guint theme_serial = 0;
|
||||
|
||||
struct cursor_cache_key
|
||||
{
|
||||
GdkCursorType type;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
static void
|
||||
add_to_cache (GdkWaylandDisplay *display, GdkWaylandCursor *cursor)
|
||||
{
|
||||
display->cursor_cache = g_slist_prepend (display->cursor_cache, cursor);
|
||||
|
||||
g_object_ref (cursor);
|
||||
}
|
||||
|
||||
static gint
|
||||
cache_compare_func (gconstpointer listelem,
|
||||
gconstpointer target)
|
||||
{
|
||||
GdkWaylandCursor *cursor = (GdkWaylandCursor *) listelem;
|
||||
struct cursor_cache_key* key = (struct cursor_cache_key *) target;
|
||||
|
||||
if (cursor->cursor.type != key->type)
|
||||
return 1; /* No match */
|
||||
|
||||
/* Elements marked as pixmap must be named cursors
|
||||
* (since we don't store normal pixmap cursors
|
||||
*/
|
||||
if (key->type == GDK_CURSOR_IS_PIXMAP)
|
||||
return strcmp (key->name, cursor->name);
|
||||
|
||||
return 0; /* Match */
|
||||
}
|
||||
|
||||
static GdkWaylandCursor*
|
||||
find_in_cache (GdkWaylandDisplay *display,
|
||||
GdkCursorType type,
|
||||
const char *name)
|
||||
{
|
||||
GSList* res;
|
||||
struct cursor_cache_key key;
|
||||
|
||||
key.type = type;
|
||||
key.name = name;
|
||||
|
||||
res = g_slist_find_custom (display->cursor_cache, &key, cache_compare_func);
|
||||
|
||||
if (res)
|
||||
return (GdkWaylandCursor *) res->data;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Called by gdk_wayland_display_finalize to flush any cached cursors
|
||||
* for a dead display.
|
||||
*/
|
||||
void
|
||||
_gdk_wayland_display_finalize_cursors (GdkWaylandDisplay *display)
|
||||
{
|
||||
g_slist_foreach (display->cursor_cache, (GFunc) g_object_unref, NULL);
|
||||
g_slist_free (display->cursor_cache);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
set_cursor_from_theme (GdkWaylandCursor *cursor, struct wl_cursor_theme *theme)
|
||||
{
|
||||
struct wl_cursor *c;
|
||||
|
||||
c = wl_cursor_theme_get_cursor (theme, cursor->name);
|
||||
if (!c)
|
||||
{
|
||||
g_warning (G_STRLOC ": Unable to load %s from the cursor theme", cursor->name);
|
||||
|
||||
/* return the left_ptr cursor as a fallback */
|
||||
c = wl_cursor_theme_get_cursor (theme, "left_ptr");
|
||||
|
||||
if (!c)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
cursor->wl_cursor = c;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_wayland_display_update_cursors (GdkWaylandDisplay *display,
|
||||
struct wl_cursor_theme *theme)
|
||||
{
|
||||
g_slist_foreach (display->cursor_cache, (GFunc) set_cursor_from_theme, theme);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_cursor_finalize (GObject *object)
|
||||
{
|
||||
GdkWaylandCursor *cursor = GDK_WAYLAND_CURSOR (object);
|
||||
|
||||
g_free (cursor->name);
|
||||
if (cursor->pixbuf.buffer)
|
||||
wl_buffer_destroy (cursor->pixbuf.buffer);
|
||||
|
||||
G_OBJECT_CLASS (_gdk_wayland_cursor_parent_class)->finalize (object);
|
||||
}
|
||||
@@ -182,72 +83,20 @@ gdk_wayland_cursor_get_image (GdkCursor *cursor)
|
||||
|
||||
struct wl_buffer *
|
||||
_gdk_wayland_cursor_get_buffer (GdkCursor *cursor,
|
||||
guint image_index,
|
||||
int *hotspot_x,
|
||||
int *hotspot_y,
|
||||
int *x,
|
||||
int *y,
|
||||
int *w,
|
||||
int *h)
|
||||
{
|
||||
GdkWaylandCursor *wayland_cursor = GDK_WAYLAND_CURSOR (cursor);
|
||||
|
||||
if (wayland_cursor->wl_cursor)
|
||||
{
|
||||
struct wl_cursor_image *image;
|
||||
*x = wayland_cursor->hotspot_x;
|
||||
*y = wayland_cursor->hotspot_y;
|
||||
|
||||
if (image_index >= wayland_cursor->wl_cursor->image_count)
|
||||
{
|
||||
g_warning (G_STRLOC " out of bounds cursor image [%d / %d]",
|
||||
image_index,
|
||||
wayland_cursor->wl_cursor->image_count - 1);
|
||||
image_index = 0;
|
||||
}
|
||||
*w = wayland_cursor->width;
|
||||
*h = wayland_cursor->height;
|
||||
|
||||
image = wayland_cursor->wl_cursor->images[image_index];
|
||||
|
||||
*hotspot_x = image->hotspot_x;
|
||||
*hotspot_y = image->hotspot_y;
|
||||
|
||||
*w = image->width;
|
||||
*h = image->height;
|
||||
|
||||
return wl_cursor_image_get_buffer (image);
|
||||
}
|
||||
else /* From pixbuf */
|
||||
{
|
||||
*hotspot_x = wayland_cursor->pixbuf.hotspot_x;
|
||||
*hotspot_y = wayland_cursor->pixbuf.hotspot_y;
|
||||
|
||||
*w = wayland_cursor->pixbuf.width;
|
||||
*h = wayland_cursor->pixbuf.height;
|
||||
|
||||
return wayland_cursor->pixbuf.buffer;
|
||||
}
|
||||
}
|
||||
|
||||
guint
|
||||
_gdk_wayland_cursor_get_next_image_index (GdkCursor *cursor,
|
||||
guint current_image_index,
|
||||
guint *next_image_delay)
|
||||
{
|
||||
struct wl_cursor *wl_cursor = GDK_WAYLAND_CURSOR (cursor)->wl_cursor;
|
||||
|
||||
if (wl_cursor && wl_cursor->image_count > 1)
|
||||
{
|
||||
if (current_image_index >= wl_cursor->image_count)
|
||||
{
|
||||
g_warning (G_STRLOC " out of bounds cursor image [%d / %d]",
|
||||
current_image_index, wl_cursor->image_count - 1);
|
||||
current_image_index = 0;
|
||||
}
|
||||
|
||||
/* Return the time to next image */
|
||||
if (next_image_delay)
|
||||
*next_image_delay = wl_cursor->images[current_image_index]->delay;
|
||||
|
||||
return (current_image_index + 1) % wl_cursor->image_count;
|
||||
}
|
||||
else
|
||||
return current_image_index;
|
||||
return wayland_cursor->buffer;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -266,27 +115,29 @@ _gdk_wayland_cursor_init (GdkWaylandCursor *cursor)
|
||||
{
|
||||
}
|
||||
|
||||
/* Used to implement from_pixbuf below */
|
||||
/* Use to implement from_pixbuf below */
|
||||
#if 0
|
||||
static void
|
||||
set_pixbuf (gpointer argb_pixels, int width, int height, GdkPixbuf *pixbuf)
|
||||
set_pixbuf (GdkWaylandCursor *cursor, GdkPixbuf *pixbuf)
|
||||
{
|
||||
int stride, i, n_channels;
|
||||
unsigned char *pixels, *end, *s, *d;
|
||||
unsigned char *pixels, *end, *argb_pixels, *s, *d;
|
||||
|
||||
stride = gdk_pixbuf_get_rowstride(pixbuf);
|
||||
pixels = gdk_pixbuf_get_pixels(pixbuf);
|
||||
n_channels = gdk_pixbuf_get_n_channels(pixbuf);
|
||||
argb_pixels = cursor->map;
|
||||
|
||||
#define MULT(_d,c,a,t) \
|
||||
do { t = c * a + 0x7f; _d = ((t >> 8) + t) >> 8; } while (0)
|
||||
|
||||
if (n_channels == 4)
|
||||
{
|
||||
for (i = 0; i < height; i++)
|
||||
for (i = 0; i < cursor->height; i++)
|
||||
{
|
||||
s = pixels + i * stride;
|
||||
end = s + width * 4;
|
||||
d = argb_pixels + i * width * 4;
|
||||
end = s + cursor->width * 4;
|
||||
d = argb_pixels + i * cursor->width * 4;
|
||||
while (s < end)
|
||||
{
|
||||
unsigned int t;
|
||||
@@ -302,11 +153,11 @@ set_pixbuf (gpointer argb_pixels, int width, int height, GdkPixbuf *pixbuf)
|
||||
}
|
||||
else if (n_channels == 3)
|
||||
{
|
||||
for (i = 0; i < height; i++)
|
||||
for (i = 0; i < cursor->height; i++)
|
||||
{
|
||||
s = pixels + i * stride;
|
||||
end = s + width * 3;
|
||||
d = argb_pixels + i * width * 4;
|
||||
end = s + cursor->width * 3;
|
||||
d = argb_pixels + i * cursor->width * 4;
|
||||
while (s < end)
|
||||
{
|
||||
d[0] = s[2];
|
||||
@@ -320,6 +171,84 @@ set_pixbuf (gpointer argb_pixels, int width, int height, GdkPixbuf *pixbuf)
|
||||
}
|
||||
}
|
||||
|
||||
static GdkCursor *
|
||||
create_cursor(GdkWaylandDisplay *display, GdkPixbuf *pixbuf, int x, int y)
|
||||
{
|
||||
GdkWaylandCursor *cursor;
|
||||
int stride, fd;
|
||||
char *filename;
|
||||
GError *error = NULL;
|
||||
struct wl_shm_pool *pool;
|
||||
|
||||
cursor = g_object_new (GDK_TYPE_WAYLAND_CURSOR,
|
||||
"cursor-type", GDK_CURSOR_IS_PIXMAP,
|
||||
"display", display,
|
||||
NULL);
|
||||
cursor->name = NULL;
|
||||
cursor->serial = theme_serial;
|
||||
cursor->x = x;
|
||||
cursor->y = y;
|
||||
if (pixbuf)
|
||||
{
|
||||
cursor->width = gdk_pixbuf_get_width (pixbuf);
|
||||
cursor->height = gdk_pixbuf_get_height (pixbuf);
|
||||
}
|
||||
else
|
||||
{
|
||||
cursor->width = 1;
|
||||
cursor->height = 1;
|
||||
}
|
||||
|
||||
stride = cursor->width * 4;
|
||||
cursor->size = stride * cursor->height;
|
||||
|
||||
fd = g_file_open_tmp("wayland-shm-XXXXXX", &filename, &error);
|
||||
if (fd < 0)
|
||||
{
|
||||
g_critical (G_STRLOC ": Error opening temporary file for buffer: %s",
|
||||
error->message);
|
||||
g_error_free (error);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
unlink (filename);
|
||||
g_free (filename);
|
||||
|
||||
if (ftruncate(fd, cursor->size) < 0)
|
||||
{
|
||||
g_critical (G_STRLOC ": Error truncating file for buffer: %s",
|
||||
g_strerror (errno));
|
||||
close(fd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cursor->map = mmap(NULL, cursor->size,
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
|
||||
if (cursor->map == MAP_FAILED)
|
||||
{
|
||||
g_critical (G_STRLOC ": Error mmap'ing file for buffer: %s",
|
||||
g_strerror (errno));
|
||||
close(fd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (pixbuf)
|
||||
set_pixbuf (cursor, pixbuf);
|
||||
else
|
||||
memset (cursor->map, 0, 4);
|
||||
|
||||
cursor->buffer = wl_shm_create_buffer(display->shm,
|
||||
fd,
|
||||
cursor->width,
|
||||
cursor->height,
|
||||
stride, WL_SHM_FORMAT_ARGB8888);
|
||||
|
||||
close(fd);
|
||||
|
||||
return GDK_CURSOR (cursor);
|
||||
}
|
||||
#endif
|
||||
|
||||
GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
|
||||
GdkCursorType cursor_type)
|
||||
@@ -348,18 +277,10 @@ _gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
|
||||
{
|
||||
GdkWaylandCursor *private;
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (display);
|
||||
struct wl_cursor *cursor;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
|
||||
private = find_in_cache (wayland_display, GDK_CURSOR_IS_PIXMAP, name);
|
||||
if (private)
|
||||
{
|
||||
/* Cache had it, add a ref for this user */
|
||||
g_object_ref (private);
|
||||
|
||||
return (GdkCursor*) private;
|
||||
}
|
||||
|
||||
private = g_object_new (GDK_TYPE_WAYLAND_CURSOR,
|
||||
"cursor-type", GDK_CURSOR_IS_PIXMAP,
|
||||
"display", display,
|
||||
@@ -371,73 +292,59 @@ _gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
|
||||
if (!name || g_str_equal (name, "blank_cursor"))
|
||||
return GDK_CURSOR (private);
|
||||
|
||||
if (!set_cursor_from_theme (private, wayland_display->cursor_theme))
|
||||
return GDK_CURSOR (private);
|
||||
cursor = wl_cursor_theme_get_cursor (wayland_display->cursor_theme,
|
||||
name);
|
||||
|
||||
add_to_cache (wayland_display, private);
|
||||
if (!cursor)
|
||||
{
|
||||
g_warning (G_STRLOC ": Unable to load %s from the cursor theme", name);
|
||||
|
||||
/* return the left_ptr cursor as a fallback */
|
||||
cursor = wl_cursor_theme_get_cursor (wayland_display->cursor_theme,
|
||||
"left_ptr");
|
||||
|
||||
/* if the fallback failed to load, return a blank pointer */
|
||||
if (!cursor)
|
||||
return GDK_CURSOR (private);
|
||||
}
|
||||
|
||||
/* TODO: Do something clever so we can do animated cursors - move the
|
||||
* wl_pointer_set_cursor to a function here so that we can do the magic to
|
||||
* iterate through
|
||||
*/
|
||||
private->hotspot_x = cursor->images[0]->hotspot_x;
|
||||
private->hotspot_y = cursor->images[0]->hotspot_y;
|
||||
private->width = cursor->images[0]->width;
|
||||
private->height = cursor->images[0]->height;
|
||||
|
||||
private->buffer = wl_cursor_image_get_buffer(cursor->images[0]);
|
||||
|
||||
return GDK_CURSOR (private);
|
||||
}
|
||||
|
||||
/* TODO: Needs implementing */
|
||||
GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_pixbuf (GdkDisplay *display,
|
||||
GdkPixbuf *pixbuf,
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
GdkWaylandCursor *cursor;
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (display);
|
||||
int stride;
|
||||
size_t size;
|
||||
gpointer data;
|
||||
struct wl_shm_pool *pool;
|
||||
GdkWaylandCursor *private;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
|
||||
g_return_val_if_fail (0 <= x && x < gdk_pixbuf_get_width (pixbuf), NULL);
|
||||
g_return_val_if_fail (0 <= y && y < gdk_pixbuf_get_height (pixbuf), NULL);
|
||||
|
||||
cursor = g_object_new (GDK_TYPE_WAYLAND_CURSOR,
|
||||
"cursor-type", GDK_CURSOR_IS_PIXMAP,
|
||||
"display", wayland_display,
|
||||
NULL);
|
||||
cursor->name = NULL;
|
||||
cursor->serial = theme_serial;
|
||||
cursor->pixbuf.hotspot_x = x;
|
||||
cursor->pixbuf.hotspot_y = y;
|
||||
private = g_object_new (GDK_TYPE_WAYLAND_CURSOR,
|
||||
"cursor-type", GDK_CURSOR_IS_PIXMAP,
|
||||
"display", display,
|
||||
NULL);
|
||||
|
||||
if (pixbuf)
|
||||
{
|
||||
cursor->pixbuf.width = gdk_pixbuf_get_width (pixbuf);
|
||||
cursor->pixbuf.height = gdk_pixbuf_get_height (pixbuf);
|
||||
}
|
||||
else
|
||||
{
|
||||
cursor->pixbuf.width = 1;
|
||||
cursor->pixbuf.height = 1;
|
||||
}
|
||||
private->name = NULL;
|
||||
private->serial = theme_serial;
|
||||
|
||||
pool = _create_shm_pool (wayland_display->shm,
|
||||
cursor->pixbuf.width,
|
||||
cursor->pixbuf.height,
|
||||
&size,
|
||||
&data);
|
||||
|
||||
if (pixbuf)
|
||||
set_pixbuf (data, cursor->pixbuf.width, cursor->pixbuf.height, pixbuf);
|
||||
else
|
||||
memset (data, 0, 4);
|
||||
|
||||
stride = cursor->pixbuf.width * 4;
|
||||
cursor->pixbuf.buffer = wl_shm_pool_create_buffer (pool, 0,
|
||||
cursor->pixbuf.width,
|
||||
cursor->pixbuf.height,
|
||||
stride,
|
||||
WL_SHM_FORMAT_ARGB8888);
|
||||
|
||||
wl_shm_pool_destroy (pool);
|
||||
|
||||
return GDK_CURSOR (cursor);
|
||||
return GDK_CURSOR (private);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "gdkkeysyms.h"
|
||||
#include "gdkdeviceprivate.h"
|
||||
#include "gdkdevicemanagerprivate.h"
|
||||
#include "gdkprivate-wayland.h"
|
||||
|
||||
#include <xkbcommon/xkbcommon.h>
|
||||
#include <X11/keysym.h>
|
||||
@@ -37,13 +38,14 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
typedef struct _GdkWaylandDeviceData GdkWaylandDeviceData;
|
||||
|
||||
typedef struct _DataOffer DataOffer;
|
||||
|
||||
typedef struct _GdkWaylandSelectionOffer GdkWaylandSelectionOffer;
|
||||
|
||||
struct _GdkWaylandDeviceData
|
||||
{
|
||||
guint32 id;
|
||||
struct wl_seat *wl_seat;
|
||||
struct wl_pointer *wl_pointer;
|
||||
struct wl_keyboard *wl_keyboard;
|
||||
@@ -53,7 +55,7 @@ struct _GdkWaylandDeviceData
|
||||
|
||||
GdkDevice *pointer;
|
||||
GdkDevice *keyboard;
|
||||
GdkCursor *cursor;
|
||||
|
||||
GdkKeymap *keymap;
|
||||
|
||||
GdkModifierType modifiers;
|
||||
@@ -62,17 +64,11 @@ struct _GdkWaylandDeviceData
|
||||
struct wl_data_device *data_device;
|
||||
double surface_x, surface_y;
|
||||
uint32_t time;
|
||||
uint32_t enter_serial;
|
||||
uint32_t button_press_serial;
|
||||
GdkWindow *pointer_grab_window;
|
||||
uint32_t pointer_grab_time;
|
||||
guint32 repeat_timer;
|
||||
guint32 repeat_key;
|
||||
guint32 repeat_count;
|
||||
GSettings *keyboard_settings;
|
||||
|
||||
guint cursor_timeout_id;
|
||||
guint cursor_image_index;
|
||||
|
||||
DataOffer *drag_offer;
|
||||
DataOffer *selection_offer;
|
||||
@@ -95,29 +91,31 @@ struct _GdkWaylandDeviceClass
|
||||
|
||||
G_DEFINE_TYPE (GdkWaylandDevice, gdk_wayland_device, GDK_TYPE_DEVICE)
|
||||
|
||||
#define GDK_TYPE_WAYLAND_DEVICE_MANAGER (gdk_wayland_device_manager_get_type ())
|
||||
#define GDK_WAYLAND_DEVICE_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_WAYLAND_DEVICE_MANAGER, GdkWaylandDeviceManager))
|
||||
#define GDK_WAYLAND_DEVICE_MANAGER_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_WAYLAND_DEVICE_MANAGER, GdkWaylandDeviceManagerClass))
|
||||
#define GDK_IS_WAYLAND_DEVICE_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_WAYLAND_DEVICE_MANAGER))
|
||||
#define GDK_IS_WAYLAND_DEVICE_MANAGER_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_WAYLAND_DEVICE_MANAGER))
|
||||
#define GDK_WAYLAND_DEVICE_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_WAYLAND_DEVICE_MANAGER, GdkWaylandDeviceManagerClass))
|
||||
#define GDK_TYPE_DEVICE_MANAGER_CORE (gdk_device_manager_core_get_type ())
|
||||
#define GDK_DEVICE_MANAGER_CORE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE_MANAGER_CORE, GdkDeviceManagerCore))
|
||||
#define GDK_DEVICE_MANAGER_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE_MANAGER_CORE, GdkDeviceManagerCoreClass))
|
||||
#define GDK_IS_DEVICE_MANAGER_CORE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE_MANAGER_CORE))
|
||||
#define GDK_IS_DEVICE_MANAGER_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE_MANAGER_CORE))
|
||||
#define GDK_DEVICE_MANAGER_CORE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE_MANAGER_CORE, GdkDeviceManagerCoreClass))
|
||||
|
||||
typedef struct _GdkWaylandDeviceManager GdkWaylandDeviceManager;
|
||||
typedef struct _GdkWaylandDeviceManagerClass GdkWaylandDeviceManagerClass;
|
||||
typedef struct _GdkDeviceManagerCore GdkDeviceManagerCore;
|
||||
typedef struct _GdkDeviceManagerCoreClass GdkDeviceManagerCoreClass;
|
||||
|
||||
struct _GdkWaylandDeviceManager
|
||||
struct _GdkDeviceManagerCore
|
||||
{
|
||||
GdkDeviceManager parent_object;
|
||||
GdkDevice *core_pointer;
|
||||
GdkDevice *core_keyboard;
|
||||
GList *devices;
|
||||
};
|
||||
|
||||
struct _GdkWaylandDeviceManagerClass
|
||||
struct _GdkDeviceManagerCoreClass
|
||||
{
|
||||
GdkDeviceManagerClass parent_class;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GdkWaylandDeviceManager,
|
||||
gdk_wayland_device_manager, GDK_TYPE_DEVICE_MANAGER)
|
||||
G_DEFINE_TYPE (GdkDeviceManagerCore,
|
||||
gdk_device_manager_core, GDK_TYPE_DEVICE_MANAGER)
|
||||
|
||||
static gboolean
|
||||
gdk_wayland_device_get_history (GdkDevice *device,
|
||||
@@ -147,83 +145,38 @@ gdk_wayland_device_get_state (GdkDevice *device,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_device_stop_window_cursor_animation (GdkWaylandDeviceData *wd)
|
||||
{
|
||||
if (wd->cursor_timeout_id > 0)
|
||||
{
|
||||
g_source_remove (wd->cursor_timeout_id);
|
||||
wd->cursor_timeout_id = 0;
|
||||
}
|
||||
wd->cursor_image_index = 0;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_wayland_device_update_window_cursor (GdkWaylandDeviceData *wd)
|
||||
{
|
||||
struct wl_buffer *buffer;
|
||||
int x, y, w, h;
|
||||
guint next_image_index, next_image_delay;
|
||||
|
||||
buffer = _gdk_wayland_cursor_get_buffer (wd->cursor, wd->cursor_image_index,
|
||||
&x, &y, &w, &h);
|
||||
wl_pointer_set_cursor (wd->wl_pointer,
|
||||
wd->enter_serial,
|
||||
wd->pointer_surface,
|
||||
x, y);
|
||||
wl_surface_attach (wd->pointer_surface, buffer, 0, 0);
|
||||
wl_surface_damage (wd->pointer_surface, 0, 0, w, h);
|
||||
wl_surface_commit (wd->pointer_surface);
|
||||
|
||||
next_image_index =
|
||||
_gdk_wayland_cursor_get_next_image_index (wd->cursor,
|
||||
wd->cursor_image_index,
|
||||
&next_image_delay);
|
||||
|
||||
if (next_image_index != wd->cursor_image_index)
|
||||
{
|
||||
guint id;
|
||||
|
||||
/* Queue timeout for next frame */
|
||||
id = g_timeout_add (next_image_delay,
|
||||
(GSourceFunc)gdk_wayland_device_update_window_cursor,
|
||||
wd);
|
||||
|
||||
wd->cursor_timeout_id = id;
|
||||
wd->cursor_image_index = next_image_index;
|
||||
}
|
||||
else
|
||||
wd->cursor_timeout_id = 0;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_device_set_window_cursor (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkCursor *cursor)
|
||||
{
|
||||
GdkWaylandDeviceData *wd = GDK_WAYLAND_DEVICE(device)->device;
|
||||
GdkWaylandDisplay *wayland_display =
|
||||
GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
|
||||
struct wl_buffer *buffer;
|
||||
int x, y, w, h;
|
||||
|
||||
if (cursor)
|
||||
g_object_ref (cursor);
|
||||
|
||||
/* Setting the cursor to NULL means that we should use the default cursor */
|
||||
if (!cursor)
|
||||
{
|
||||
/* FIXME: Is this the best sensible default ? */
|
||||
cursor = _gdk_wayland_display_get_cursor_for_type (device->display,
|
||||
GDK_LEFT_PTR);
|
||||
GDK_LEFT_PTR);
|
||||
}
|
||||
|
||||
if (cursor == wd->cursor)
|
||||
return;
|
||||
buffer = _gdk_wayland_cursor_get_buffer (cursor, &x, &y, &w, &h);
|
||||
wl_pointer_set_cursor (wd->wl_pointer,
|
||||
_gdk_wayland_display_get_serial (wayland_display),
|
||||
wd->pointer_surface,
|
||||
x, y);
|
||||
wl_surface_attach (wd->pointer_surface, buffer, 0, 0);
|
||||
wl_surface_damage (wd->pointer_surface, 0, 0, w, h);
|
||||
wl_surface_commit(wd->pointer_surface);
|
||||
|
||||
gdk_wayland_device_stop_window_cursor_animation (wd);
|
||||
|
||||
if (wd->cursor)
|
||||
g_object_unref (wd->cursor);
|
||||
|
||||
wd->cursor = g_object_ref (cursor);
|
||||
|
||||
gdk_wayland_device_update_window_cursor (wd);
|
||||
g_object_unref (cursor);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -255,11 +208,13 @@ gdk_wayland_device_query_state (GdkDevice *device,
|
||||
*root_window = gdk_screen_get_root_window (default_screen);
|
||||
if (child_window)
|
||||
*child_window = wd->pointer_focus;
|
||||
/* TODO: Do something clever for relative here */
|
||||
/* Do something clever for relative here */
|
||||
#if 0
|
||||
if (root_x)
|
||||
*root_x = wd->surface_x;
|
||||
*root_x = wd->x;
|
||||
if (root_y)
|
||||
*root_y = wd->surface_y;
|
||||
*root_y = wd->y;
|
||||
#endif
|
||||
if (win_x)
|
||||
*win_x = wd->surface_x;
|
||||
if (win_y)
|
||||
@@ -620,7 +575,6 @@ pointer_handle_enter (void *data,
|
||||
|
||||
device->surface_x = wl_fixed_to_double (sx);
|
||||
device->surface_y = wl_fixed_to_double (sy);
|
||||
device->enter_serial = serial;
|
||||
|
||||
_gdk_wayland_display_deliver_event (device->display, event);
|
||||
|
||||
@@ -665,13 +619,6 @@ pointer_handle_leave (void *data,
|
||||
device, device->pointer_focus));
|
||||
|
||||
g_object_unref(device->pointer_focus);
|
||||
if (device->cursor)
|
||||
{
|
||||
gdk_wayland_device_stop_window_cursor_animation (device);
|
||||
g_object_unref (device->cursor);
|
||||
device->cursor = NULL;
|
||||
}
|
||||
|
||||
device->pointer_focus = NULL;
|
||||
}
|
||||
|
||||
@@ -741,8 +688,6 @@ pointer_handle_button (void *data,
|
||||
}
|
||||
|
||||
device->time = time;
|
||||
if (state)
|
||||
device->button_press_serial = serial;
|
||||
|
||||
event = gdk_event_new (state ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE);
|
||||
event->button.window = g_object_ref (device->pointer_focus);
|
||||
@@ -822,12 +767,10 @@ keyboard_handle_keymap (void *data,
|
||||
uint32_t size)
|
||||
{
|
||||
GdkWaylandDeviceData *device = data;
|
||||
if (device->keymap)
|
||||
g_object_unref (device->keymap);
|
||||
|
||||
_gdk_wayland_keymap_update_from_fd (device->keymap, format, fd, size);
|
||||
|
||||
g_signal_emit_by_name (device->keymap, "keys-changed");
|
||||
g_signal_emit_by_name (device->keymap, "state-changed");
|
||||
g_signal_emit_by_name (device->keymap, "direction-changed");
|
||||
device->keymap = _gdk_wayland_keymap_new_from_fd (format, fd, size);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -901,6 +844,22 @@ keyboard_handle_leave (void *data,
|
||||
static gboolean
|
||||
keyboard_repeat (gpointer data);
|
||||
|
||||
static GdkModifierType
|
||||
get_modifier (struct xkb_state *state)
|
||||
{
|
||||
GdkModifierType modifiers = 0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_SHIFT, XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_SHIFT_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_CAPS, XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_LOCK_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_CTRL, XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_CONTROL_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_ALT, XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_MOD1_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, "Mod2", XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_MOD2_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, "Mod3", XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_MOD3_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_LOGO, XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_MOD4_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, "Mod5", XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_MOD5_MASK:0;
|
||||
|
||||
return modifiers;
|
||||
}
|
||||
|
||||
static void
|
||||
translate_keyboard_string (GdkEventKey *event)
|
||||
{
|
||||
@@ -965,48 +924,22 @@ translate_keyboard_string (GdkEventKey *event)
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
get_key_repeat (GdkWaylandDeviceData *device,
|
||||
guint *delay,
|
||||
guint *interval)
|
||||
{
|
||||
gboolean repeat;
|
||||
|
||||
if (device->keyboard_settings)
|
||||
{
|
||||
repeat = g_settings_get_boolean (device->keyboard_settings, "repeat");
|
||||
*delay = g_settings_get_uint (device->keyboard_settings, "delay");
|
||||
*interval = g_settings_get_uint (device->keyboard_settings, "repeat-interval");
|
||||
}
|
||||
else
|
||||
{
|
||||
repeat = TRUE;
|
||||
*delay = 400;
|
||||
*interval = 80;
|
||||
}
|
||||
|
||||
return repeat;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
deliver_key_event(GdkWaylandDeviceData *device,
|
||||
uint32_t time, uint32_t key, uint32_t state)
|
||||
{
|
||||
GdkEvent *event;
|
||||
struct xkb_state *xkb_state;
|
||||
struct xkb_keymap *xkb_keymap;
|
||||
GdkKeymap *keymap;
|
||||
xkb_keysym_t sym;
|
||||
guint delay, interval;
|
||||
|
||||
keymap = device->keymap;
|
||||
xkb_state = _gdk_wayland_keymap_get_xkb_state (keymap);
|
||||
xkb_keymap = _gdk_wayland_keymap_get_xkb_keymap (keymap);
|
||||
|
||||
sym = xkb_state_key_get_one_sym (xkb_state, key);
|
||||
|
||||
device->time = time;
|
||||
device->modifiers = gdk_keymap_get_modifier_state (keymap);
|
||||
device->modifiers = get_modifier (xkb_state);
|
||||
|
||||
event = gdk_event_new (state ? GDK_KEY_PRESS : GDK_KEY_RELEASE);
|
||||
event->key.window = device->keyboard_focus?g_object_ref (device->keyboard_focus):NULL;
|
||||
@@ -1014,9 +947,10 @@ deliver_key_event(GdkWaylandDeviceData *device,
|
||||
event->button.time = time;
|
||||
event->key.state = device->modifiers;
|
||||
event->key.group = 0;
|
||||
event->key.hardware_keycode = key;
|
||||
event->key.hardware_keycode = sym;
|
||||
event->key.keyval = sym;
|
||||
event->key.is_modifier = _gdk_wayland_keymap_key_is_modifier (keymap, key);
|
||||
|
||||
event->key.is_modifier = device->modifiers > 0;
|
||||
|
||||
translate_keyboard_string (&event->key);
|
||||
|
||||
@@ -1028,12 +962,6 @@ deliver_key_event(GdkWaylandDeviceData *device,
|
||||
event->key.hardware_keycode, event->key.keyval,
|
||||
event->key.string, event->key.state));
|
||||
|
||||
if (!xkb_keymap_key_repeats (xkb_keymap, key))
|
||||
return FALSE;
|
||||
|
||||
if (!get_key_repeat (device, &delay, &interval))
|
||||
return FALSE;
|
||||
|
||||
device->repeat_count++;
|
||||
device->repeat_key = key;
|
||||
|
||||
@@ -1046,6 +974,10 @@ deliver_key_event(GdkWaylandDeviceData *device,
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
else if (device->modifiers)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
else switch (device->repeat_count)
|
||||
{
|
||||
case 1:
|
||||
@@ -1056,11 +988,11 @@ deliver_key_event(GdkWaylandDeviceData *device,
|
||||
}
|
||||
|
||||
device->repeat_timer =
|
||||
gdk_threads_add_timeout (delay, keyboard_repeat, device);
|
||||
gdk_threads_add_timeout (400, keyboard_repeat, device);
|
||||
return TRUE;
|
||||
case 2:
|
||||
device->repeat_timer =
|
||||
gdk_threads_add_timeout (interval, keyboard_repeat, device);
|
||||
gdk_threads_add_timeout (80, keyboard_repeat, device);
|
||||
return FALSE;
|
||||
default:
|
||||
return TRUE;
|
||||
@@ -1104,18 +1036,12 @@ keyboard_handle_modifiers (void *data,
|
||||
GdkWaylandDeviceData *device = data;
|
||||
GdkKeymap *keymap;
|
||||
struct xkb_state *xkb_state;
|
||||
PangoDirection direction;
|
||||
|
||||
keymap = device->keymap;
|
||||
direction = gdk_keymap_get_direction (keymap);
|
||||
xkb_state = _gdk_wayland_keymap_get_xkb_state (keymap);
|
||||
device->modifiers = mods_depressed | mods_latched | mods_locked;
|
||||
|
||||
xkb_state_update_mask (xkb_state, mods_depressed, mods_latched, mods_locked, group, 0, 0);
|
||||
|
||||
g_signal_emit_by_name (keymap, "state-changed");
|
||||
if (direction != gdk_keymap_get_direction (keymap))
|
||||
g_signal_emit_by_name (keymap, "direction-changed");
|
||||
}
|
||||
|
||||
static const struct wl_pointer_listener pointer_listener = {
|
||||
@@ -1139,8 +1065,8 @@ seat_handle_capabilities(void *data, struct wl_seat *seat,
|
||||
enum wl_seat_capability caps)
|
||||
{
|
||||
GdkWaylandDeviceData *device = data;
|
||||
GdkWaylandDeviceManager *device_manager =
|
||||
GDK_WAYLAND_DEVICE_MANAGER(device->device_manager);
|
||||
GdkDeviceManagerCore *device_manager_core =
|
||||
GDK_DEVICE_MANAGER_CORE(device->device_manager);
|
||||
|
||||
if ((caps & WL_SEAT_CAPABILITY_POINTER) && !device->wl_pointer)
|
||||
{
|
||||
@@ -1160,25 +1086,22 @@ seat_handle_capabilities(void *data, struct wl_seat *seat,
|
||||
NULL);
|
||||
GDK_WAYLAND_DEVICE (device->pointer)->device = device;
|
||||
|
||||
device_manager->devices =
|
||||
g_list_prepend (device_manager->devices, device->pointer);
|
||||
|
||||
g_signal_emit_by_name (device_manager, "device-added", device->pointer);
|
||||
device_manager_core->devices =
|
||||
g_list_prepend (device_manager_core->devices, device->pointer);
|
||||
}
|
||||
else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && device->wl_pointer)
|
||||
{
|
||||
wl_pointer_destroy(device->wl_pointer);
|
||||
device->wl_pointer = NULL;
|
||||
|
||||
device_manager->devices =
|
||||
g_list_remove (device_manager->devices, device->pointer);
|
||||
device_manager_core->devices =
|
||||
g_list_remove (device_manager_core->devices, device->pointer);
|
||||
|
||||
g_signal_emit_by_name (device_manager, "device-removed", device->pointer);
|
||||
g_object_unref (device->pointer);
|
||||
device->pointer = NULL;
|
||||
}
|
||||
|
||||
if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !device->wl_keyboard)
|
||||
if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !device->wl_keyboard)
|
||||
{
|
||||
device->wl_keyboard = wl_seat_get_keyboard(seat);
|
||||
wl_keyboard_set_user_data(device->wl_keyboard, device);
|
||||
@@ -1196,20 +1119,17 @@ seat_handle_capabilities(void *data, struct wl_seat *seat,
|
||||
NULL);
|
||||
GDK_WAYLAND_DEVICE (device->keyboard)->device = device;
|
||||
|
||||
device_manager->devices =
|
||||
g_list_prepend (device_manager->devices, device->keyboard);
|
||||
|
||||
g_signal_emit_by_name (device_manager, "device-added", device->keyboard);
|
||||
device_manager_core->devices =
|
||||
g_list_prepend (device_manager_core->devices, device->keyboard);
|
||||
}
|
||||
else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && device->wl_keyboard)
|
||||
{
|
||||
wl_keyboard_destroy(device->wl_keyboard);
|
||||
device->wl_keyboard = NULL;
|
||||
|
||||
device_manager->devices =
|
||||
g_list_remove (device_manager->devices, device->keyboard);
|
||||
device_manager_core->devices =
|
||||
g_list_remove (device_manager_core->devices, device->keyboard);
|
||||
|
||||
g_signal_emit_by_name (device_manager, "device-removed", device->keyboard);
|
||||
g_object_unref (device->keyboard);
|
||||
device->keyboard = NULL;
|
||||
}
|
||||
@@ -1225,25 +1145,9 @@ static const struct wl_seat_listener seat_listener = {
|
||||
seat_handle_capabilities,
|
||||
};
|
||||
|
||||
static void
|
||||
init_settings (GdkWaylandDeviceData *device)
|
||||
{
|
||||
GSettingsSchemaSource *source;
|
||||
GSettingsSchema *schema;
|
||||
|
||||
source = g_settings_schema_source_get_default ();
|
||||
schema = g_settings_schema_source_lookup (source, "org.gnome.settings-daemon.peripherals.keyboard", FALSE);
|
||||
if (schema != NULL)
|
||||
{
|
||||
device->keyboard_settings = g_settings_new_full (schema, NULL, NULL);
|
||||
g_settings_schema_unref (schema);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
|
||||
guint32 id,
|
||||
struct wl_seat *wl_seat)
|
||||
_gdk_wayland_device_manager_add_device (GdkDeviceManager *device_manager,
|
||||
struct wl_seat *wl_seat)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
GdkWaylandDisplay *display_wayland;
|
||||
@@ -1253,7 +1157,6 @@ _gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
|
||||
display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
|
||||
device = g_new0 (GdkWaylandDeviceData, 1);
|
||||
device->id = id;
|
||||
device->keymap = _gdk_wayland_keymap_new ();
|
||||
device->display = display;
|
||||
device->device_manager = device_manager;
|
||||
@@ -1271,34 +1174,6 @@ _gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
|
||||
|
||||
device->pointer_surface =
|
||||
wl_compositor_create_surface (display_wayland->compositor);
|
||||
|
||||
init_settings (device);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_wayland_device_manager_remove_seat (GdkDeviceManager *manager,
|
||||
guint32 id)
|
||||
{
|
||||
GdkWaylandDeviceManager *device_manager = GDK_WAYLAND_DEVICE_MANAGER (manager);
|
||||
GList *l;
|
||||
|
||||
for (l = device_manager->devices; l != NULL; l = l->next)
|
||||
{
|
||||
GdkWaylandDevice *wayland_device = l->data;
|
||||
GdkWaylandDeviceData *device = wayland_device->device;
|
||||
|
||||
if (device->id == id)
|
||||
{
|
||||
seat_handle_capabilities (device, device->wl_seat, 0);
|
||||
g_object_unref (device->keymap);
|
||||
wl_surface_destroy (device->pointer_surface);
|
||||
/* FIXME: destroy data_device */
|
||||
g_clear_object (&device->keyboard_settings);
|
||||
g_free (device);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1308,43 +1183,43 @@ free_device (gpointer data)
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_device_manager_finalize (GObject *object)
|
||||
gdk_device_manager_core_finalize (GObject *object)
|
||||
{
|
||||
GdkWaylandDeviceManager *device_manager;
|
||||
GdkDeviceManagerCore *device_manager_core;
|
||||
|
||||
device_manager = GDK_WAYLAND_DEVICE_MANAGER (object);
|
||||
device_manager_core = GDK_DEVICE_MANAGER_CORE (object);
|
||||
|
||||
g_list_free_full (device_manager->devices, free_device);
|
||||
g_list_free_full (device_manager_core->devices, free_device);
|
||||
|
||||
G_OBJECT_CLASS (gdk_wayland_device_manager_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (gdk_device_manager_core_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static GList *
|
||||
gdk_wayland_device_manager_list_devices (GdkDeviceManager *device_manager,
|
||||
gdk_device_manager_core_list_devices (GdkDeviceManager *device_manager,
|
||||
GdkDeviceType type)
|
||||
{
|
||||
GdkWaylandDeviceManager *wayland_device_manager;
|
||||
GdkDeviceManagerCore *device_manager_core;
|
||||
GList *devices = NULL;
|
||||
|
||||
if (type == GDK_DEVICE_TYPE_MASTER)
|
||||
{
|
||||
wayland_device_manager = (GdkWaylandDeviceManager *) device_manager;
|
||||
devices = g_list_copy(wayland_device_manager->devices);
|
||||
device_manager_core = (GdkDeviceManagerCore *) device_manager;
|
||||
devices = g_list_copy(device_manager_core->devices);
|
||||
}
|
||||
|
||||
return devices;
|
||||
}
|
||||
|
||||
static GdkDevice *
|
||||
gdk_wayland_device_manager_get_client_pointer (GdkDeviceManager *device_manager)
|
||||
gdk_device_manager_core_get_client_pointer (GdkDeviceManager *device_manager)
|
||||
{
|
||||
GdkWaylandDeviceManager *wayland_device_manager;
|
||||
GdkDeviceManagerCore *device_manager_core;
|
||||
GList *l;
|
||||
|
||||
wayland_device_manager = (GdkWaylandDeviceManager *) device_manager;
|
||||
device_manager_core = (GdkDeviceManagerCore *) device_manager;
|
||||
|
||||
/* Find the first pointer device */
|
||||
for (l = wayland_device_manager->devices; l != NULL; l = l->next)
|
||||
for (l = device_manager_core->devices; l != NULL; l = l->next)
|
||||
{
|
||||
GdkDevice *device = l->data;
|
||||
|
||||
@@ -1356,35 +1231,29 @@ gdk_wayland_device_manager_get_client_pointer (GdkDeviceManager *device_manager)
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_device_manager_class_init (GdkWaylandDeviceManagerClass *klass)
|
||||
gdk_device_manager_core_class_init (GdkDeviceManagerCoreClass *klass)
|
||||
{
|
||||
GdkDeviceManagerClass *device_manager_class = GDK_DEVICE_MANAGER_CLASS (klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->finalize = gdk_wayland_device_manager_finalize;
|
||||
device_manager_class->list_devices = gdk_wayland_device_manager_list_devices;
|
||||
device_manager_class->get_client_pointer = gdk_wayland_device_manager_get_client_pointer;
|
||||
object_class->finalize = gdk_device_manager_core_finalize;
|
||||
device_manager_class->list_devices = gdk_device_manager_core_list_devices;
|
||||
device_manager_class->get_client_pointer = gdk_device_manager_core_get_client_pointer;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_device_manager_init (GdkWaylandDeviceManager *device_manager)
|
||||
gdk_device_manager_core_init (GdkDeviceManagerCore *device_manager)
|
||||
{
|
||||
}
|
||||
|
||||
GdkDeviceManager *
|
||||
_gdk_wayland_device_manager_new (GdkDisplay *display)
|
||||
{
|
||||
return g_object_new (GDK_TYPE_WAYLAND_DEVICE_MANAGER,
|
||||
return g_object_new (GDK_TYPE_DEVICE_MANAGER_CORE,
|
||||
"display", display,
|
||||
NULL);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
_gdk_wayland_device_get_button_press_serial(GdkWaylandDeviceData *device)
|
||||
{
|
||||
return device->button_press_serial;
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_wayland_device_get_selection_type_atoms (GdkDevice *gdk_device,
|
||||
GdkAtom **atoms_out)
|
||||
@@ -1551,7 +1420,7 @@ data_source_send (void *data,
|
||||
const char *mime_type,
|
||||
int32_t fd)
|
||||
{
|
||||
GdkWaylandSelectionOffer *offer = (GdkWaylandSelectionOffer *)data;
|
||||
GdkWaylandSelectionOffer *offer = (GdkWaylandSelectionOffer *)data;;
|
||||
gchar *buf;
|
||||
gssize len, bytes_written = 0;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user