Compare commits
6 Commits
wip/css-op
...
wip/im-osk
Author | SHA1 | Date | |
---|---|---|---|
|
bee92a0fc7 | ||
|
12d9c93aff | ||
|
475220e733 | ||
|
92a670df86 | ||
|
d8c0a1e28e | ||
|
92083238a3 |
10
INSTALL.in
@@ -18,12 +18,12 @@ GTK+ requires the following packages:
|
||||
Simple install procedure
|
||||
========================
|
||||
|
||||
% tar xf gtk+-@GTK_VERSION@.tar.xz # unpack the sources
|
||||
% cd gtk+-@GTK_VERSION@ # change to the toplevel directory
|
||||
% ./configure # run the `configure' script
|
||||
% make # build GTK+
|
||||
% gzip -cd gtk+-@GTK_VERSION@.tar.gz | tar xvf - # unpack the sources
|
||||
% cd gtk+-@GTK_VERSION@ # change to the toplevel directory
|
||||
% ./configure # run the `configure' script
|
||||
% make # build GTK+
|
||||
[ Become root if necessary ]
|
||||
% make install # install GTK+
|
||||
% make install # install GTK+
|
||||
|
||||
The Details
|
||||
===========
|
||||
|
357
NEWS
@@ -1,360 +1,3 @@
|
||||
Overview of Changes in GTK+ 3.7.2
|
||||
=================================
|
||||
|
||||
* Theming:
|
||||
- Improve touch text handle theming
|
||||
- Always draw background of menuitems
|
||||
|
||||
* Geometry management
|
||||
- Size groups now handle height-for-width
|
||||
- Fix corner cases in label size allocation
|
||||
|
||||
* Accessibility
|
||||
- Make entry icons accessible
|
||||
|
||||
* Filechooser
|
||||
- Don't add duplicate bookmarks
|
||||
- Remember sidebar width
|
||||
|
||||
* Wayland: Build against wayland-client 1.0
|
||||
|
||||
* Bugs fixed:
|
||||
524295 remember the file chooser side pane's position
|
||||
577806 gtk_file_chooser_add_shortcut_folder adds duplicates...
|
||||
677609 GtkSizeGroup regression in GTK+ 3.3.20
|
||||
683896 Clean up global resources when the display is closed
|
||||
686021 spinner animation should not be subject to enable-an...
|
||||
686347 Clickable icons are not accessible as children of te...
|
||||
687059 icon-theme: support loading symbolic GFileIcons from...
|
||||
687196 filesystemmodel: invalidate nodes on file remove
|
||||
687467 Commit "Implement proper cross-fades for gradients" ...
|
||||
687842 Support partially transparent widgets
|
||||
687872 Segfault when attempting to get character extents fo...
|
||||
687977 icon-theme: Add some preconditions for NULL arguments
|
||||
|
||||
* Translation updates:
|
||||
Assamese
|
||||
Brazilian Portuguese
|
||||
Estonian
|
||||
Galician
|
||||
German
|
||||
Greek
|
||||
Gujarati
|
||||
Indonesian
|
||||
Latvian
|
||||
Lithuanian
|
||||
Marathi
|
||||
Norwegian bokmål
|
||||
Serbian
|
||||
Slovenian
|
||||
Spanish
|
||||
Traditional Chinese
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.7.0
|
||||
=================================
|
||||
|
||||
* Add an "inverted" property to GtkLevelBar
|
||||
|
||||
* Support RTL flipping in GtkLevelBar
|
||||
|
||||
* Various memory leak fixes
|
||||
|
||||
* Wayland: Update for protocol changes
|
||||
|
||||
* Bugs fixed:
|
||||
684288 level-bar: add an "inverted" property like GtkProgr...
|
||||
684415 Fix drag-motion event handling
|
||||
684980 Improve the appearance of the dragged header
|
||||
686013 CSS: crash drawing a GtkEntry in gedit
|
||||
686152 Calls gdk_window_get_frame_extents with a potential...
|
||||
686209 memleak with "text-shadow" css
|
||||
686265 scrolledwindow: set GDK_EXPOSURE_MASK on the oversh...
|
||||
686280 GtkScrollbar and GtkScale rendering broken in gtk 3.6
|
||||
686366 Use named union for _GtkSymbolicColor in gtk/gtksym...
|
||||
|
||||
* Translation updates:
|
||||
Czech
|
||||
Estonian
|
||||
Galician
|
||||
Indonesian
|
||||
Lithuanian
|
||||
Serbian
|
||||
Slovak
|
||||
Slovenian
|
||||
Spanish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.6.1
|
||||
=================================
|
||||
|
||||
* CSS:
|
||||
- huge refactoring to avoid computing wrong values
|
||||
- treeview: Invalidate children properly
|
||||
- treeview: Fix computing child paths
|
||||
|
||||
* Broadway:
|
||||
- use binary websockets when available
|
||||
|
||||
* Bugs fixed:
|
||||
646221 Imperfect Russian translation of 'Print preview'...
|
||||
682395 Nautilus tabs have black background
|
||||
684517 window: Delay showing auto mnemonics on focus in
|
||||
684639 GTK+ 3.5.18 makes Epiphany unusable
|
||||
684984 No focus rendering for Icon Views in SELECTION_N...
|
||||
685449 Non-uniform borders on GtkScrolledWindow break c...
|
||||
685996 trivial build fix: test uses = not ==
|
||||
Fix a multi-display problem in touch handle code
|
||||
App chooser: respect NoDisplay
|
||||
|
||||
* Translation updates:
|
||||
Catalan
|
||||
Catalan (Valencian)
|
||||
Italian
|
||||
Japanese
|
||||
Khmer
|
||||
Norwegian bokmål
|
||||
Russian
|
||||
Slovak
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.6.0
|
||||
=================================
|
||||
|
||||
* Add support for blur to CSS shadows
|
||||
|
||||
* Bugs fixed:
|
||||
679883 When printing Custom paper sizes GTK Print Dialog...
|
||||
684258 Crash when calling gtk_application_set_menubar twice
|
||||
684606 GtkMenuButton: implement rtl flipping
|
||||
684607 GtkSearchEntry: flip the clear icon in rtl
|
||||
Fix style context path for internal buttons
|
||||
|
||||
* Translation updates:
|
||||
Bengali
|
||||
Brazilian Portuguese
|
||||
Bulgarian
|
||||
Catalan
|
||||
Catalan (Valencian)
|
||||
Czech
|
||||
Galician
|
||||
German
|
||||
Gujarati
|
||||
Hebrew
|
||||
Hindi
|
||||
Kannada
|
||||
Kyrgyz
|
||||
Latvian
|
||||
Malayalam
|
||||
Punjabi
|
||||
Russian
|
||||
Serbian
|
||||
Telugu
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.5.18
|
||||
==================================
|
||||
|
||||
* GMenu:
|
||||
- Support namespaces for actions
|
||||
- Allow submenus to have actions for opening
|
||||
- New function: gtk_menu_shell_bind_model
|
||||
|
||||
* CSS:
|
||||
- Parse and support CSS animations
|
||||
- Support cross-fading and transitions
|
||||
|
||||
* OS X:
|
||||
- Adjust scrollbar and scale behavior according to platform
|
||||
|
||||
* Bugs fixed
|
||||
643611 Leak on gail_widget_get_description
|
||||
658694 GtkAssistant: Unable to change current page in prepare...
|
||||
670390 -GtkMenuBar-shadow-type: none disables background inst...
|
||||
671786 Glade XML files cannot set an ImageMenuItem accelerato...
|
||||
674108 Hard crash due to wrong NSAutoreleasePool stacking
|
||||
676890 GtkButton are still highlighted after removing them fr...
|
||||
677559 argument of Gdk.Keymap.map_virtual_modifiers is not co...
|
||||
680962 GtkMenuButton doesn't display accelerators when used w...
|
||||
682630 GMenuModel attribute for an action to toggle on submen...
|
||||
682831 gtkmodelmenu: expose API for action namespace
|
||||
683474 Print dialog lists custom paper sizes twice for "Print...
|
||||
683627 Memory leak in style_data_lookup
|
||||
683718 box: Fix typo
|
||||
683738 Simplify GtkApplicationWindow accel handling
|
||||
683874 Load settings.ini also from XDG_CONFIG_DIRS
|
||||
683896 Clean up global resources when the display is closed
|
||||
684038 togglebutton: always set PRELIGHT state when in_button...
|
||||
684076 clean up a11y on shutdown
|
||||
684096 GtkWidget:drag-data-received code sample refers to rem...
|
||||
684156 fontchooserwidget: scroll to the currently selected row
|
||||
|
||||
* Translation updates
|
||||
Arabic
|
||||
Assamese
|
||||
Belarusian
|
||||
Brazilian Portuguese
|
||||
British English
|
||||
Danish
|
||||
Finnish
|
||||
French
|
||||
Galician
|
||||
Greek
|
||||
Hebrew
|
||||
Hungarian
|
||||
Indonesian
|
||||
Korean
|
||||
Lithuanian
|
||||
Persian
|
||||
Polish
|
||||
Portuguese
|
||||
Punjabi
|
||||
Serbian
|
||||
Slovenian
|
||||
Thai
|
||||
Spanish
|
||||
Russian
|
||||
Traditional Chinese
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.5.16
|
||||
==================================
|
||||
|
||||
* Fix critical warnings on startup in nautilus
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.5.14
|
||||
==================================
|
||||
|
||||
* Input method support
|
||||
- Propagate input purpose and hints to individual IMs
|
||||
- Add a hint to suppress on-screen keyboards
|
||||
|
||||
* GtkEntry can now set Pango attributes for its text
|
||||
|
||||
* GtkEntry and GtkTextView show 'selection handles' when
|
||||
used with touch devices
|
||||
|
||||
* GtkSpinButton can be oriented vertically
|
||||
|
||||
* Bugs fixed
|
||||
645065 GtkFileChooserButton doesn't handle closing its dialo...
|
||||
661973 gtk+ reacts on F10 press incorrectly with xkeyboard-c...
|
||||
672046 Issues with widget state propagation
|
||||
672431 the alt+tab app switch makes mnemonics flash
|
||||
676787 Update printing demo to use new print setting
|
||||
679144 Gdk doesn't properly find the child area with alpha
|
||||
681617 radio button text isn't centered when draw indicator ...
|
||||
682129 Print Dialog / Improving "Print to file" option
|
||||
682291 GtkMenuButton .ui issues
|
||||
682552 Improve the layout of the mount operations dialog
|
||||
682662 GtkAspectFrame: vertical alignment should be top/bott...
|
||||
682724 Fix a typo in the the comments
|
||||
682825 Also compile gtkdbusgenerated.c on non-UNIX environme...
|
||||
682919 Crash in GTK+-3.x (3.0.x-3.5.12+) on Windows with CJK...
|
||||
683001 Make headings bold in message dialogs by default
|
||||
683168 Make spinbutton orientable
|
||||
|
||||
* Translation updates
|
||||
Assamese
|
||||
French
|
||||
Galician
|
||||
Greek
|
||||
Indonesian
|
||||
Japanese
|
||||
Kazakh
|
||||
Latvian
|
||||
Lithuanian
|
||||
Norwegian bokmål
|
||||
Persian
|
||||
Polish
|
||||
Punjabi
|
||||
Spanish
|
||||
Vietnamese
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.5.12
|
||||
==================================
|
||||
|
||||
* GtkApplication:
|
||||
- Add gtk_application_get_active_window to get the active window
|
||||
- Add gtk_widget_insert_action_group to allow more flexibility
|
||||
when associating widgets with actions
|
||||
|
||||
* GtkMenuButton:
|
||||
- The gtk_menu_button_set_menu function is getting renamed
|
||||
to gtk_menu_button_set_popup. The old name is still available
|
||||
for now, but will be removed before 3.6
|
||||
|
||||
* GtkToolbar:
|
||||
- use CSS properties instead of style properties for padding
|
||||
|
||||
* Input method support:
|
||||
- GtkEntry and GtkTextView now have input-purpose and input-hints
|
||||
properties that let applications provide useful hints to
|
||||
input methods, like 'this entry is for a phone nr'.
|
||||
|
||||
* Bugs:
|
||||
373279 Toggling a GtkToggleButton emits "clicked", not "toggled"
|
||||
651244 Add a "purpose" tag for GtkEntries
|
||||
673478 Chain up notify implementations
|
||||
681577 Missing mnemonic in "Find applications online"
|
||||
681591 Masked string for password fields is not exposed to accessibility
|
||||
681613 icon view doesn't emit selection changed when the model changes
|
||||
682193 404 in GTK+ docs for duplicated "stable" URL suffix to ATK link
|
||||
682235 gtkmenubutton: repurpose set_menu for GMenuModel
|
||||
|
||||
* Translation updates:
|
||||
Assamese
|
||||
Esperanto
|
||||
Galician
|
||||
Lithuanian
|
||||
Marathi
|
||||
Portuguese
|
||||
Serbian
|
||||
Spanish
|
||||
Traditional Chinese
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.5.10
|
||||
==================================
|
||||
|
||||
* Wayland:
|
||||
- Add keyboard handling
|
||||
- Improve clipboard handling
|
||||
- Add default settings implementation
|
||||
|
||||
* GDK thread support has been deprecated
|
||||
|
||||
* Bugs fixed:
|
||||
679910 GtkTreeModelFilter: Fix _iter_previous() when iter...
|
||||
679978 Optimize gtk_widget_path_copy() by preallocating "...
|
||||
680754 deprecate gdk thread functions
|
||||
680803 menubutton: Clear references in dispose, not finalize
|
||||
680822 Document return value of GtkWidget::draw
|
||||
680901 GTK+: The chinese translations of "even sheet" and...
|
||||
680949 GtkColorButton documentation seems self-contradictory
|
||||
680988 GtkMenuButton down direction positioning suboptimal
|
||||
681005 [IconView] wrong transfer annotation for get_toolt...
|
||||
681006 Escape should cancel DnD operation
|
||||
681064 container: restyle queue leaks
|
||||
|
||||
* Updated translations
|
||||
Galician
|
||||
German
|
||||
Greek
|
||||
Gujarati
|
||||
Japanese
|
||||
Kazakh
|
||||
Norwegian bokmål
|
||||
Persian
|
||||
Serbian
|
||||
Slovenian
|
||||
Spanish
|
||||
Telugu
|
||||
Traditional Chinese
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.5.8
|
||||
=================================
|
||||
|
||||
|
13
README.in
@@ -75,17 +75,8 @@ Patches should be in unified diff form. (The -up option to GNU diff.)
|
||||
Release notes for 3.6
|
||||
=====================
|
||||
|
||||
* The accessibility bridge code that exports accessible objects
|
||||
on the bus is now used by default; atk-bridge has been converted
|
||||
into a library that GTK+ links against. To void the linking,
|
||||
pass --without-atk-bridge when configuring GTK+.
|
||||
|
||||
* GDK threading support has been deprecated. It is recommended to
|
||||
use g_idle_add(), g_main_context_invoke() and similar funtions
|
||||
to make all GTK+ calls from the main thread.
|
||||
|
||||
* GTK+ now follows the XDG Base Directory specification for
|
||||
user configuration and data files. In detail,
|
||||
* Now follows the XDG Base Directory specification for user
|
||||
configuration and data files. In detail,
|
||||
* $XDG_CONFIG_HOME/gtk-3.0/custom-papers is the new location
|
||||
for $HOME/.gtk-custom-papers
|
||||
* $XDG_CONFIG_HOME/gtk-3.0/bookmarks is the new location
|
||||
|
@@ -26,17 +26,16 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
@@ -63,10 +62,11 @@
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
|
@@ -27,7 +27,6 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
@@ -36,7 +35,6 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
|
@@ -27,7 +27,6 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
@@ -36,7 +35,6 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
@@ -64,9 +62,9 @@
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<CopyDir>$(GlibEtcInstallRoot)</CopyDir>
|
||||
<DefDir>$(SolutionDir)$(Configuration)\$(Platform)\obj\$(ProjectName)</DefDir>
|
||||
<GtkApiVersion>3.0</GtkApiVersion>
|
||||
<GtkBinaryVersion>3.0.0</GtkBinaryVersion>
|
||||
<GtkBinaryVersion>2.10.0</GtkBinaryVersion>
|
||||
<GtkDummyPrefix>\"/dummy\"</GtkDummyPrefix>
|
||||
<GtkPrefixDefine>GTK_PREFIX="\"$(GtkDummyPrefix)\""</GtkPrefixDefine>
|
||||
<GdkDefines>GDK_COMPILATION;G_LOG_DOMAIN="\"Gdk\""</GdkDefines>
|
||||
@@ -18,24 +18,24 @@ mkdir $(CopyDir)\bin
|
||||
|
||||
copy $(Configuration)\$(Platform)\bin\*.dll $(CopyDir)\bin
|
||||
|
||||
copy $(Configuration)\$(Platform)\bin\*.exe $(CopyDir)\bin
|
||||
|
||||
mkdir $(CopyDir)\bin\gtk3-demo
|
||||
|
||||
mkdir $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
|
||||
copy $(Configuration)\$(Platform)\bin\*.exe $(CopyDir)\bin\gtk3-demo
|
||||
|
||||
copy ..\..\..\demos\gtk-demo\*.c $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
|
||||
copy ..\..\..\demos\gtk-demo\*.c $(CopyDir)\bin\gtk3-demo
|
||||
|
||||
copy ..\..\..\demos\gtk-demo\*.css $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
|
||||
copy ..\..\..\demos\gtk-demo\*.css $(CopyDir)\bin\gtk3-demo
|
||||
|
||||
copy ..\..\..\demos\gtk-demo\*.h $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
|
||||
copy ..\..\..\demos\gtk-demo\*.h $(CopyDir)\bin\gtk3-demo
|
||||
|
||||
copy ..\..\..\demos\gtk-demo\*.ui $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
|
||||
copy ..\..\..\demos\gtk-demo\*.ui $(CopyDir)\bin\gtk3-demo
|
||||
|
||||
copy ..\..\..\demos\gtk-demo\*.jpg $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
|
||||
copy ..\..\..\demos\gtk-demo\*.jpg $(CopyDir)\bin\gtk3-demo
|
||||
|
||||
copy ..\..\..\demos\gtk-demo\*.png $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
|
||||
copy ..\..\..\demos\gtk-demo\*.png $(CopyDir)\bin\gtk3-demo
|
||||
|
||||
copy ..\..\..\demos\gtk-demo\*.gif $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
|
||||
copy ..\..\..\demos\gtk-demo\*.gif $(CopyDir)\bin\gtk3-demo
|
||||
|
||||
|
||||
mkdir $(CopyDir)\lib
|
||||
@@ -319,8 +319,6 @@ copy ..\..\..\gtk\gtklabel.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtklayout.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtklevelbar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtklinkbutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtkliststore.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
@@ -333,8 +331,6 @@ copy ..\..\..\gtk\gtkmenu.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtkmenubar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtkmenubutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtkmenuitem.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtkmenushell.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
@@ -415,8 +411,6 @@ copy ..\..\..\gtk\gtkscrollbar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtkscrolledwindow.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtksearchentry.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtkselection.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtkseparator.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?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">
|
||||
@@ -12,12 +12,10 @@
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
@@ -64,9 +62,9 @@
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
|
@@ -176,8 +176,6 @@
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\css_accordion.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\css_basics.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\css_multiplebgs.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\css_pixbufs.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\css_shadows.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\demo_resources.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\dialog.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\drawingarea.c" />
|
||||
|
@@ -47,12 +47,6 @@
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\css_multiplebgs.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\css_pixbufs.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\css_shadows.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\demo_resources.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
|
@@ -26,17 +26,16 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
|
@@ -23,7 +23,7 @@
|
||||
Name="Debug|Win32"
|
||||
InheritedPropertySheets=".\gtk+.vsprops"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="2"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -42,7 +42,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="1"
|
||||
LinkIncremental="2"
|
||||
AdditionalDependencies="atk-1.0.lib"
|
||||
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll"
|
||||
GenerateDebugInformation="true"
|
||||
@@ -77,7 +77,7 @@
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="atk-1.0.lib"
|
||||
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll"
|
||||
LinkIncremental="1"
|
||||
LinkIncremental="2"
|
||||
ModuleDefinitionFile="..\..\..\libgail-util\gailutil.def"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
@@ -89,7 +89,7 @@
|
||||
Name="Release|Win32"
|
||||
InheritedPropertySheets=".\gtk+.vsprops"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="2"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
@@ -126,7 +126,6 @@
|
||||
InheritedPropertySheets=".\gtk+.vsprops"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -144,7 +143,7 @@
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="atk-1.0.lib"
|
||||
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll"
|
||||
LinkIncremental="1"
|
||||
LinkIncremental="2"
|
||||
ModuleDefinitionFile="..\..\..\libgail-util\gailutil.def"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
|
@@ -46,7 +46,6 @@
|
||||
InheritedPropertySheets=".\gtk+.vsprops"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -88,7 +87,6 @@
|
||||
InheritedPropertySheets=".\gtk+.vsprops"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
|
@@ -44,7 +44,7 @@
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="imm32.lib"
|
||||
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll"
|
||||
LinkIncremental="1"
|
||||
LinkIncremental="2"
|
||||
ModuleDefinitionFile="$(IntDir)\gdk.def"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
@@ -57,7 +57,6 @@
|
||||
InheritedPropertySheets=".\gtk+.vsprops"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -75,7 +74,7 @@
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="imm32.lib"
|
||||
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll"
|
||||
LinkIncremental="1"
|
||||
LinkIncremental="2"
|
||||
ModuleDefinitionFile="$(IntDir)\gdk.def"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
@@ -110,7 +109,7 @@
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="imm32.lib"
|
||||
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll"
|
||||
LinkIncremental="1"
|
||||
LinkIncremental="2"
|
||||
ModuleDefinitionFile="$(IntDir)\gdk.def"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
@@ -123,7 +122,6 @@
|
||||
InheritedPropertySheets=".\gtk+.vsprops"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -141,7 +139,7 @@
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="imm32.lib"
|
||||
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll"
|
||||
LinkIncremental="1"
|
||||
LinkIncremental="2"
|
||||
ModuleDefinitionFile="$(IntDir)\gdk.def"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
|
@@ -41,7 +41,7 @@ copy ..\..\..\gdk\gdkconfig.h.win32 ..\..\..\gdk\gdkconfig.h

|
||||
/>
|
||||
<UserMacro
|
||||
Name="GtkBinaryVersion"
|
||||
Value="3.0.0"
|
||||
Value="2.10.0"
|
||||
/>
|
||||
<UserMacro
|
||||
Name="GtkDummyPrefix"
|
||||
@@ -69,17 +69,16 @@ copy ..\..\..\gdk\gdkconfig.h.win32 ..\..\..\gdk\gdkconfig.h

|
||||
echo on

|
||||
mkdir $(CopyDir)\bin

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

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

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

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

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

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

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

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

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

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

|
||||
mkdir $(CopyDir)\bin\gtk3-demo

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

|
||||
copy ..\..\..\demos\gtk-demo\*.c $(CopyDir)\bin\gtk3-demo

|
||||
copy ..\..\..\demos\gtk-demo\*.css $(CopyDir)\bin\gtk3-demo

|
||||
copy ..\..\..\demos\gtk-demo\*.h $(CopyDir)\bin\gtk3-demo

|
||||
copy ..\..\..\demos\gtk-demo\*.ui $(CopyDir)\bin\gtk3-demo

|
||||
copy ..\..\..\demos\gtk-demo\*.jpg $(CopyDir)\bin\gtk3-demo

|
||||
copy ..\..\..\demos\gtk-demo\*.png $(CopyDir)\bin\gtk3-demo

|
||||
copy ..\..\..\demos\gtk-demo\*.gif $(CopyDir)\bin\gtk3-demo

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

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

|
||||
@@ -223,14 +222,12 @@ copy ..\..\..\gtk\gtkinfobar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
copy ..\..\..\gtk\gtkinvisible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtklabel.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtklayout.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtklevelbar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtklinkbutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtkliststore.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtklockbutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtkmain.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtkmenu.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtkmenubar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtkmenubutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtkmenuitem.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtkmenushell.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtkmenutoolbutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
@@ -271,7 +268,6 @@ copy ..\..\..\gtk\gtkscalebutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#
|
||||
copy ..\..\..\gtk\gtkscrollable.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtkscrollbar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtkscrolledwindow.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtksearchentry.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtkselection.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtkseparator.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtkseparatormenuitem.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
|
@@ -44,7 +44,7 @@
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="atk-1.0.lib pangowin32-1.0.lib imm32.lib winspool.lib comctl32.lib"
|
||||
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll"
|
||||
LinkIncremental="1"
|
||||
LinkIncremental="2"
|
||||
ModuleDefinitionFile="$(IntDir)\gtk.def"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
@@ -57,7 +57,6 @@
|
||||
InheritedPropertySheets=".\gtk+.vsprops"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -75,7 +74,7 @@
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="atk-1.0.lib pangowin32-1.0.lib imm32.lib winspool.lib comctl32.lib"
|
||||
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll"
|
||||
LinkIncremental="1"
|
||||
LinkIncremental="2"
|
||||
ModuleDefinitionFile="$(IntDir)\gtk.def"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
@@ -110,7 +109,7 @@
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="atk-1.0.lib pangowin32-1.0.lib imm32.lib winspool.lib comctl32.lib"
|
||||
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll"
|
||||
LinkIncremental="1"
|
||||
LinkIncremental="2"
|
||||
ModuleDefinitionFile="$(IntDir)\gtk.def"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
@@ -123,7 +122,6 @@
|
||||
InheritedPropertySheets=".\gtk+.vsprops"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -141,7 +139,7 @@
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="atk-1.0.lib pangowin32-1.0.lib imm32.lib winspool.lib comctl32.lib"
|
||||
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll"
|
||||
LinkIncremental="1"
|
||||
LinkIncremental="2"
|
||||
ModuleDefinitionFile="$(IntDir)\gtk.def"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
|
@@ -44,7 +44,7 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""
|
||||
LinkIncremental="1"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
RandomizedBaseAddress="1"
|
||||
@@ -77,7 +77,7 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""
|
||||
LinkIncremental="1"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
RandomizedBaseAddress="1"
|
||||
@@ -171,8 +171,6 @@
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\combobox.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\css_accordion.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\css_basics.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\css_pixbufs.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\css_shadows.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\css_multiplebgs.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\demo_resources.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\dialog.c" />
|
||||
|
@@ -23,7 +23,7 @@
|
||||
Name="Debug|Win32"
|
||||
InheritedPropertySheets=".\gtk+.vsprops"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="2"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -67,7 +67,7 @@
|
||||
Name="Release|Win32"
|
||||
InheritedPropertySheets=".\gtk+.vsprops"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="2"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
@@ -91,7 +91,6 @@
|
||||
InheritedPropertySheets=".\gtk+.vsprops"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
|
@@ -20,6 +20,9 @@
|
||||
/* Define the location where the catalogs will be installed */
|
||||
#define GTK_LOCALEDIR "NONE/share/locale"
|
||||
|
||||
/* Define if we're using atk-bridge-2.0 */
|
||||
/* #undef HAVE_ATK_BRIDGE */
|
||||
|
||||
/* Define to 1 if you have the `bind_textdomain_codeset' function. */
|
||||
#define HAVE_BIND_TEXTDOMAIN_CODESET 1
|
||||
|
||||
@@ -296,11 +299,6 @@
|
||||
/* Define to 1 if the X Window System is missing or not being used. */
|
||||
/* #undef X_DISPLAY_MISSING */
|
||||
|
||||
/* Enable large inode numbers on Mac OS X 10.5. */
|
||||
#ifndef _DARWIN_USE_64_BIT_INODE
|
||||
# define _DARWIN_USE_64_BIT_INODE 1
|
||||
#endif
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
/* #undef _FILE_OFFSET_BITS */
|
||||
|
||||
|
84
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], [7])
|
||||
m4_define([gtk_micro_version], [3])
|
||||
m4_define([gtk_minor_version], [5])
|
||||
m4_define([gtk_micro_version], [9])
|
||||
m4_define([gtk_interface_age], [0])
|
||||
m4_define([gtk_binary_age],
|
||||
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
|
||||
@@ -39,7 +39,7 @@ AC_CONFIG_AUX_DIR([build-aux])
|
||||
m4_define([gtk_binary_version], [3.0.0])
|
||||
|
||||
# required versions of other packages
|
||||
m4_define([glib_required_version], [2.35.0])
|
||||
m4_define([glib_required_version], [2.33.1])
|
||||
m4_define([pango_required_version], [1.30.0])
|
||||
m4_define([atk_required_version], [2.5.3])
|
||||
m4_define([cairo_required_version], [1.10.0])
|
||||
@@ -383,7 +383,7 @@ else
|
||||
fi
|
||||
AC_SUBST(DISABLE_ON_QUARTZ)
|
||||
|
||||
if test "x$enable_broadway_backend" = xyes; then
|
||||
if test "x$enable_broadway_backend" == xyes; then
|
||||
GDK_BACKENDS="$GDK_BACKENDS broadway"
|
||||
cairo_backends="$cairo_backends cairo"
|
||||
GDK_WINDOWING="$GDK_WINDOWING
|
||||
@@ -394,8 +394,8 @@ else
|
||||
AM_CONDITIONAL(USE_BROADWAY, false)
|
||||
fi
|
||||
|
||||
if test "x$enable_wayland_backend" = "xyes"; then
|
||||
if test "x$enable_wayland_cairo_gl" = "xyes"; then
|
||||
if test "x$enable_wayland_backend" == "xyes"; then
|
||||
if test "x$enable_wayland_cairo_gl" == "xyes"; then
|
||||
# Wayland can use cairo-gl
|
||||
cairo_backends="$cairo_backends cairo-gl"
|
||||
AC_DEFINE(GDK_WAYLAND_USE_EGL, [1], [Whether to use EGL in Wayland backend])
|
||||
@@ -407,8 +407,8 @@ if test "x$enable_wayland_backend" = "xyes"; then
|
||||
have_gio_unix=yes
|
||||
GDK_WINDOWING="$GDK_WINDOWING
|
||||
#define GDK_WINDOWING_WAYLAND"
|
||||
WAYLAND_PACKAGES="wayland-client >= 1.0.0 xkbcommon >= 0.2.0 wayland-cursor"
|
||||
if test "x$enable_wayland_cairo_gl" = "xyes"; then
|
||||
WAYLAND_PACKAGES="wayland-client xkbcommon wayland-cursor"
|
||||
if test "x$enable_wayland_cairo_gl" == "xyes"; then
|
||||
WAYLAND_PACKAGES="$WAYLAND_PACKAGES wayland-egl egl"
|
||||
fi
|
||||
AM_CONDITIONAL(USE_WAYLAND, true)
|
||||
@@ -714,6 +714,7 @@ AM_PATH_GLIB_2_0(glib_required_version, :,
|
||||
*** GLIB is always available from ftp://ftp.gtk.org/pub/gtk/.]),
|
||||
gobject gmodule-no-export)
|
||||
|
||||
dnl
|
||||
dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
|
||||
dnl
|
||||
gtk_save_LIBS=$LIBS
|
||||
@@ -747,19 +748,6 @@ else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
#
|
||||
# Disable deprecation checks for all libraries we depend on on stable branches.
|
||||
# This is so newer versions of those libraries don't cause more warnings with
|
||||
# a stable GTK version.
|
||||
# We don't ever want to turn off deprecation warnings for master however, because
|
||||
# that's where we get rid of deprecated API we use.
|
||||
#
|
||||
if test m4_eval(gtk_minor_version % 2) = 0 ; then
|
||||
AC_DEFINE_UNQUOTED(GLIB_DISABLE_DEPRECATION_WARNINGS, 1,
|
||||
[Disable deprecation warnings from glib])
|
||||
fi
|
||||
|
||||
dnl
|
||||
saved_cflags="$CFLAGS"
|
||||
saved_ldflags="$LDFLAGS"
|
||||
|
||||
@@ -999,13 +987,11 @@ if test "x$enable_x11_backend" = xyes; then
|
||||
|
||||
AC_MSG_CHECKING([if <X11/extensions/XIproto.h> is needed for xReply])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlibint.h>]],
|
||||
[[xReply *rep = NULL;
|
||||
rep = rep;]])],
|
||||
[[xReply *rep;]])],
|
||||
[AC_MSG_RESULT([no])],
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/XIproto.h>
|
||||
#include <X11/Xlibint.h>]],
|
||||
[[xReply *rep = NULL;
|
||||
rep = rep;]])],
|
||||
[[xReply *rep;]])],
|
||||
[AC_MSG_RESULT([yes])
|
||||
AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], [1],
|
||||
[Define if <X11/extensions/XIproto.h> needed for xReply])],
|
||||
@@ -1617,53 +1603,33 @@ AM_CONDITIONAL(HAVE_COLORD, test "x$have_colord" = "xyes")
|
||||
|
||||
GTK_DOC_CHECK([1.11],[--flavour no-tmpl])
|
||||
|
||||
AC_CHECK_PROG(DB2HTML, db2html, true, false)
|
||||
AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
|
||||
|
||||
AC_ARG_ENABLE(man,
|
||||
[AS_HELP_STRING([--enable-man],
|
||||
[generate man pages [default=auto]])],,
|
||||
enable_man=maybe)
|
||||
[regenerate man pages from Docbook [default=no]])],
|
||||
[enable_man=yes],
|
||||
[enable_man=no])
|
||||
|
||||
if test "$enable_man" != no; then
|
||||
if test "${enable_man}" != no; then
|
||||
dnl
|
||||
dnl Check for xsltproc
|
||||
dnl
|
||||
AC_PATH_PROG([XSLTPROC], [xsltproc])
|
||||
if test -z "$XSLTPROC"; then
|
||||
if test "$enable_man" = yes ; then
|
||||
AC_MSG_ERROR([xsltproc is required for --enable-man])
|
||||
fi
|
||||
enable_man=no
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$enable_man" != no; then
|
||||
dnl check for DocBook DTD in the local catalog
|
||||
dnl check for DocBook DTD and stylesheets in the local catalog.
|
||||
JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN],
|
||||
[DocBook XML DTD V4.1.2], [have_docbook_dtd=yes], [have_docbook_dtd=no])
|
||||
if test "$have_docbook_dtd" != yes; then
|
||||
if test "$enable_man" = yes ; then
|
||||
AC_MSG_ERROR([DocBook DTD is required for --enable-man])
|
||||
fi
|
||||
enable_man=no
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$enable_man" != no; then
|
||||
dnl check for DocBook XSL stylesheets in the local catalog
|
||||
[DocBook XML DTD V4.1.2],,enable_man=no)
|
||||
JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
|
||||
[DocBook XSL Stylesheets], [have_docbook_style=yes],[have_docbook_style=no])
|
||||
if test "$have_docbook_dtd" != yes; then
|
||||
if test "$enable_man" = yes ; then
|
||||
AC_MSG_ERROR([DocBook XSL Stylesheets are required for --enable-man])
|
||||
fi
|
||||
enable_man=no
|
||||
fi
|
||||
[DocBook XSL Stylesheets],,enable_man=no)
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(ENABLE_MAN, test "$enable_man" != no)
|
||||
AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno)
|
||||
|
||||
AC_MSG_CHECKING([whether to generate man pages])
|
||||
if test "$enable_man" != no; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
##################################################
|
||||
# Output commands
|
||||
|
@@ -18,8 +18,6 @@ demos = \
|
||||
css_accordion.c \
|
||||
css_basics.c \
|
||||
css_multiplebgs.c \
|
||||
css_pixbufs.c \
|
||||
css_shadows.c \
|
||||
dialog.c \
|
||||
drawingarea.c \
|
||||
editable_cells.c \
|
||||
@@ -120,8 +118,6 @@ RESOURCES= application.ui \
|
||||
css_accordion.css \
|
||||
css_basics.css \
|
||||
css_multiplebgs.css \
|
||||
css_pixbufs.css \
|
||||
css_shadows.css \
|
||||
cssview.css \
|
||||
fancy.css \
|
||||
reset.css
|
||||
|
@@ -61,7 +61,6 @@ do_css_accordion (GtkWidget *do_widget)
|
||||
data = g_bytes_get_data (bytes, &data_size);
|
||||
|
||||
gtk_css_provider_load_from_data (GTK_CSS_PROVIDER (provider), (gchar *)data, data_size, NULL);
|
||||
g_bytes_unref (bytes);
|
||||
|
||||
apply_css (window, provider);
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
@import url("resource:///reset.css");
|
||||
@import url("reset.css");
|
||||
|
||||
* {
|
||||
transition-property: color, background-color, border-color, background-image, padding, border-width;
|
||||
@@ -49,4 +49,4 @@ GtkWindow {
|
||||
.button:hover:active,
|
||||
.button:active {
|
||||
background-color: #993401;
|
||||
}
|
||||
}
|
@@ -100,7 +100,6 @@ do_css_basics (GtkWidget *do_widget)
|
||||
|
||||
bytes = g_resources_lookup_data ("/css_basics/gtk.css", 0, NULL);
|
||||
gtk_text_buffer_set_text (text, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes));
|
||||
g_bytes_unref (bytes);
|
||||
|
||||
g_signal_connect (provider,
|
||||
"parsing-error",
|
||||
|
@@ -6,7 +6,7 @@
|
||||
|
||||
/* This CSS resets all properties to their defaults values
|
||||
* and overrides all user settings and the theme in use */
|
||||
@import url("resource:///reset.css");
|
||||
@import url("reset.css");
|
||||
|
||||
/* Set a very futuristic style by default */
|
||||
* {
|
||||
|
@@ -149,7 +149,6 @@ do_css_multiplebgs (GtkWidget *do_widget)
|
||||
|
||||
bytes = g_resources_lookup_data ("/css_multiplebgs/gtk.css", 0, NULL);
|
||||
gtk_text_buffer_set_text (text, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes));
|
||||
g_bytes_unref (bytes);
|
||||
|
||||
g_signal_connect (provider,
|
||||
"parsing-error",
|
||||
|
@@ -6,8 +6,8 @@
|
||||
|
||||
/* This CSS resets all properties to their defaults values
|
||||
* and overrides all user settings and the theme in use */
|
||||
@import url("resource:///reset.css");
|
||||
@import url("resource:///cssview.css");
|
||||
@import url("reset.css");
|
||||
@import url("cssview.css");
|
||||
|
||||
#canvas {
|
||||
transition-property: background-color, background-image;
|
||||
@@ -56,7 +56,7 @@
|
||||
/*
|
||||
#bricks-button {
|
||||
background-color: #eef;
|
||||
background-image: url('resource:///css_multiplebgs/brick.png');
|
||||
background-image: url('brick.png');
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
}
|
||||
@@ -133,4 +133,4 @@
|
||||
background-image: linear-gradient(90deg, transparent 79px, alpha(#999, 0.40) 79px, #999 80px, alpha(#999, 0.40) 81px, transparent 81px),
|
||||
linear-gradient(alpha(#bbb, 0.60), alpha(#bbb, 0.60) 1px, transparent 1px);
|
||||
}
|
||||
*/
|
||||
*/
|
@@ -1,127 +0,0 @@
|
||||
/* CSS Theming/Animated backgrounds
|
||||
*
|
||||
* This demo is done in honour of the Pixbufs demo further down. It is done exclusively
|
||||
* with CSS as the background of the window.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
static void
|
||||
show_parsing_error (GtkCssProvider *provider,
|
||||
GtkCssSection *section,
|
||||
const GError *error,
|
||||
GtkTextBuffer *buffer)
|
||||
{
|
||||
GtkTextIter start, end;
|
||||
const char *tag_name;
|
||||
|
||||
gtk_text_buffer_get_iter_at_line_index (buffer,
|
||||
&start,
|
||||
gtk_css_section_get_start_line (section),
|
||||
gtk_css_section_get_start_position (section));
|
||||
gtk_text_buffer_get_iter_at_line_index (buffer,
|
||||
&end,
|
||||
gtk_css_section_get_end_line (section),
|
||||
gtk_css_section_get_end_position (section));
|
||||
|
||||
if (g_error_matches (error, GTK_CSS_PROVIDER_ERROR, GTK_CSS_PROVIDER_ERROR_DEPRECATED))
|
||||
tag_name = "warning";
|
||||
else
|
||||
tag_name = "error";
|
||||
|
||||
gtk_text_buffer_apply_tag_by_name (buffer, tag_name, &start, &end);
|
||||
}
|
||||
|
||||
static void
|
||||
css_text_changed (GtkTextBuffer *buffer,
|
||||
GtkCssProvider *provider)
|
||||
{
|
||||
GtkTextIter start, end;
|
||||
char *text;
|
||||
|
||||
gtk_text_buffer_get_start_iter (buffer, &start);
|
||||
gtk_text_buffer_get_end_iter (buffer, &end);
|
||||
gtk_text_buffer_remove_all_tags (buffer, &start, &end);
|
||||
|
||||
text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
|
||||
gtk_css_provider_load_from_data (provider, text, -1, NULL);
|
||||
g_free (text);
|
||||
|
||||
gtk_style_context_reset_widgets (gdk_screen_get_default ());
|
||||
}
|
||||
|
||||
static void
|
||||
apply_css (GtkWidget *widget, GtkStyleProvider *provider)
|
||||
{
|
||||
gtk_style_context_add_provider (gtk_widget_get_style_context (widget), provider, G_MAXUINT);
|
||||
if (GTK_IS_CONTAINER (widget))
|
||||
gtk_container_forall (GTK_CONTAINER (widget), (GtkCallback) apply_css, provider);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_css_pixbufs (GtkWidget *do_widget)
|
||||
{
|
||||
if (!window)
|
||||
{
|
||||
GtkWidget *paned, *container, *child;
|
||||
GtkStyleProvider *provider;
|
||||
GtkTextBuffer *text;
|
||||
GBytes *bytes;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
paned = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
|
||||
gtk_container_add (GTK_CONTAINER (window), paned);
|
||||
|
||||
/* Need a filler so we get a handle */
|
||||
child = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
gtk_container_add (GTK_CONTAINER (paned), child);
|
||||
|
||||
text = gtk_text_buffer_new (NULL);
|
||||
gtk_text_buffer_create_tag (text,
|
||||
"warning",
|
||||
"underline", PANGO_UNDERLINE_SINGLE,
|
||||
NULL);
|
||||
gtk_text_buffer_create_tag (text,
|
||||
"error",
|
||||
"underline", PANGO_UNDERLINE_ERROR,
|
||||
NULL);
|
||||
|
||||
provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ());
|
||||
|
||||
container = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_container_add (GTK_CONTAINER (paned), container);
|
||||
child = gtk_text_view_new_with_buffer (text);
|
||||
gtk_container_add (GTK_CONTAINER (container), child);
|
||||
g_signal_connect (text,
|
||||
"changed",
|
||||
G_CALLBACK (css_text_changed),
|
||||
provider);
|
||||
|
||||
bytes = g_resources_lookup_data ("/css_pixbufs/gtk.css", 0, NULL);
|
||||
gtk_text_buffer_set_text (text, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes));
|
||||
|
||||
g_signal_connect (provider,
|
||||
"parsing-error",
|
||||
G_CALLBACK (show_parsing_error),
|
||||
gtk_text_view_get_buffer (GTK_TEXT_VIEW (child)));
|
||||
|
||||
apply_css (window, provider);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_widget_show_all (window);
|
||||
else
|
||||
{
|
||||
gtk_widget_destroy (window);
|
||||
window = NULL;
|
||||
}
|
||||
|
||||
return window;
|
||||
}
|
@@ -6,8 +6,8 @@
|
||||
|
||||
/* This CSS resets all properties to their defaults values
|
||||
* and overrides all user settings and the theme in use */
|
||||
@import url("resource:///reset.css");
|
||||
@import url("resource:///cssview.css");
|
||||
@import url("reset.css");
|
||||
@import url("cssview.css");
|
||||
|
||||
@keyframes move-the-image {
|
||||
0% { background-position: 50.00% 75.00%, 67.68% 67.68%, 75.00% 50.00%, 67.68% 32.32%, 50.00% 25.00%, 32.32% 32.32%, 25.00% 50.00%, 32.32% 67.68%, 0% 0%; }
|
||||
@@ -46,31 +46,21 @@
|
||||
}
|
||||
|
||||
@keyframes size-the-image {
|
||||
0% { background-size: 96px, 12px, 96px, 12px, 96px, 12px, 96px, 12px, auto }
|
||||
100% { background-size: 12px, 96px, 12px, 96px, 12px, 96px, 12px, 96px, auto }
|
||||
0% { background-size: 96px, 12px, 96px, 12px, 96px, 12px, 96px, 12px, 100% }
|
||||
100% { background-size: 12px, 96px, 12px, 96px, 12px, 96px, 12px, 96px, 100% }
|
||||
}
|
||||
|
||||
GtkWindow {
|
||||
background-image: url("resource:///css_pixbufs/apple-red.png"),
|
||||
url("resource:///css_pixbufs/gnome-applets.png"),
|
||||
url("resource:///css_pixbufs/gnome-calendar.png"),
|
||||
url("resource:///css_pixbufs/gnome-foot.png"),
|
||||
url("resource:///css_pixbufs/gnome-gmush.png"),
|
||||
url("resource:///css_pixbufs/gnome-gimp.png"),
|
||||
url("resource:///css_pixbufs/gnome-gsame.png"),
|
||||
url("resource:///css_pixbufs/gnu-keys.png"),
|
||||
url("resource:///css_pixbufs/background.jpg");
|
||||
background-image: url("apple-red.png"),
|
||||
url("gnome-applets.png"),
|
||||
url("gnome-calendar.png"),
|
||||
url("gnome-foot.png"),
|
||||
url("gnome-gmush.png"),
|
||||
url("gnome-gimp.png"),
|
||||
url("gnome-gsame.png"),
|
||||
url("gnu-keys.png"),
|
||||
url("background.jpg");
|
||||
background-position: 50.00% 75.00%, 67.68% 67.68%, 75.00% 50.00%, 67.68% 32.32%, 50.00% 25.00%, 32.32% 32.32%, 25.00% 50.00%, 32.32% 67.68%, 0% 0%;
|
||||
background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat;
|
||||
animation: move-the-image infinite linear 3s, size-the-image infinite alternate ease-in-out 0.75s;
|
||||
}
|
||||
|
||||
/* Make the text editor has a nice style */
|
||||
.view, .scrollbar, .pane-separator {
|
||||
color: black;
|
||||
background-color: rgba(255,255,255,0.5);
|
||||
}
|
||||
|
||||
.view:selected {
|
||||
background-color: rgba(127,127,255,0.5);
|
||||
}
|
||||
|
@@ -1,147 +0,0 @@
|
||||
/* CSS Theming/Shadows
|
||||
*
|
||||
* This demo shows how to use CSS shadows.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
static void
|
||||
show_parsing_error (GtkCssProvider *provider,
|
||||
GtkCssSection *section,
|
||||
const GError *error,
|
||||
GtkTextBuffer *buffer)
|
||||
{
|
||||
GtkTextIter start, end;
|
||||
const char *tag_name;
|
||||
|
||||
gtk_text_buffer_get_iter_at_line_index (buffer,
|
||||
&start,
|
||||
gtk_css_section_get_start_line (section),
|
||||
gtk_css_section_get_start_position (section));
|
||||
gtk_text_buffer_get_iter_at_line_index (buffer,
|
||||
&end,
|
||||
gtk_css_section_get_end_line (section),
|
||||
gtk_css_section_get_end_position (section));
|
||||
|
||||
if (g_error_matches (error, GTK_CSS_PROVIDER_ERROR, GTK_CSS_PROVIDER_ERROR_DEPRECATED))
|
||||
tag_name = "warning";
|
||||
else
|
||||
tag_name = "error";
|
||||
|
||||
gtk_text_buffer_apply_tag_by_name (buffer, tag_name, &start, &end);
|
||||
}
|
||||
|
||||
static void
|
||||
css_text_changed (GtkTextBuffer *buffer,
|
||||
GtkCssProvider *provider)
|
||||
{
|
||||
GtkTextIter start, end;
|
||||
char *text;
|
||||
|
||||
gtk_text_buffer_get_start_iter (buffer, &start);
|
||||
gtk_text_buffer_get_end_iter (buffer, &end);
|
||||
gtk_text_buffer_remove_all_tags (buffer, &start, &end);
|
||||
|
||||
text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
|
||||
gtk_css_provider_load_from_data (provider, text, -1, NULL);
|
||||
g_free (text);
|
||||
|
||||
gtk_style_context_reset_widgets (gdk_screen_get_default ());
|
||||
}
|
||||
|
||||
static void
|
||||
apply_css (GtkWidget *widget, GtkStyleProvider *provider)
|
||||
{
|
||||
gtk_style_context_add_provider (gtk_widget_get_style_context (widget), provider, G_MAXUINT);
|
||||
if (GTK_IS_CONTAINER (widget))
|
||||
gtk_container_forall (GTK_CONTAINER (widget), (GtkCallback) apply_css, provider);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
create_toolbar (void)
|
||||
{
|
||||
GtkWidget *toolbar;
|
||||
GtkToolItem *item;
|
||||
|
||||
toolbar = gtk_toolbar_new ();
|
||||
gtk_widget_set_valign (toolbar, GTK_ALIGN_CENTER);
|
||||
|
||||
item = gtk_tool_button_new_from_stock (GTK_STOCK_GO_FORWARD);
|
||||
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
|
||||
|
||||
item = gtk_tool_button_new_from_stock (GTK_STOCK_GO_BACK);
|
||||
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
|
||||
|
||||
item = gtk_tool_button_new (NULL, "Hello World");
|
||||
gtk_tool_item_set_is_important (item, TRUE);
|
||||
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
|
||||
|
||||
return toolbar;
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_css_shadows (GtkWidget *do_widget)
|
||||
{
|
||||
if (!window)
|
||||
{
|
||||
GtkWidget *paned, *container, *child;
|
||||
GtkStyleProvider *provider;
|
||||
GtkTextBuffer *text;
|
||||
GBytes *bytes;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
paned = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
|
||||
gtk_container_add (GTK_CONTAINER (window), paned);
|
||||
|
||||
child = create_toolbar ();
|
||||
gtk_container_add (GTK_CONTAINER (paned), child);
|
||||
|
||||
text = gtk_text_buffer_new (NULL);
|
||||
gtk_text_buffer_create_tag (text,
|
||||
"warning",
|
||||
"underline", PANGO_UNDERLINE_SINGLE,
|
||||
NULL);
|
||||
gtk_text_buffer_create_tag (text,
|
||||
"error",
|
||||
"underline", PANGO_UNDERLINE_ERROR,
|
||||
NULL);
|
||||
|
||||
provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ());
|
||||
|
||||
container = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_container_add (GTK_CONTAINER (paned), container);
|
||||
child = gtk_text_view_new_with_buffer (text);
|
||||
gtk_container_add (GTK_CONTAINER (container), child);
|
||||
g_signal_connect (text,
|
||||
"changed",
|
||||
G_CALLBACK (css_text_changed),
|
||||
provider);
|
||||
|
||||
bytes = g_resources_lookup_data ("/css_shadows/gtk.css", 0, NULL);
|
||||
gtk_text_buffer_set_text (text, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes));
|
||||
|
||||
g_signal_connect (provider,
|
||||
"parsing-error",
|
||||
G_CALLBACK (show_parsing_error),
|
||||
gtk_text_view_get_buffer (GTK_TEXT_VIEW (child)));
|
||||
|
||||
apply_css (window, provider);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_widget_show_all (window);
|
||||
else
|
||||
{
|
||||
gtk_widget_destroy (window);
|
||||
window = NULL;
|
||||
}
|
||||
|
||||
return window;
|
||||
}
|
@@ -1,44 +0,0 @@
|
||||
/* You can edit the text in this window to change the
|
||||
* appearance of this Window.
|
||||
* Be careful, if you screw it up, nothing might be visible
|
||||
* anymore. :)
|
||||
*/
|
||||
|
||||
/* This CSS resets all properties to their defaults values
|
||||
* and overrides all user settings and the theme in use */
|
||||
@import url("resource:///reset.css");
|
||||
@import url("resource:///cssview.css");
|
||||
|
||||
/* Get a nice background for the window */
|
||||
.background {
|
||||
background-color: #4870bc;
|
||||
background-image: linear-gradient(to left, transparent, rgba(255,255,255,.07) 50%, transparent 50%),
|
||||
linear-gradient(to left, transparent, rgba(255,255,255,.13) 50%, transparent 50%),
|
||||
linear-gradient(to left, transparent, transparent 50%, rgba(255,255,255,.17) 50%),
|
||||
linear-gradient(to left, transparent, transparent 50%, rgba(255,255,255,.19) 50%);
|
||||
background-size: 29px, 59px, 73px, 109px;
|
||||
}
|
||||
|
||||
.button {
|
||||
color: black;
|
||||
padding: 10px;
|
||||
border-radius: 5px;
|
||||
transition: all 250ms ease-in;
|
||||
border: 1px transparent solid;
|
||||
}
|
||||
|
||||
.button:hover {
|
||||
text-shadow: 3px 3px 5px alpha(black, 0.75);
|
||||
icon-shadow: 3px 3px 5px alpha(black, 0.75);
|
||||
box-shadow: 3px 3px 5px alpha(black, 0.5) inset;
|
||||
border: solid 1px alpha(black, 0.75);
|
||||
}
|
||||
|
||||
.button:active {
|
||||
padding: 11px 9px 9px 11px;
|
||||
text-shadow: 1px 1px 2.5px alpha(black, 0.6);
|
||||
icon-shadow: 1px 1px 2.5px alpha(black, 0.6);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -20,7 +20,6 @@
|
||||
</gresource>
|
||||
<gresource prefix="/css_multiplebgs">
|
||||
<file alias="gtk.css">css_multiplebgs.css</file>
|
||||
<file>brick.png</file>
|
||||
</gresource>
|
||||
<gresource prefix="/theming_custom_css">
|
||||
<file alias="gtk.css">fancy.css</file>
|
||||
@@ -28,19 +27,4 @@
|
||||
<gresource prefix="/theming_style_classes">
|
||||
<file preprocess="xml-stripblanks">theming.ui</file>
|
||||
</gresource>
|
||||
<gresource prefix="/css_pixbufs">
|
||||
<file alias="gtk.css">css_pixbufs.css</file>
|
||||
<file>background.jpg</file>
|
||||
<file>apple-red.png</file>
|
||||
<file>gnome-applets.png</file>
|
||||
<file>gnome-calendar.png</file>
|
||||
<file>gnome-foot.png</file>
|
||||
<file>gnome-gmush.png</file>
|
||||
<file>gnome-gimp.png</file>
|
||||
<file>gnome-gsame.png</file>
|
||||
<file>gnu-keys.png</file>
|
||||
</gresource>
|
||||
<gresource prefix="/css_shadows">
|
||||
<file alias="gtk.css">css_shadows.css</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
|
@@ -1,65 +1,24 @@
|
||||
GtkButton#fancy {
|
||||
transition: none;
|
||||
background-image: linear-gradient(to bottom,
|
||||
alpha(white, 0.7),
|
||||
alpha(white, 0) 30%),
|
||||
linear-gradient(to top,
|
||||
alpha(#babdb6, 0.4),
|
||||
alpha(#babdb6, 0) 50%),
|
||||
linear-gradient(135deg,
|
||||
#eeeeec,
|
||||
white 20%,
|
||||
#d3d7cf,
|
||||
white 80%,
|
||||
#babdb6);
|
||||
color: #3465a4;
|
||||
font-weight: bold;
|
||||
text-shadow: 0 1px white;
|
||||
font-weight: bold;
|
||||
background-image: linear-gradient(135deg, yellow, blue);
|
||||
border-radius: 20px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
GtkButton#fancy:hover {
|
||||
transition: all 250ms linear;
|
||||
background-image: linear-gradient(to bottom,
|
||||
alpha(white, 1),
|
||||
alpha(white, 0)),
|
||||
linear-gradient(135deg,
|
||||
#eeeeec 10%,
|
||||
white 40%,
|
||||
#d3d7cf,
|
||||
white 70%,
|
||||
#babdb6);
|
||||
color: #204a87;
|
||||
font-weight: bold;
|
||||
background-image: linear-gradient(135deg, blue, yellow);
|
||||
border-radius: 20px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
GtkButton#fancy:active,
|
||||
GtkButton#fancy:active:hover {
|
||||
transition: none;
|
||||
background-image: linear-gradient(to bottom,
|
||||
alpha(#555753, 0.5),
|
||||
alpha(#babdb6, 0.3)),
|
||||
linear-gradient(135deg,
|
||||
#eeeeec,
|
||||
white 20%,
|
||||
#d3d7cf,
|
||||
white 80%,
|
||||
#babdb6);
|
||||
color: white;
|
||||
text-shadow: 0 1px black;
|
||||
}
|
||||
|
||||
GtkButton#fancy:backdrop,
|
||||
GtkButton#fancy:backdrop:hover {
|
||||
transition: none;
|
||||
background-image: linear-gradient(135deg,
|
||||
alpha(#eeeeec, 0.5) 10%,
|
||||
alpha(white, 0.5) 40%,
|
||||
alpha(#d3d7cf, 0.5),
|
||||
alpha(white, 0.5) 70%,
|
||||
alpha(#babdb6, 0.5));
|
||||
color: #babdb6;
|
||||
GtkButton#fancy:active {
|
||||
font-weight: bold;
|
||||
background-image: linear-gradient(yellow, yellow);
|
||||
border-radius: 20px;
|
||||
color: black;
|
||||
}
|
||||
|
||||
GtkButton#fancy * {
|
||||
/* Yeah this should be inherited by default */
|
||||
color: inherit;
|
||||
color: inherit;
|
||||
}
|
||||
|
@@ -579,7 +579,10 @@ load_file (const gchar *filename)
|
||||
}
|
||||
|
||||
if (current_file && !strcmp (current_file, names[0]))
|
||||
goto out;
|
||||
{
|
||||
g_string_free (buffer, TRUE);
|
||||
return;
|
||||
}
|
||||
|
||||
g_free (current_file);
|
||||
current_file = g_strdup (names[0]);
|
||||
@@ -595,7 +598,7 @@ load_file (const gchar *filename)
|
||||
{
|
||||
g_warning ("%s", err->message);
|
||||
g_error_free (err);
|
||||
goto out;
|
||||
return;
|
||||
}
|
||||
|
||||
file = g_fopen (full_filename, "r");
|
||||
@@ -606,7 +609,7 @@ load_file (const gchar *filename)
|
||||
g_free (full_filename);
|
||||
|
||||
if (!file)
|
||||
goto out;
|
||||
return;
|
||||
|
||||
gtk_text_buffer_get_iter_at_offset (info_buffer, &start, 0);
|
||||
while (read_line (file, buffer))
|
||||
@@ -722,7 +725,6 @@ load_file (const gchar *filename)
|
||||
|
||||
fontify ();
|
||||
|
||||
out:
|
||||
g_string_free (buffer, TRUE);
|
||||
|
||||
g_strfreev (names);
|
||||
|
@@ -149,6 +149,8 @@ do_printing (GtkWidget *do_widget)
|
||||
GtkPrintOperation *operation;
|
||||
GtkPrintSettings *settings;
|
||||
PrintData *data;
|
||||
gchar *uri, *ext;
|
||||
const gchar *dir;
|
||||
GError *error = NULL;
|
||||
|
||||
operation = gtk_print_operation_new ();
|
||||
@@ -168,14 +170,25 @@ do_printing (GtkWidget *do_widget)
|
||||
gtk_print_operation_set_embed_page_setup (operation, TRUE);
|
||||
|
||||
settings = gtk_print_settings_new ();
|
||||
dir = g_get_user_special_dir (G_USER_DIRECTORY_DOCUMENTS);
|
||||
if (dir == NULL)
|
||||
dir = g_get_home_dir ();
|
||||
if (g_strcmp0 (gtk_print_settings_get (settings, GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT), "ps") == 0)
|
||||
ext = ".ps";
|
||||
else if (g_strcmp0 (gtk_print_settings_get (settings, GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT), "svg") == 0)
|
||||
ext = ".svg";
|
||||
else
|
||||
ext = ".pdf";
|
||||
|
||||
gtk_print_settings_set (settings, GTK_PRINT_SETTINGS_OUTPUT_BASENAME, "gtk-demo");
|
||||
uri = g_strconcat ("file://", dir, "/", "gtk-demo", ext, NULL);
|
||||
gtk_print_settings_set (settings, GTK_PRINT_SETTINGS_OUTPUT_URI, uri);
|
||||
gtk_print_operation_set_print_settings (operation, settings);
|
||||
|
||||
gtk_print_operation_run (operation, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, GTK_WINDOW (do_widget), &error);
|
||||
|
||||
g_object_unref (operation);
|
||||
g_object_unref (settings);
|
||||
g_free (uri);
|
||||
|
||||
if (error)
|
||||
{
|
||||
|
@@ -65,26 +65,12 @@ show_about (GtkMenuItem *item, GtkWidget *window)
|
||||
g_object_unref (pixbuf);
|
||||
}
|
||||
|
||||
static void
|
||||
on_page_toggled (GtkToggleButton *button,
|
||||
GtkNotebook *pages)
|
||||
{
|
||||
gint page;
|
||||
|
||||
if (!gtk_toggle_button_get_active (button))
|
||||
return;
|
||||
|
||||
page = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (button), "page"));
|
||||
gtk_notebook_set_current_page (pages, page);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
GtkWidget *window;
|
||||
GtkWidget *widget;
|
||||
GtkWidget *notebook;
|
||||
gboolean dark = FALSE;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
@@ -102,15 +88,6 @@ main (int argc, char *argv[])
|
||||
g_signal_connect (widget, "toggled", G_CALLBACK (dark_toggled), NULL);
|
||||
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (widget), dark);
|
||||
|
||||
notebook = (GtkWidget*) gtk_builder_get_object (builder, "toplevel_notebook");
|
||||
widget = (GtkWidget*) gtk_builder_get_object (builder, "togglepage1");
|
||||
g_object_set_data (G_OBJECT (widget), "page", GINT_TO_POINTER (0));
|
||||
g_signal_connect (widget, "toggled", G_CALLBACK (on_page_toggled), notebook);
|
||||
|
||||
widget = (GtkWidget*) gtk_builder_get_object (builder, "togglepage2");
|
||||
g_object_set_data (G_OBJECT (widget), "page", GINT_TO_POINTER (1));
|
||||
g_signal_connect (widget, "toggled", G_CALLBACK (on_page_toggled), notebook);
|
||||
|
||||
widget = (GtkWidget*) gtk_builder_get_object (builder, "aboutmenuitem");
|
||||
g_signal_connect (widget, "activate", G_CALLBACK (show_about), window);
|
||||
|
||||
|
@@ -89,20 +89,25 @@ Make sure that gtk-doc is the latest released version.
|
||||
it to download.gnome.org. If you don't have an account on master.gnome.org,
|
||||
find someone who can do it for you. The command for this looks like
|
||||
|
||||
scp gtk+-2.12.10.tar.xz matthiasc@master.gnome.org:
|
||||
ssh matthiasc@master.gnome.org ftpadmin install gtk+-2.12.10.tar.xz
|
||||
scp gtk+-2.12.10.tar.gz matthiasc@master.gnome.org:
|
||||
ssh matthiasc@master.gnome.org
|
||||
install-module gtk+-2.12.10.tar.gz
|
||||
|
||||
15) Upload the tarball and checksum to ftp.gtk.org and put them in the right
|
||||
directory below /ftp/pub. Pay attention to correct ownership, and don't
|
||||
forget to update the LATEST file in the directory.
|
||||
15) Get the .bz2 tarball and the .md5sum files back from master.gnome.org
|
||||
You can probably also create it locally, but I've experienced md5
|
||||
mismatches when doing so.
|
||||
|
||||
16) Go to the gnome-announce list archives, find the last announce message,
|
||||
16) Upload the .gz and .bz2 tarballs and checksums to ftp.gtk.org and put
|
||||
them in the right directory below /ftp/pub. Pay attention to correct
|
||||
ownership, and don't forget to update the LATEST file in the directory.
|
||||
|
||||
17) Go to the gnome-announce list archives, find the last announce message,
|
||||
create a new message in the same form, replacing version numbers,
|
||||
commentary at the top about "what this release is about" and the
|
||||
summary of changes.
|
||||
|
||||
17) Send it to gnome-announce-list, gtk-list, gtk-app-devel-list and
|
||||
18) Send it to gnome-announce-list, gtk-list, gtk-app-devel-list and
|
||||
gtk-devel-list. Set reply-to to desktop-devel-list.
|
||||
|
||||
18) Add a link to the release announcement to www.gtk.org which lives
|
||||
19) Add a link to the release announcement to www.gtk.org which lives
|
||||
in the gtk-web git module.
|
||||
|
@@ -12,7 +12,7 @@
|
||||
The latest versions can be found online at
|
||||
<ulink role="online-location" url="http://developer.gnome.org/gdk3/">http://developer.gnome.org/gdk3/</ulink>.
|
||||
If you are looking for the older GDK 2 series of libraries,
|
||||
see <ulink role="online-location" url="http://developer.gnome.org/gdk2/">http://developer.gnome.org/gdk2/</ulink>.
|
||||
see <ulink role="online-location" url="http://developer.gnome.org/gdk/">http://developer.gnome.org/gdk/</ulink>.
|
||||
</releaseinfo>
|
||||
</bookinfo>
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<xi:include href="xml/cairo_interaction.xml" />
|
||||
<xi:include href="xml/x_interaction.xml" />
|
||||
<xi:include href="xml/gdkapplaunchcontext.xml" />
|
||||
<xi:include href="xml/gdktestutils.xml" />
|
||||
<xi:include href="xml/gdktesting.xml" />
|
||||
</reference>
|
||||
|
||||
<index id="api-index-full">
|
||||
|
@@ -1145,8 +1145,8 @@ gdk_app_launch_context_get_type
|
||||
|
||||
<SECTION>
|
||||
<TITLE>Testing</TITLE>
|
||||
<FILE>gdktestutils</FILE>
|
||||
<FILE>gdktesting</FILE>
|
||||
gdk_test_render_sync
|
||||
gdk_test_simulate_button
|
||||
gdk_test_simulate_key
|
||||
</SECTION>
|
||||
|
||||
|
@@ -309,7 +309,6 @@ HTML_IMAGES = \
|
||||
$(srcdir)/images/icon-view.png \
|
||||
$(srcdir)/images/image.png \
|
||||
$(srcdir)/images/label.png \
|
||||
$(srcdir)/images/levelbar.png \
|
||||
$(srcdir)/images/link-button.png \
|
||||
$(srcdir)/images/list-and-tree.png \
|
||||
$(srcdir)/images/lock-button.png \
|
||||
@@ -382,19 +381,7 @@ HTML_IMAGES = \
|
||||
$(srcdir)/images/numerableicon2.png \
|
||||
$(srcdir)/images/bloatpad-osx.png \
|
||||
$(srcdir)/images/bloatpad-gnome.png \
|
||||
$(srcdir)/images/bloatpad-xfce.png \
|
||||
$(srcdir)/images/down-center.png \
|
||||
$(srcdir)/images/down-end.png \
|
||||
$(srcdir)/images/down-start.png \
|
||||
$(srcdir)/images/left-center.png \
|
||||
$(srcdir)/images/left-end.png \
|
||||
$(srcdir)/images/left-start.png \
|
||||
$(srcdir)/images/right-center.png \
|
||||
$(srcdir)/images/right-end.png \
|
||||
$(srcdir)/images/right-start.png \
|
||||
$(srcdir)/images/up-center.png \
|
||||
$(srcdir)/images/up-end.png \
|
||||
$(srcdir)/images/up-start.png
|
||||
$(srcdir)/images/bloatpad-xfce.png
|
||||
|
||||
# Extra options to supply to gtkdoc-fixref
|
||||
FIXXREF_OPTIONS=--extra-dir=../gdk/html \
|
||||
@@ -419,16 +406,8 @@ man_MANS = \
|
||||
|
||||
if ENABLE_MAN
|
||||
|
||||
XSLTPROC_FLAGS = \
|
||||
--nonet \
|
||||
--stringparam man.output.quietly 1 \
|
||||
--stringparam funcsynopsis.style ansi \
|
||||
--stringparam man.th.extra1.suppress 1 \
|
||||
--stringparam man.authors.section.enabled 0 \
|
||||
--stringparam man.copyright.section.enabled 0
|
||||
|
||||
.xml.1:
|
||||
$(AM_V_GEN) $(XSLTPROC) $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
|
||||
@XSLTPROC@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
|
||||
|
||||
dist-local-check-mans-enabled:
|
||||
if grep "Man generation disabled" $(man_MANS) >/dev/null; then $(RM) $(man_MANS); fi
|
||||
|
@@ -63,22 +63,6 @@ to use. APIs that were deprecated before or introduced after
|
||||
this range will trigger compiler warnings.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
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_REQIRED=GDK_VERSION_3_2 `pkg-config --cflags --libs gtk+-3.0` hello.c -o hello
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
And here is how you would compile hello.c if you don't want
|
||||
it to use any symbols that were introduced after 3.4:
|
||||
<programlisting>
|
||||
$ cc -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_4 `pkg-config --cflags --libs gtk+-3.0` hello.c -o hello
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The older deprecation mechanism of hiding deprecated interfaces
|
||||
entirely from the compiler by using the preprocessor symbol
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<chapter id="gtk-getting-started" xmlns:xi="http://www.w3.org/2003/XInclude">
|
||||
<title>Getting Started with GTK+</title>
|
||||
|
||||
<para>This chapter contains some tutorial information to get you
|
||||
<para>This chapter is contains some tutorial information to get you
|
||||
started with GTK+ programming. It assumes that you have GTK+, its
|
||||
dependencies and a C compiler installed and ready to use. If you
|
||||
need to build GTK+ itself first, refer to the
|
||||
|
@@ -14,7 +14,7 @@
|
||||
The latest versions can be found online at
|
||||
<ulink role="online-location" url="http://developer.gnome.org/gtk3/">http://developer.gnome.org/gtk3/</ulink>.
|
||||
If you are looking for the older GTK+ 2 series of libraries,
|
||||
see <ulink role="online-location" url="http://developer.gnome.org/gtk2/">http://developer.gnome.org/gtk2/</ulink>.
|
||||
see <ulink role="online-location" url="http://developer.gnome.org/gtk/">http://developer.gnome.org/gtk/</ulink>.
|
||||
</releaseinfo>
|
||||
</bookinfo>
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
|
||||
<refentryinfo>
|
||||
<title>gtk-launch</title>
|
||||
<productname>GTK+</productname>
|
||||
<productname>gtk+</productname>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
@@ -48,9 +48,8 @@ the application to launch. The name should match application desktop file name,
|
||||
as residing in /usr/share/application, with or without the '.desktop' suffix.
|
||||
</para>
|
||||
<para>
|
||||
If called with more than one argument, the rest of them besides the application
|
||||
name are considered URI locations and are passed as arguments to the launched
|
||||
application.
|
||||
If called with more than one argument, the rest of them besides the application name
|
||||
are considered URI locations and are passed as arguments to the launched application.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
@@ -64,4 +63,10 @@ application.
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1><title>Bugs</title>
|
||||
<para>
|
||||
None known yet.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
@@ -4,18 +4,6 @@
|
||||
]>
|
||||
<refentry id="gtk-query-immodules-3.0">
|
||||
|
||||
<refentryinfo>
|
||||
<title>gtk-query-immodules-3.0</title>
|
||||
<productname>GTK+</productname>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Matthias</firstname>
|
||||
<surname>Clasen</surname>
|
||||
</author>
|
||||
</authorgroup>
|
||||
</refentryinfo>
|
||||
|
||||
<refmeta>
|
||||
<refentrytitle>gtk-query-immodules-3.0</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
@@ -31,7 +19,7 @@
|
||||
<cmdsynopsis>
|
||||
<command>gtk-query-immodules-3.0</command>
|
||||
<arg choice="opt">--update-cache</arg>
|
||||
<arg choice="opt" rep="repeat">MODULE</arg>
|
||||
<arg choice="opt" rep="repeat">module</arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
@@ -49,13 +37,11 @@ module path.
|
||||
If called with arguments, it looks for the specified modules. The arguments
|
||||
may be absolute or relative paths.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Normally, the output of <command>gtk-query-immodules-3.0</command> is written
|
||||
to <filename><replaceable>libdir</replaceable>/gtk-3.0/3.0.0/immodules.cache</filename>,
|
||||
where GTK+ looks for it by default. If it is written to some other location,
|
||||
the <envar>GTK_IM_MODULE_FILE</envar> environment variable can be set to point
|
||||
GTK+ at the file.
|
||||
to <filename><replaceable>libdir</replaceable>/gtk-3.0/3.0.0/immodules.cache</filename>, where GTK+ looks for it by default. If it is written to some other
|
||||
location, the environment variable <link linkend="gtk-im-module-file"><envar>GTK_IM_MODULE_FILE</envar></link>
|
||||
can be set to point GTK+ at the file.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
@@ -69,28 +55,19 @@ GTK+ at the file.
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1><title>Files</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><filename><replaceable>libdir</replaceable>/gtk-3.0/3.0.0/immodules.cache</filename></term>
|
||||
<listitem><para>The default im cache file used by GTK+ applications</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
<refsect1><title>Environment</title>
|
||||
<para>
|
||||
The environment variable <link linkend="gtk-path"><envar>GTK_PATH</envar></link>
|
||||
can be used to prepend directories to the input method module path.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1><title>Environment</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><link linkend="gtk-path"><envar>GTK_PATH</envar></link></term>
|
||||
<listitem><para>Prepends directories to the input method module path</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><link linkend="gtk-im-module-file"><envar>GTK_IM_MODULE_FILE</envar></link></term>
|
||||
<listitem><para>Specifies an alternative im module cache for GTK+
|
||||
applications</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
<refsect1><title>Bugs</title>
|
||||
<para>
|
||||
None known yet.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
|
||||
|
@@ -4,18 +4,6 @@
|
||||
]>
|
||||
<refentry id="gtk-update-icon-cache">
|
||||
|
||||
<refentryinfo>
|
||||
<title>gtk-update-icon-cache</title>
|
||||
<productname>GTK+</productname>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Matthias</firstname>
|
||||
<surname>Clasen</surname>
|
||||
</author>
|
||||
</authorgroup>
|
||||
</refentryinfo>
|
||||
|
||||
<refmeta>
|
||||
<refentrytitle>gtk-update-icon-cache</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
@@ -111,4 +99,10 @@
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1><title>Bugs</title>
|
||||
<para>
|
||||
None known yet.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
@@ -139,7 +139,6 @@ gtk_accel_label_set_accel_closure
|
||||
gtk_accel_label_get_accel_widget
|
||||
gtk_accel_label_set_accel_widget
|
||||
gtk_accel_label_get_accel_width
|
||||
gtk_accel_label_set_accel
|
||||
gtk_accel_label_refetch
|
||||
<SUBSECTION Standard>
|
||||
GTK_ACCEL_LABEL
|
||||
@@ -264,8 +263,6 @@ gtk_action_group_get_sensitive
|
||||
gtk_action_group_set_sensitive
|
||||
gtk_action_group_get_visible
|
||||
gtk_action_group_set_visible
|
||||
gtk_action_group_get_accel_group
|
||||
gtk_action_group_set_accel_group
|
||||
gtk_action_group_get_action
|
||||
gtk_action_group_list_actions
|
||||
gtk_action_group_add_action
|
||||
@@ -533,7 +530,6 @@ gtk_builder_add_from_resource
|
||||
gtk_builder_add_from_string
|
||||
gtk_builder_add_objects_from_file
|
||||
gtk_builder_add_objects_from_string
|
||||
gtk_builder_add_objects_from_resource
|
||||
gtk_builder_get_object
|
||||
gtk_builder_get_objects
|
||||
gtk_builder_connect_signals
|
||||
@@ -587,8 +583,6 @@ gtk_button_set_image
|
||||
gtk_button_get_image
|
||||
gtk_button_set_image_position
|
||||
gtk_button_get_image_position
|
||||
gtk_button_set_always_show_image
|
||||
gtk_button_get_always_show_image
|
||||
gtk_button_get_event_window
|
||||
|
||||
<SUBSECTION Standard>
|
||||
@@ -1052,8 +1046,6 @@ gtk_entry_get_layout
|
||||
gtk_entry_get_layout_offsets
|
||||
gtk_entry_layout_index_to_text_index
|
||||
gtk_entry_text_index_to_layout_index
|
||||
gtk_entry_set_attributes
|
||||
gtk_entry_get_attributes
|
||||
gtk_entry_get_max_length
|
||||
gtk_entry_get_visibility
|
||||
gtk_entry_set_completion
|
||||
@@ -1089,12 +1081,6 @@ gtk_entry_get_icon_tooltip_markup
|
||||
gtk_entry_set_icon_drag_source
|
||||
gtk_entry_get_current_icon_drag_source
|
||||
gtk_entry_get_icon_area
|
||||
GtkInputPurpose
|
||||
gtk_entry_set_input_purpose
|
||||
gtk_entry_get_input_purpose
|
||||
GtkInputHints
|
||||
gtk_entry_set_input_hints
|
||||
gtk_entry_get_input_hints
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_ENTRY
|
||||
@@ -1816,7 +1802,6 @@ gtk_image_new_from_stock
|
||||
gtk_image_new_from_animation
|
||||
gtk_image_new_from_icon_name
|
||||
gtk_image_new_from_gicon
|
||||
gtk_image_new_from_resource
|
||||
gtk_image_set_from_file
|
||||
gtk_image_set_from_icon_set
|
||||
gtk_image_set_from_pixbuf
|
||||
@@ -1824,7 +1809,6 @@ gtk_image_set_from_stock
|
||||
gtk_image_set_from_animation
|
||||
gtk_image_set_from_icon_name
|
||||
gtk_image_set_from_gicon
|
||||
gtk_image_set_from_resource
|
||||
gtk_image_clear
|
||||
gtk_image_new
|
||||
gtk_image_set_pixel_size
|
||||
@@ -2146,8 +2130,8 @@ gtk_menu_bar_get_type
|
||||
<TITLE>GtkMenuButton</TITLE>
|
||||
GtkMenuButton
|
||||
gtk_menu_button_new
|
||||
gtk_menu_button_set_popup
|
||||
gtk_menu_button_get_popup
|
||||
gtk_menu_button_set_menu
|
||||
gtk_menu_button_get_menu
|
||||
gtk_menu_button_set_menu_model
|
||||
gtk_menu_button_get_menu_model
|
||||
gtk_menu_button_set_direction
|
||||
@@ -2254,7 +2238,6 @@ gtk_menu_shell_set_take_focus
|
||||
gtk_menu_shell_get_take_focus
|
||||
gtk_menu_shell_get_selected_item
|
||||
gtk_menu_shell_get_parent_shell
|
||||
gtk_menu_shell_bind_model
|
||||
GtkMenuDirectionType
|
||||
<SUBSECTION Standard>
|
||||
GTK_MENU_SHELL
|
||||
@@ -3281,8 +3264,6 @@ gtk_level_bar_set_min_value
|
||||
gtk_level_bar_get_min_value
|
||||
gtk_level_bar_set_max_value
|
||||
gtk_level_bar_get_max_value
|
||||
gtk_level_bar_set_inverted
|
||||
gtk_level_bar_get_inverted
|
||||
gtk_level_bar_add_offset_value
|
||||
gtk_level_bar_remove_offset_value
|
||||
gtk_level_bar_get_offset_value
|
||||
@@ -3691,10 +3672,6 @@ gtk_text_view_get_accepts_tab
|
||||
gtk_text_view_get_default_attributes
|
||||
gtk_text_view_im_context_filter_keypress
|
||||
gtk_text_view_reset_im_context
|
||||
gtk_text_view_set_input_purpose
|
||||
gtk_text_view_get_input_purpose
|
||||
gtk_text_view_set_input_hints
|
||||
gtk_text_view_get_input_hints
|
||||
GTK_TEXT_VIEW_PRIORITY_VALIDATE
|
||||
<SUBSECTION Standard>
|
||||
GTK_TEXT_VIEW
|
||||
@@ -5291,7 +5268,6 @@ gtk_widget_get_sensitive
|
||||
gtk_widget_is_sensitive
|
||||
gtk_widget_get_state
|
||||
gtk_widget_get_visible
|
||||
gtk_widget_is_visible
|
||||
gtk_widget_set_visible
|
||||
gtk_widget_set_state_flags
|
||||
gtk_widget_unset_state_flags
|
||||
@@ -5315,7 +5291,6 @@ gtk_widget_get_mapped
|
||||
gtk_widget_get_requisition
|
||||
gtk_widget_device_is_shadowed
|
||||
gtk_widget_get_modifier_mask
|
||||
gtk_widget_insert_action_group
|
||||
|
||||
<SUBSECTION>
|
||||
gtk_widget_get_path
|
||||
@@ -5779,8 +5754,6 @@ GTK_STYLE_CLASS_LINKED
|
||||
GTK_STYLE_CLASS_ARROW
|
||||
GTK_STYLE_CLASS_OSD
|
||||
GTK_STYLE_CLASS_LEVEL_BAR
|
||||
GTK_STYLE_CLASS_CURSOR_HANDLE
|
||||
GTK_STYLE_CLASS_INSERTION_CURSOR
|
||||
GTK_STYLE_REGION_COLUMN
|
||||
GTK_STYLE_REGION_COLUMN_HEADER
|
||||
GTK_STYLE_REGION_ROW
|
||||
@@ -5990,7 +5963,6 @@ gtk_gradient_add_color_stop
|
||||
gtk_gradient_ref
|
||||
gtk_gradient_unref
|
||||
gtk_gradient_resolve
|
||||
gtk_gradient_resolve_for_context
|
||||
gtk_gradient_to_string
|
||||
|
||||
<SUBSECTION Standard>
|
||||
@@ -7123,7 +7095,6 @@ gtk_application_add_window
|
||||
gtk_application_remove_window
|
||||
gtk_application_get_windows
|
||||
gtk_application_get_window_by_id
|
||||
gtk_application_get_active_window
|
||||
|
||||
<SUBSECTION>
|
||||
GtkApplicationInhibitFlags
|
||||
|
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.1 KiB |
@@ -48,9 +48,6 @@
|
||||
<link linkend="GtkLabel">
|
||||
<inlinegraphic fileref="label.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
<link linkend="GtkLevelBar">
|
||||
<inlinegraphic fileref="levelbar.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
<link linkend="GtkLinkButton">
|
||||
<inlinegraphic fileref="link-button.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
|
@@ -228,25 +228,20 @@ static WidgetInfo *
|
||||
create_menu_button (void)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
GtkWidget *align;
|
||||
GtkWidget *image;
|
||||
GtkWidget *menu;
|
||||
GtkWidget *vbox;
|
||||
|
||||
widget = gtk_menu_button_new ();
|
||||
image = gtk_image_new ();
|
||||
gtk_image_set_from_icon_name (GTK_IMAGE (image), "emblem-system-symbolic", GTK_ICON_SIZE_MENU);
|
||||
gtk_button_set_image (GTK_BUTTON (widget), image);
|
||||
menu = gtk_menu_new ();
|
||||
gtk_menu_button_set_popup (GTK_MENU_BUTTON (widget), menu);
|
||||
gtk_menu_button_set_menu (GTK_MENU_BUTTON (widget), menu);
|
||||
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
||||
gtk_container_add (GTK_CONTAINER (align), widget);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 0);
|
||||
gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);
|
||||
gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new ("Menu Button"), TRUE, TRUE, 0);
|
||||
|
||||
return new_widget_info ("menu-button", vbox, SMALL);
|
||||
return new_widget_info ("menu-button", align, SMALL);
|
||||
}
|
||||
|
||||
#define G_TYPE_TEST_PERMISSION (g_test_permission_get_type ())
|
||||
@@ -287,20 +282,14 @@ g_test_permission_class_init (GTestPermissionClass *class)
|
||||
static WidgetInfo *
|
||||
create_lockbutton (void)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *widget;
|
||||
GtkWidget *align;
|
||||
|
||||
widget = gtk_lock_button_new (g_object_new (G_TYPE_TEST_PERMISSION, NULL));
|
||||
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
||||
gtk_container_add (GTK_CONTAINER (align), widget);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (vbox),
|
||||
gtk_label_new ("Lock Button"),
|
||||
FALSE, FALSE, 0);
|
||||
gtk_widget_set_halign (vbox, GTK_ALIGN_CENTER);
|
||||
gtk_widget_set_valign (vbox, GTK_ALIGN_CENTER);
|
||||
|
||||
return new_widget_info ("lock-button", vbox, SMALL);
|
||||
return new_widget_info ("lock-button", align, SMALL);
|
||||
}
|
||||
|
||||
static WidgetInfo *
|
||||
@@ -998,24 +987,6 @@ create_progressbar (void)
|
||||
return new_widget_info ("progressbar", vbox, SMALL);
|
||||
}
|
||||
|
||||
static WidgetInfo *
|
||||
create_level_bar (void)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *widget;
|
||||
|
||||
widget = gtk_level_bar_new ();
|
||||
gtk_level_bar_set_value (GTK_LEVEL_BAR (widget), 0.333);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), widget, TRUE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (vbox),
|
||||
gtk_label_new ("Level Bar"),
|
||||
FALSE, FALSE, 0);
|
||||
|
||||
return new_widget_info ("levelbar", vbox, SMALL);
|
||||
}
|
||||
|
||||
static WidgetInfo *
|
||||
create_scrolledwindow (void)
|
||||
{
|
||||
@@ -1298,7 +1269,6 @@ get_all_widgets (void)
|
||||
retval = g_list_prepend (retval, create_colorchooserdialog ());
|
||||
retval = g_list_prepend (retval, create_menu_button ());
|
||||
retval = g_list_prepend (retval, create_search_entry ());
|
||||
retval = g_list_prepend (retval, create_level_bar ());
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
@@ -55,7 +55,6 @@ noinst_PROGRAMS = \
|
||||
bloatpad \
|
||||
plugman \
|
||||
sunny \
|
||||
action-namespace \
|
||||
grid-packing \
|
||||
drawing \
|
||||
builder
|
||||
|
@@ -1,134 +0,0 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static void
|
||||
action_activated (GSimpleAction *action,
|
||||
GVariant *parameter,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkWindow *parent = user_data;
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = gtk_message_dialog_new (parent,
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_INFO,
|
||||
GTK_BUTTONS_CLOSE,
|
||||
"Activated action `%s`",
|
||||
g_action_get_name (G_ACTION (action)));
|
||||
|
||||
g_signal_connect_swapped (dialog, "response",
|
||||
G_CALLBACK (gtk_widget_destroy), dialog);
|
||||
|
||||
gtk_widget_show_all (dialog);
|
||||
}
|
||||
|
||||
static GActionEntry doc_entries[] = {
|
||||
{ "save", action_activated },
|
||||
{ "print", action_activated },
|
||||
{ "share", action_activated }
|
||||
};
|
||||
|
||||
static GActionEntry win_entries[] = {
|
||||
{ "fullscreen", action_activated },
|
||||
{ "close", action_activated },
|
||||
};
|
||||
|
||||
const gchar *menu_ui =
|
||||
"<interface>"
|
||||
" <menu id='doc-menu'>"
|
||||
" <section>"
|
||||
" <item>"
|
||||
" <attribute name='label'>_Save</attribute>"
|
||||
" <attribute name='action'>save</attribute>"
|
||||
" </item>"
|
||||
" <item>"
|
||||
" <attribute name='label'>_Print</attribute>"
|
||||
" <attribute name='action'>print</attribute>"
|
||||
" </item>"
|
||||
" <item>"
|
||||
" <attribute name='label'>_Share</attribute>"
|
||||
" <attribute name='action'>share</attribute>"
|
||||
" </item>"
|
||||
" </section>"
|
||||
" </menu>"
|
||||
" <menu id='win-menu'>"
|
||||
" <section>"
|
||||
" <item>"
|
||||
" <attribute name='label'>_Fullscreen</attribute>"
|
||||
" <attribute name='action'>fullscreen</attribute>"
|
||||
" </item>"
|
||||
" <item>"
|
||||
" <attribute name='label'>_Close</attribute>"
|
||||
" <attribute name='action'>close</attribute>"
|
||||
" </item>"
|
||||
" </section>"
|
||||
" </menu>"
|
||||
"</interface>";
|
||||
|
||||
static void
|
||||
activate (GApplication *app,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkWidget *win;
|
||||
GtkWidget *button;
|
||||
GSimpleActionGroup *doc_actions;
|
||||
GtkBuilder *builder;
|
||||
GMenuModel *doc_menu;
|
||||
GMenuModel *win_menu;
|
||||
GMenu *button_menu;
|
||||
GMenuItem *section;
|
||||
|
||||
if (gtk_application_get_windows (GTK_APPLICATION (app)) != NULL)
|
||||
return;
|
||||
|
||||
win = gtk_application_window_new (GTK_APPLICATION (app));
|
||||
|
||||
doc_actions = g_simple_action_group_new ();
|
||||
g_simple_action_group_add_entries (doc_actions, doc_entries,
|
||||
G_N_ELEMENTS (doc_entries), win);
|
||||
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (win), win_entries,
|
||||
G_N_ELEMENTS (win_entries), win);
|
||||
|
||||
builder = gtk_builder_new ();
|
||||
gtk_builder_add_from_string (builder, menu_ui, -1, NULL);
|
||||
|
||||
doc_menu = G_MENU_MODEL (gtk_builder_get_object (builder, "doc-menu"));
|
||||
win_menu = G_MENU_MODEL (gtk_builder_get_object (builder, "win-menu"));
|
||||
|
||||
button_menu = g_menu_new ();
|
||||
|
||||
section = g_menu_item_new_section (NULL, doc_menu);
|
||||
g_menu_item_set_attribute (section, "action-namespace", "s", "doc");
|
||||
g_menu_append_item (button_menu, section);
|
||||
g_object_unref (section);
|
||||
|
||||
section = g_menu_item_new_section (NULL, win_menu);
|
||||
g_menu_item_set_attribute (section, "action-namespace", "s", "win");
|
||||
g_menu_append_item (button_menu, section);
|
||||
g_object_unref (section);
|
||||
|
||||
button = gtk_menu_button_new ();
|
||||
gtk_button_set_label (GTK_BUTTON (button), "Menu");
|
||||
gtk_widget_insert_action_group (button, "doc", G_ACTION_GROUP (doc_actions));
|
||||
gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (button), G_MENU_MODEL (button_menu));
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (win), button);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (win), 12);
|
||||
gtk_widget_show_all (win);
|
||||
|
||||
g_object_unref (button_menu);
|
||||
g_object_unref (doc_actions);
|
||||
g_object_unref (builder);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc,
|
||||
char **argv)
|
||||
{
|
||||
GtkApplication *app;
|
||||
|
||||
app = gtk_application_new ("org.gtk.Example", 0);
|
||||
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
|
||||
|
||||
return g_application_run (G_APPLICATION (app), argc, argv);
|
||||
}
|
@@ -191,14 +191,7 @@ bloat_pad_open (GApplication *application,
|
||||
new_window (application, files[i]);
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GtkApplication parent_instance;
|
||||
|
||||
GMenu *time;
|
||||
guint timeout;
|
||||
} BloatPad;
|
||||
|
||||
typedef GtkApplication BloatPad;
|
||||
typedef GtkApplicationClass BloatPadClass;
|
||||
|
||||
G_DEFINE_TYPE (BloatPad, bloat_pad, GTK_TYPE_APPLICATION)
|
||||
@@ -241,65 +234,15 @@ quit_activated (GSimpleAction *action,
|
||||
g_application_quit (app);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
update_time (gpointer user_data)
|
||||
{
|
||||
BloatPad *bloatpad = user_data;
|
||||
GDateTime *now;
|
||||
gchar *time;
|
||||
|
||||
while (g_menu_model_get_n_items (G_MENU_MODEL (bloatpad->time)))
|
||||
g_menu_remove (bloatpad->time, 0);
|
||||
|
||||
g_message ("Updating the time menu (which should be open now)...");
|
||||
|
||||
now = g_date_time_new_now_local ();
|
||||
time = g_date_time_format (now, "%c");
|
||||
g_menu_append (bloatpad->time, time, NULL);
|
||||
g_date_time_unref (now);
|
||||
g_free (time);
|
||||
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
static void
|
||||
time_active_changed (GSimpleAction *action,
|
||||
GVariant *state,
|
||||
gpointer user_data)
|
||||
{
|
||||
BloatPad *bloatpad = user_data;
|
||||
|
||||
if (g_variant_get_boolean (state))
|
||||
{
|
||||
if (!bloatpad->timeout)
|
||||
{
|
||||
bloatpad->timeout = g_timeout_add (1000, update_time, bloatpad);
|
||||
update_time (bloatpad);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bloatpad->timeout)
|
||||
{
|
||||
g_source_remove (bloatpad->timeout);
|
||||
bloatpad->timeout = 0;
|
||||
}
|
||||
}
|
||||
|
||||
g_simple_action_set_state (action, state);
|
||||
}
|
||||
|
||||
static GActionEntry app_entries[] = {
|
||||
{ "new", new_activated, NULL, NULL, NULL },
|
||||
{ "about", about_activated, NULL, NULL, NULL },
|
||||
{ "quit", quit_activated, NULL, NULL, NULL },
|
||||
{ "time-active", NULL, NULL, "false", time_active_changed }
|
||||
};
|
||||
|
||||
static void
|
||||
bloat_pad_startup (GApplication *application)
|
||||
{
|
||||
BloatPad *bloatpad = (BloatPad*) application;
|
||||
GtkBuilder *builder;
|
||||
|
||||
G_APPLICATION_CLASS (bloat_pad_parent_class)
|
||||
@@ -358,34 +301,13 @@ bloat_pad_startup (GApplication *application)
|
||||
" </item>"
|
||||
" </section>"
|
||||
" </submenu>"
|
||||
" <submenu id='time-menu'>"
|
||||
" <attribute name='label' translatable='yes'>Time</attribute>"
|
||||
" <attribute name='submenu-action'>app.time-active</attribute>"
|
||||
" </submenu>"
|
||||
" </menu>"
|
||||
"</interface>", -1, NULL);
|
||||
gtk_application_set_app_menu (GTK_APPLICATION (application), G_MENU_MODEL (gtk_builder_get_object (builder, "app-menu")));
|
||||
gtk_application_set_menubar (GTK_APPLICATION (application), G_MENU_MODEL (gtk_builder_get_object (builder, "menubar")));
|
||||
//gtk_application_set_menubar (GTK_APPLICATION (application), G_MENU_MODEL (gtk_builder_get_object (builder, "app-menu")));
|
||||
bloatpad->time = G_MENU (gtk_builder_get_object (builder, "time-menu"));
|
||||
g_object_unref (builder);
|
||||
}
|
||||
|
||||
static void
|
||||
bloat_pad_shutdown (GApplication *application)
|
||||
{
|
||||
BloatPad *bloatpad = (BloatPad *) application;
|
||||
|
||||
if (bloatpad->timeout)
|
||||
{
|
||||
g_source_remove (bloatpad->timeout);
|
||||
bloatpad->timeout = 0;
|
||||
}
|
||||
|
||||
G_APPLICATION_CLASS (bloat_pad_parent_class)
|
||||
->shutdown (application);
|
||||
}
|
||||
|
||||
static void
|
||||
bloat_pad_init (BloatPad *app)
|
||||
{
|
||||
@@ -398,7 +320,6 @@ bloat_pad_class_init (BloatPadClass *class)
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
|
||||
application_class->startup = bloat_pad_startup;
|
||||
application_class->shutdown = bloat_pad_shutdown;
|
||||
application_class->activate = bloat_pad_activate;
|
||||
application_class->open = bloat_pad_open;
|
||||
|
||||
@@ -409,7 +330,9 @@ bloat_pad_class_init (BloatPadClass *class)
|
||||
BloatPad *
|
||||
bloat_pad_new (void)
|
||||
{
|
||||
BloatPad *bloat_pad;
|
||||
GtkApplication *bloat_pad;
|
||||
|
||||
g_type_init ();
|
||||
|
||||
g_set_application_name ("Bloatpad");
|
||||
|
||||
|
@@ -465,6 +465,8 @@ plug_man_class_init (PlugManClass *class)
|
||||
PlugMan *
|
||||
plug_man_new (void)
|
||||
{
|
||||
g_type_init ();
|
||||
|
||||
return g_object_new (plug_man_get_type (),
|
||||
"application-id", "org.gtk.Test.plugman",
|
||||
"flags", G_APPLICATION_HANDLES_OPEN,
|
||||
|
@@ -191,6 +191,8 @@ menu_button_class_init (MenuButtonClass *class)
|
||||
MenuButton *
|
||||
menu_button_new (void)
|
||||
{
|
||||
g_type_init ();
|
||||
|
||||
return g_object_new (menu_button_get_type (),
|
||||
"application-id", "org.gtk.Test.Sunny",
|
||||
"flags", G_APPLICATION_HANDLES_OPEN,
|
||||
|
@@ -341,8 +341,7 @@ gdkmarshalers.h: @REBUILD@ gdkmarshalers.list
|
||||
&& mv gdkmarshalers-h.tmp gdkmarshalers.h \
|
||||
|| ( rm -f gdkmarshalers-h.tmp && exit 1)
|
||||
gdkmarshalers.c: @REBUILD@ gdkmarshalers.list
|
||||
$(AM_V_GEN) (echo "#include \"gdkmarshalers.h\""; \
|
||||
$(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --body) > gdkmarshalers-c.tmp \
|
||||
$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --body > gdkmarshalers-c.tmp \
|
||||
&& mv gdkmarshalers-c.tmp gdkmarshalers.c \
|
||||
|| ( rm -f gdkmarshalers-c.tmp && exit 1 )
|
||||
|
||||
|
@@ -31,12 +31,12 @@ libbroadway_la_SOURCES = \
|
||||
broadway.c
|
||||
|
||||
clienthtml.h: client.html
|
||||
$(PERL) $(srcdir)/toarray.pl $(srcdir)/client.html client_html > $@
|
||||
$(PERL) ./toarray.pl client.html client_html > $@
|
||||
|
||||
EXTRA_DIST += client.html
|
||||
|
||||
broadwayjs.h: broadway.js
|
||||
$(PERL) $(srcdir)/toarray.pl $(srcdir)/broadway.js broadway_js > $@
|
||||
$(PERL) ./toarray.pl broadway.js broadway_js > $@
|
||||
|
||||
EXTRA_DIST += broadway.js
|
||||
|
||||
|
@@ -57,44 +57,8 @@ base64_uint32 (guint32 v, char *c)
|
||||
* conversion of raw image data to png data: uris *
|
||||
***********************************************************/
|
||||
|
||||
static cairo_status_t
|
||||
write_png_data (void *closure,
|
||||
const unsigned char *data,
|
||||
unsigned int data_len)
|
||||
{
|
||||
GString *buf = closure;
|
||||
|
||||
g_string_append_len (buf, (char *)data, data_len);
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
to_png_rgb (GString *buf, int w, int h, int byte_stride, guint32 *data)
|
||||
{
|
||||
cairo_surface_t *surface;
|
||||
|
||||
surface = cairo_image_surface_create_for_data ((guchar *)data,
|
||||
CAIRO_FORMAT_RGB24, w, h, byte_stride);
|
||||
|
||||
cairo_surface_write_to_png_stream (surface, write_png_data, buf);
|
||||
cairo_surface_destroy (surface);
|
||||
}
|
||||
|
||||
static void
|
||||
to_png_rgba (GString *buf, int w, int h, int byte_stride, guint32 *data)
|
||||
{
|
||||
cairo_surface_t *surface;
|
||||
|
||||
surface = cairo_image_surface_create_for_data ((guchar *)data,
|
||||
CAIRO_FORMAT_ARGB32, w, h, byte_stride);
|
||||
|
||||
cairo_surface_write_to_png_stream (surface, write_png_data, buf);
|
||||
cairo_surface_destroy (surface);
|
||||
}
|
||||
|
||||
struct PngTarget {
|
||||
GString *buf;
|
||||
GString *url;
|
||||
int state;
|
||||
int save;
|
||||
};
|
||||
@@ -107,73 +71,71 @@ write_png_url (void *closure,
|
||||
struct PngTarget *target = closure;
|
||||
gsize res, old_len;
|
||||
|
||||
old_len = target->buf->len;
|
||||
g_string_set_size (target->buf,
|
||||
old_len = target->url->len;
|
||||
g_string_set_size (target->url,
|
||||
old_len + (data_len / 3 + 1) * 4 + 4);
|
||||
|
||||
res = g_base64_encode_step (data, data_len, FALSE,
|
||||
target->buf->str + old_len,
|
||||
target->url->str + old_len,
|
||||
&target->state, &target->save);
|
||||
|
||||
g_string_set_size (target->buf, old_len + res);
|
||||
g_string_set_size (target->url, old_len + res);
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
to_png_url_rgb (GString *buf, int w, int h, int byte_stride, guint32 *data)
|
||||
static char *
|
||||
to_png_rgb (int w, int h, int byte_stride, guint32 *data)
|
||||
{
|
||||
cairo_surface_t *surface;
|
||||
struct PngTarget target;
|
||||
gsize res, old_len;
|
||||
|
||||
target.buf = buf;
|
||||
target.url = g_string_new ("data:image/png;base64,");
|
||||
target.state = 0;
|
||||
target.save = 0;
|
||||
|
||||
g_string_append (buf, "data:image/png;base64,");
|
||||
|
||||
surface = cairo_image_surface_create_for_data ((guchar *)data,
|
||||
CAIRO_FORMAT_RGB24, w, h, byte_stride);
|
||||
|
||||
cairo_surface_write_to_png_stream (surface, write_png_url, &target);
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
old_len = buf->len;
|
||||
old_len = target.url->len;
|
||||
|
||||
g_string_set_size (buf, old_len + 4);
|
||||
g_string_set_size (target.url, old_len + 4);
|
||||
res = g_base64_encode_close (FALSE,
|
||||
buf->str + old_len,
|
||||
target.url->str + old_len,
|
||||
&target.state, &target.save);
|
||||
g_string_set_size (buf, old_len + res);
|
||||
g_string_set_size (target.url, old_len + res);
|
||||
|
||||
return g_string_free (target.url, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
to_png_url_rgba (GString *buf, int w, int h, int byte_stride, guint32 *data)
|
||||
static char *
|
||||
to_png_rgba (int w, int h, int byte_stride, guint32 *data)
|
||||
{
|
||||
cairo_surface_t *surface;
|
||||
struct PngTarget target;
|
||||
gsize res, old_len;
|
||||
|
||||
target.buf = buf;
|
||||
target.url = g_string_new ("data:image/png;base64,");
|
||||
target.state = 0;
|
||||
target.save = 0;
|
||||
|
||||
g_string_append (buf, "data:image/png;base64,");
|
||||
|
||||
surface = cairo_image_surface_create_for_data ((guchar *)data,
|
||||
CAIRO_FORMAT_ARGB32, w, h, byte_stride);
|
||||
|
||||
cairo_surface_write_to_png_stream (surface, write_png_url, &target);
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
old_len = buf->len;
|
||||
old_len = target.url->len;
|
||||
|
||||
g_string_set_size (buf, old_len + 4);
|
||||
g_string_set_size (target.url, old_len + 4);
|
||||
res = g_base64_encode_close (FALSE,
|
||||
buf->str + old_len,
|
||||
target.url->str + old_len,
|
||||
&target.state, &target.save);
|
||||
g_string_set_size (buf, old_len + res);
|
||||
g_string_set_size (target.url, old_len + res);
|
||||
|
||||
return g_string_free (target.url, FALSE);
|
||||
}
|
||||
|
||||
#if 0
|
||||
@@ -211,11 +173,9 @@ to_png_a (int w, int h, int byte_stride, guint8 *data)
|
||||
|
||||
struct BroadwayOutput {
|
||||
GOutputStream *out;
|
||||
GString *buf;
|
||||
int error;
|
||||
guint32 serial;
|
||||
gboolean proto_v7_plus;
|
||||
gboolean binary;
|
||||
};
|
||||
|
||||
static void
|
||||
@@ -252,12 +212,13 @@ broadway_output_send_cmd (BroadwayOutput *output,
|
||||
}
|
||||
|
||||
static void
|
||||
broadway_output_send_cmd_pre_v7 (BroadwayOutput *output,
|
||||
const void *buf, gsize count)
|
||||
broadway_output_sendmsg (BroadwayOutput *output,
|
||||
const void *buf, gsize count)
|
||||
{
|
||||
g_output_stream_write_all (output->out, "\0", 1, NULL, NULL, NULL);
|
||||
g_output_stream_write_all (output->out, buf, count, NULL, NULL, NULL);
|
||||
g_output_stream_write_all (output->out, "\xff", 1, NULL, NULL, NULL);
|
||||
if (!output->proto_v7_plus)
|
||||
g_output_stream_write_all (output->out, buf, count, NULL, NULL, NULL);
|
||||
else
|
||||
broadway_output_send_cmd (output, TRUE, BROADWAY_WS_TEXT, buf, count);
|
||||
}
|
||||
|
||||
void broadway_output_pong (BroadwayOutput *output)
|
||||
@@ -266,40 +227,42 @@ void broadway_output_pong (BroadwayOutput *output)
|
||||
broadway_output_send_cmd (output, TRUE, BROADWAY_WS_CNX_PONG, NULL, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
broadway_output_sendmsg_initiate (BroadwayOutput *output)
|
||||
{
|
||||
if (!output->proto_v7_plus)
|
||||
g_output_stream_write (output->out, "\0", 1, NULL, NULL);
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
broadway_output_flush (BroadwayOutput *output)
|
||||
{
|
||||
if (output->buf->len == 0)
|
||||
return TRUE;
|
||||
|
||||
if (!output->proto_v7_plus)
|
||||
broadway_output_send_cmd_pre_v7 (output, output->buf->str, output->buf->len);
|
||||
else if (output->binary)
|
||||
broadway_output_send_cmd (output, TRUE, BROADWAY_WS_BINARY,
|
||||
output->buf->str, output->buf->len);
|
||||
else
|
||||
broadway_output_send_cmd (output, TRUE, BROADWAY_WS_TEXT,
|
||||
output->buf->str, output->buf->len);
|
||||
|
||||
g_string_set_size (output->buf, 0);
|
||||
|
||||
return !output->error;
|
||||
|
||||
{
|
||||
broadway_output_sendmsg (output, "\xff", 1);
|
||||
broadway_output_sendmsg (output, "\0", 1);
|
||||
return !output->error;
|
||||
}
|
||||
else /* no need to flush */
|
||||
return !output->error;
|
||||
}
|
||||
|
||||
BroadwayOutput *
|
||||
broadway_output_new (GOutputStream *out, guint32 serial,
|
||||
gboolean proto_v7_plus, gboolean binary)
|
||||
broadway_output_new(GOutputStream *out, guint32 serial,
|
||||
gboolean proto_v7_plus)
|
||||
{
|
||||
BroadwayOutput *output;
|
||||
|
||||
output = g_new0 (BroadwayOutput, 1);
|
||||
|
||||
output->out = g_object_ref (out);
|
||||
output->buf = g_string_new ("");
|
||||
output->serial = serial;
|
||||
output->proto_v7_plus = proto_v7_plus;
|
||||
output->binary = binary;
|
||||
|
||||
broadway_output_sendmsg_initiate (output);
|
||||
|
||||
return output;
|
||||
}
|
||||
@@ -322,97 +285,32 @@ broadway_output_get_next_serial (BroadwayOutput *output)
|
||||
* Core rendering operations *
|
||||
************************************************************************/
|
||||
|
||||
#define HEADER_LEN (1+6)
|
||||
|
||||
static void
|
||||
append_char (BroadwayOutput *output, char c)
|
||||
append_uint16 (guint32 v, char *buf, int *p)
|
||||
{
|
||||
g_string_append_c (output->buf, c);
|
||||
base64_uint16 (v, &buf[*p]);
|
||||
*p += 3;
|
||||
}
|
||||
|
||||
static void
|
||||
append_bool (BroadwayOutput *output, gboolean val)
|
||||
append_uint32 (guint32 v, char *buf, int *p)
|
||||
{
|
||||
if (output->binary)
|
||||
g_string_append_c (output->buf, val ? 1: 0);
|
||||
else
|
||||
g_string_append_c (output->buf, val ? '1': '0');
|
||||
base64_uint32 (v, &buf[*p]);
|
||||
*p += 6;
|
||||
}
|
||||
|
||||
static void
|
||||
append_flags (BroadwayOutput *output, guint32 val)
|
||||
static int
|
||||
write_header(BroadwayOutput *output, char *buf, char op)
|
||||
{
|
||||
if (output->binary)
|
||||
g_string_append_c (output->buf, val);
|
||||
else
|
||||
g_string_append_c (output->buf, val + '0');
|
||||
}
|
||||
int p;
|
||||
|
||||
p = 0;
|
||||
buf[p++] = op;
|
||||
append_uint32 (output->serial++, buf, &p);
|
||||
|
||||
static void
|
||||
append_uint16 (BroadwayOutput *output, guint32 v)
|
||||
{
|
||||
gsize old_len = output->buf->len;
|
||||
|
||||
if (output->binary)
|
||||
{
|
||||
guint8 *buf = (guint8 *)output->buf->str + old_len;
|
||||
|
||||
g_string_set_size (output->buf, old_len + 2);
|
||||
buf[0] = (v >> 0) & 0xff;
|
||||
buf[1] = (v >> 8) & 0xff;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_string_set_size (output->buf, old_len + 3);
|
||||
base64_uint16 (v, output->buf->str + old_len);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
append_uint32 (BroadwayOutput *output, guint32 v)
|
||||
{
|
||||
gsize old_len = output->buf->len;
|
||||
|
||||
if (output->binary)
|
||||
{
|
||||
guint8 *buf = (guint8 *)output->buf->str + old_len;
|
||||
|
||||
g_string_set_size (output->buf, old_len + 4);
|
||||
buf[0] = (v >> 0) & 0xff;
|
||||
buf[1] = (v >> 8) & 0xff;
|
||||
buf[2] = (v >> 16) & 0xff;
|
||||
buf[3] = (v >> 24) & 0xff;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_string_set_size (output->buf, old_len + 6);
|
||||
base64_uint32 (v, output->buf->str + old_len);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
overwrite_uint32 (BroadwayOutput *output, gsize pos, guint32 v)
|
||||
{
|
||||
if (output->binary)
|
||||
{
|
||||
guint8 *buf = (guint8 *)output->buf->str + pos;
|
||||
|
||||
buf[0] = (v >> 0) & 0xff;
|
||||
buf[1] = (v >> 8) & 0xff;
|
||||
buf[2] = (v >> 16) & 0xff;
|
||||
buf[3] = (v >> 24) & 0xff;
|
||||
}
|
||||
else
|
||||
{
|
||||
base64_uint32 (v, output->buf->str + pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
write_header(BroadwayOutput *output, char op)
|
||||
{
|
||||
append_char (output, op);
|
||||
append_uint32 (output, output->serial++);
|
||||
return p;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -420,20 +318,29 @@ broadway_output_copy_rectangles (BroadwayOutput *output, int id,
|
||||
BroadwayRect *rects, int n_rects,
|
||||
int dx, int dy)
|
||||
{
|
||||
int i;
|
||||
char *buf;
|
||||
int len, i, p;
|
||||
|
||||
write_header (output, 'b');
|
||||
append_uint16 (output, id);
|
||||
append_uint16 (output, n_rects);
|
||||
len = HEADER_LEN + 3 + 3 + 3*4*n_rects + 3 + 3;
|
||||
|
||||
buf = g_malloc (len);
|
||||
p = write_header (output, buf, 'b');
|
||||
append_uint16 (id, buf, &p);
|
||||
append_uint16 (n_rects, buf, &p);
|
||||
for (i = 0; i < n_rects; i++)
|
||||
{
|
||||
append_uint16 (output, rects[i].x);
|
||||
append_uint16 (output, rects[i].y);
|
||||
append_uint16 (output, rects[i].width);
|
||||
append_uint16 (output, rects[i].height);
|
||||
append_uint16 (rects[i].x, buf, &p);
|
||||
append_uint16 (rects[i].y, buf, &p);
|
||||
append_uint16 (rects[i].width, buf, &p);
|
||||
append_uint16 (rects[i].height, buf, &p);
|
||||
}
|
||||
append_uint16 (output, dx);
|
||||
append_uint16 (output, dy);
|
||||
append_uint16 (dx, buf, &p);
|
||||
append_uint16 (dy, buf, &p);
|
||||
|
||||
assert (p == len);
|
||||
|
||||
broadway_output_sendmsg (output, buf, len);
|
||||
free (buf);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -441,18 +348,31 @@ broadway_output_grab_pointer (BroadwayOutput *output,
|
||||
int id,
|
||||
gboolean owner_event)
|
||||
{
|
||||
write_header (output, 'g');
|
||||
append_uint16 (output, id);
|
||||
append_bool (output, owner_event);
|
||||
char buf[HEADER_LEN + 3 + 1];
|
||||
int p;
|
||||
|
||||
p = write_header (output, buf, 'g');
|
||||
append_uint16 (id, buf, &p);
|
||||
buf[p++] = owner_event ? '1': '0';
|
||||
|
||||
assert (p == sizeof (buf));
|
||||
|
||||
broadway_output_sendmsg (output, buf, sizeof (buf));
|
||||
}
|
||||
|
||||
guint32
|
||||
broadway_output_ungrab_pointer (BroadwayOutput *output)
|
||||
{
|
||||
char buf[HEADER_LEN];
|
||||
guint32 serial;
|
||||
int p;
|
||||
|
||||
serial = output->serial;
|
||||
write_header (output, 'u');
|
||||
p = write_header (output, buf, 'u');
|
||||
|
||||
assert (p == sizeof (buf));
|
||||
|
||||
broadway_output_sendmsg (output, buf, sizeof (buf));
|
||||
|
||||
return serial;
|
||||
}
|
||||
@@ -462,34 +382,62 @@ broadway_output_new_surface(BroadwayOutput *output,
|
||||
int id, int x, int y, int w, int h,
|
||||
gboolean is_temp)
|
||||
{
|
||||
write_header (output, 's');
|
||||
append_uint16 (output, id);
|
||||
append_uint16 (output, x);
|
||||
append_uint16 (output, y);
|
||||
append_uint16 (output, w);
|
||||
append_uint16 (output, h);
|
||||
append_bool (output, is_temp);
|
||||
char buf[HEADER_LEN + 16];
|
||||
int p;
|
||||
|
||||
p = write_header (output, buf, 's');
|
||||
append_uint16 (id, buf, &p);
|
||||
append_uint16 (x, buf, &p);
|
||||
append_uint16 (y, buf, &p);
|
||||
append_uint16 (w, buf, &p);
|
||||
append_uint16 (h, buf, &p);
|
||||
buf[p++] = is_temp ? '1' : '0';
|
||||
|
||||
assert (p == sizeof (buf));
|
||||
|
||||
broadway_output_sendmsg (output, buf, sizeof (buf));
|
||||
}
|
||||
|
||||
void
|
||||
broadway_output_show_surface(BroadwayOutput *output, int id)
|
||||
{
|
||||
write_header (output, 'S');
|
||||
append_uint16 (output, id);
|
||||
char buf[HEADER_LEN + 3];
|
||||
int p;
|
||||
|
||||
p = write_header (output, buf, 'S');
|
||||
append_uint16 (id, buf, &p);
|
||||
|
||||
assert (p == sizeof (buf));
|
||||
|
||||
broadway_output_sendmsg (output, buf, sizeof (buf));
|
||||
}
|
||||
|
||||
void
|
||||
broadway_output_hide_surface(BroadwayOutput *output, int id)
|
||||
{
|
||||
write_header (output, 'H');
|
||||
append_uint16 (output, id);
|
||||
char buf[HEADER_LEN + 3];
|
||||
int p;
|
||||
|
||||
p = write_header (output, buf, 'H');
|
||||
append_uint16 (id, buf, &p);
|
||||
|
||||
assert (p == sizeof (buf));
|
||||
|
||||
broadway_output_sendmsg (output, buf, sizeof (buf));
|
||||
}
|
||||
|
||||
void
|
||||
broadway_output_destroy_surface(BroadwayOutput *output, int id)
|
||||
{
|
||||
write_header (output, 'd');
|
||||
append_uint16 (output, id);
|
||||
char buf[HEADER_LEN + 3];
|
||||
int p;
|
||||
|
||||
p = write_header (output, buf, 'd');
|
||||
append_uint16 (id, buf, &p);
|
||||
|
||||
assert (p == sizeof (buf));
|
||||
|
||||
broadway_output_sendmsg (output, buf, sizeof (buf));
|
||||
}
|
||||
|
||||
|
||||
@@ -503,25 +451,31 @@ broadway_output_move_resize_surface (BroadwayOutput *output,
|
||||
int w,
|
||||
int h)
|
||||
{
|
||||
char buf[HEADER_LEN+3+1+6+6];
|
||||
int p;
|
||||
int val;
|
||||
|
||||
if (!has_pos && !has_size)
|
||||
return;
|
||||
|
||||
write_header (output, 'm');
|
||||
p = write_header (output, buf, 'm');
|
||||
|
||||
val = (!!has_pos) | ((!!has_size) << 1);
|
||||
append_uint16 (output, id);
|
||||
append_flags (output, val);
|
||||
append_uint16 (id, buf, &p);
|
||||
buf[p++] = val + '0';
|
||||
if (has_pos)
|
||||
{
|
||||
append_uint16 (output, x);
|
||||
append_uint16 (output, y);
|
||||
append_uint16 (x, buf, &p);
|
||||
append_uint16 (y, buf, &p);
|
||||
}
|
||||
if (has_size)
|
||||
{
|
||||
append_uint16 (output, w);
|
||||
append_uint16 (output, h);
|
||||
append_uint16 (w, buf, &p);
|
||||
append_uint16 (h, buf, &p);
|
||||
}
|
||||
assert (p <= sizeof (buf));
|
||||
|
||||
broadway_output_sendmsg (output, buf, p);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -529,9 +483,17 @@ broadway_output_set_transient_for (BroadwayOutput *output,
|
||||
int id,
|
||||
int parent_id)
|
||||
{
|
||||
write_header (output, 'p');
|
||||
append_uint16 (output, id);
|
||||
append_uint16 (output, parent_id);
|
||||
char buf[HEADER_LEN + 6];
|
||||
int p;
|
||||
|
||||
p = write_header (output, buf, 'p');
|
||||
|
||||
append_uint16 (id, buf, &p);
|
||||
append_uint16 (parent_id, buf, &p);
|
||||
|
||||
assert (p == sizeof (buf));
|
||||
|
||||
broadway_output_sendmsg (output, buf, sizeof (buf));
|
||||
}
|
||||
|
||||
|
||||
@@ -539,26 +501,32 @@ void
|
||||
broadway_output_put_rgb (BroadwayOutput *output, int id, int x, int y,
|
||||
int w, int h, int byte_stride, void *data)
|
||||
{
|
||||
gsize size_start, image_start, len;
|
||||
gsize buf_size;
|
||||
gsize url_len;
|
||||
char *url, *buf;
|
||||
int p;
|
||||
|
||||
write_header (output, 'i');
|
||||
url = to_png_rgb (w, h, byte_stride, (guint32*)data);
|
||||
url_len = strlen (url);
|
||||
|
||||
append_uint16 (output, id);
|
||||
append_uint16 (output, x);
|
||||
append_uint16 (output, y);
|
||||
buf_size = HEADER_LEN + 15 + url_len;
|
||||
buf = g_malloc (buf_size);
|
||||
|
||||
size_start = output->buf->len;
|
||||
append_uint32 (output, 0);
|
||||
p = write_header (output, buf, 'i');
|
||||
|
||||
image_start = output->buf->len;
|
||||
if (output->binary)
|
||||
to_png_rgb (output->buf, w, h, byte_stride, (guint32*)data);
|
||||
else
|
||||
to_png_url_rgb (output->buf, w, h, byte_stride, (guint32*)data);
|
||||
append_uint16 (id, buf, &p);
|
||||
append_uint16 (x, buf, &p);
|
||||
append_uint16 (y, buf, &p);
|
||||
|
||||
len = output->buf->len - image_start;
|
||||
append_uint32 (url_len, buf, &p);
|
||||
|
||||
overwrite_uint32 (output, size_start, len);
|
||||
g_assert (p == HEADER_LEN + 15);
|
||||
strncpy (buf + p, url, url_len);
|
||||
|
||||
broadway_output_sendmsg (output, buf, buf_size);
|
||||
|
||||
g_free (buf);
|
||||
free (url);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
@@ -789,38 +757,39 @@ broadway_output_put_rgba (BroadwayOutput *output, int id, int x, int y,
|
||||
int w, int h, int byte_stride, void *data)
|
||||
{
|
||||
BroadwayBox *rects;
|
||||
int i, n_rects;
|
||||
gsize size_start, image_start, len;
|
||||
int p, i, n_rects;
|
||||
|
||||
rects = rgba_find_rects (data, w, h, byte_stride, &n_rects);
|
||||
|
||||
for (i = 0; i < n_rects; i++)
|
||||
{
|
||||
gsize url_len, buf_size;
|
||||
char *buf, *url;
|
||||
guint8 *subdata;
|
||||
|
||||
write_header (output, 'i');
|
||||
append_uint16 (output, id);
|
||||
append_uint16 (output, x + rects[i].x1);
|
||||
append_uint16 (output, y + rects[i].y1);
|
||||
|
||||
size_start = output->buf->len;
|
||||
append_uint32 (output, 0);
|
||||
|
||||
image_start = output->buf->len;
|
||||
|
||||
subdata = (guint8 *)data + rects[i].x1 * 4 + rects[i].y1 * byte_stride;
|
||||
if (output->binary)
|
||||
to_png_rgba (output->buf, rects[i].x2 - rects[i].x1,
|
||||
rects[i].y2 - rects[i].y1,
|
||||
byte_stride, (guint32*)subdata);
|
||||
else
|
||||
to_png_url_rgba (output->buf, rects[i].x2 - rects[i].x1,
|
||||
url = to_png_rgba (rects[i].x2 - rects[i].x1,
|
||||
rects[i].y2 - rects[i].y1,
|
||||
byte_stride, (guint32*)subdata);
|
||||
|
||||
len = output->buf->len - image_start;
|
||||
url_len = strlen (url);
|
||||
buf_size = HEADER_LEN + 15 + url_len;
|
||||
buf = g_malloc (buf_size);
|
||||
|
||||
overwrite_uint32 (output, size_start, len);
|
||||
|
||||
p = write_header (output, buf, 'i');
|
||||
append_uint16 (id, buf, &p);
|
||||
append_uint16 (x + rects[i].x1, buf, &p);
|
||||
append_uint16 (y + rects[i].y1, buf, &p);
|
||||
|
||||
append_uint32 (url_len, buf, &p);
|
||||
g_assert (p == HEADER_LEN + 15);
|
||||
strncpy (buf + p, url, url_len);
|
||||
|
||||
broadway_output_sendmsg (output, buf, buf_size);
|
||||
|
||||
free (url);
|
||||
g_free (buf);
|
||||
}
|
||||
|
||||
free (rects);
|
||||
@@ -830,6 +799,13 @@ void
|
||||
broadway_output_surface_flush (BroadwayOutput *output,
|
||||
int id)
|
||||
{
|
||||
write_header (output, 'f');
|
||||
append_uint16 (output, id);
|
||||
char buf[HEADER_LEN + 3];
|
||||
int p;
|
||||
|
||||
p = write_header (output, buf, 'f');
|
||||
append_uint16 (id, buf, &p);
|
||||
|
||||
g_assert (p == sizeof (buf));
|
||||
|
||||
broadway_output_sendmsg (output, buf, sizeof (buf));
|
||||
}
|
||||
|
@@ -19,8 +19,7 @@ typedef enum {
|
||||
|
||||
BroadwayOutput *broadway_output_new (GOutputStream *out,
|
||||
guint32 serial,
|
||||
gboolean proto_v7_plus,
|
||||
gboolean binary);
|
||||
gboolean proto_v7_plus);
|
||||
void broadway_output_free (BroadwayOutput *output);
|
||||
int broadway_output_flush (BroadwayOutput *output);
|
||||
int broadway_output_has_error (BroadwayOutput *output);
|
||||
|
@@ -725,56 +725,76 @@ function cmdUngrabPointer()
|
||||
doUngrab();
|
||||
}
|
||||
|
||||
function handleCommands(cmd)
|
||||
function handleCommands(cmdObj)
|
||||
{
|
||||
while (cmd.pos < cmd.length) {
|
||||
var cmd = cmdObj.data;
|
||||
var i = cmdObj.pos;
|
||||
|
||||
while (i < cmd.length) {
|
||||
var id, x, y, w, h, q;
|
||||
var command = cmd.get_char();
|
||||
lastSerial = cmd.get_32();
|
||||
var command = cmd[i++];
|
||||
lastSerial = base64_32(cmd, i);
|
||||
i = i + 6;
|
||||
switch (command) {
|
||||
case 's': // create new surface
|
||||
id = cmd.get_16();
|
||||
x = cmd.get_16s();
|
||||
y = cmd.get_16s();
|
||||
w = cmd.get_16();
|
||||
h = cmd.get_16();
|
||||
var isTemp = cmd.get_bool();
|
||||
id = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
x = base64_16s(cmd, i);
|
||||
i = i + 3;
|
||||
y = base64_16s(cmd, i);
|
||||
i = i + 3;
|
||||
w = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
h = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
var isTemp = cmd[i] == '1';
|
||||
i = i + 1;
|
||||
cmdCreateSurface(id, x, y, w, h, isTemp);
|
||||
break;
|
||||
|
||||
case 'S': // Show a surface
|
||||
id = cmd.get_16();
|
||||
id = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
cmdShowSurface(id);
|
||||
break;
|
||||
|
||||
case 'H': // Hide a surface
|
||||
id = cmd.get_16();
|
||||
id = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
cmdHideSurface(id);
|
||||
break;
|
||||
|
||||
case 'p': // Set transient parent
|
||||
id = cmd.get_16();
|
||||
var parentId = cmd.get_16();
|
||||
id = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
var parentId = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
cmdSetTransientFor(id, parentId);
|
||||
break;
|
||||
|
||||
case 'd': // Delete surface
|
||||
id = cmd.get_16();
|
||||
id = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
cmdDeleteSurface(id);
|
||||
break;
|
||||
|
||||
case 'm': // Move a surface
|
||||
id = cmd.get_16();
|
||||
var ops = cmd.get_flags();
|
||||
id = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
var ops = cmd.charCodeAt(i++) - 48;
|
||||
var has_pos = ops & 1;
|
||||
if (has_pos) {
|
||||
x = cmd.get_16s();
|
||||
y = cmd.get_16s();
|
||||
x = base64_16s(cmd, i);
|
||||
i = i + 3;
|
||||
y = base64_16s(cmd, i);
|
||||
i = i + 3;
|
||||
}
|
||||
var has_size = ops & 2;
|
||||
if (has_size) {
|
||||
w = cmd.get_16();
|
||||
h = cmd.get_16();
|
||||
w = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
h = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
}
|
||||
cmdMoveResizeSurface(id, has_pos, x, y, has_size, w, h);
|
||||
break;
|
||||
@@ -782,50 +802,67 @@ function handleCommands(cmd)
|
||||
case 'i': // Put image data surface
|
||||
q = new Object();
|
||||
q.op = 'i';
|
||||
q.id = cmd.get_16();
|
||||
q.x = cmd.get_16();
|
||||
q.y = cmd.get_16();
|
||||
var url = cmd.get_image_url ();
|
||||
q.id = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
q.x = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
q.y = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
var size = base64_32(cmd, i);
|
||||
i = i + 6;
|
||||
var url = cmd.slice(i, i + size);
|
||||
i = i + size;
|
||||
q.img = new Image();
|
||||
q.img.src = url;
|
||||
surfaces[q.id].drawQueue.push(q);
|
||||
if (!q.img.complete) {
|
||||
q.img.onload = function() { cmd.free_image_url (url); handleOutstanding(); };
|
||||
cmdObj.pos = i;
|
||||
q.img.onload = function() { handleOutstanding(); };
|
||||
return false;
|
||||
}
|
||||
cmd.free_image_url (url);
|
||||
break;
|
||||
|
||||
case 'b': // Copy rects
|
||||
q = new Object();
|
||||
q.op = 'b';
|
||||
q.id = cmd.get_16();
|
||||
var nrects = cmd.get_16();
|
||||
q.id = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
|
||||
var nrects = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
|
||||
q.rects = [];
|
||||
for (var r = 0; r < nrects; r++) {
|
||||
var rect = new Object();
|
||||
rect.x = cmd.get_16();
|
||||
rect.y = cmd.get_16();
|
||||
rect.w = cmd.get_16();
|
||||
rect.h = cmd.get_16();
|
||||
rect.x = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
rect.y = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
rect.w = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
rect.h = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
q.rects.push (rect);
|
||||
}
|
||||
|
||||
q.dx = cmd.get_16s();
|
||||
q.dy = cmd.get_16s();
|
||||
q.dx = base64_16s(cmd, i);
|
||||
i = i + 3;
|
||||
q.dy = base64_16s(cmd, i);
|
||||
i = i + 3;
|
||||
surfaces[q.id].drawQueue.push(q);
|
||||
break;
|
||||
|
||||
case 'f': // Flush surface
|
||||
id = cmd.get_16();
|
||||
id = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
|
||||
cmdFlushSurface(id);
|
||||
break;
|
||||
|
||||
case 'g': // Grab
|
||||
id = cmd.get_16();
|
||||
var ownerEvents = cmd.get_bool ();
|
||||
id = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
var ownerEvents = cmd[i++] == '1';
|
||||
|
||||
cmdGrabPointer(id, ownerEvents);
|
||||
break;
|
||||
@@ -851,103 +888,13 @@ function handleOutstanding()
|
||||
}
|
||||
}
|
||||
|
||||
function TextCommands(message) {
|
||||
this.data = message;
|
||||
this.length = message.length;
|
||||
this.pos = 0;
|
||||
}
|
||||
|
||||
TextCommands.prototype.get_char = function() {
|
||||
return this.data[this.pos++];
|
||||
};
|
||||
TextCommands.prototype.get_bool = function() {
|
||||
return this.get_char() == '1';
|
||||
};
|
||||
TextCommands.prototype.get_flags = function() {
|
||||
return this.get_char() - 48;
|
||||
}
|
||||
TextCommands.prototype.get_16 = function() {
|
||||
var n = base64_16(this.data, this.pos);
|
||||
this.pos = this.pos + 3;
|
||||
return n;
|
||||
};
|
||||
TextCommands.prototype.get_16s = function() {
|
||||
var n = base64_16s(this.data, this.pos);
|
||||
this.pos = this.pos + 3;
|
||||
return n;
|
||||
};
|
||||
TextCommands.prototype.get_32 = function() {
|
||||
var n = base64_32(this.data, this.pos);
|
||||
this.pos = this.pos + 6;
|
||||
return n;
|
||||
};
|
||||
TextCommands.prototype.get_image_url = function() {
|
||||
var size = this.get_32();
|
||||
var url = this.data.slice(this.pos, this.pos + size);
|
||||
this.pos = this.pos + size;
|
||||
return url;
|
||||
};
|
||||
TextCommands.prototype.free_image_url = function(url) {
|
||||
};
|
||||
|
||||
function BinCommands(message) {
|
||||
this.arraybuffer = message;
|
||||
this.u8 = new Uint8Array(message);
|
||||
this.length = this.u8.length;
|
||||
this.pos = 0;
|
||||
}
|
||||
|
||||
BinCommands.prototype.get_char = function() {
|
||||
return String.fromCharCode(this.u8[this.pos++]);
|
||||
};
|
||||
BinCommands.prototype.get_bool = function() {
|
||||
return this.u8[this.pos++] != 0;
|
||||
};
|
||||
BinCommands.prototype.get_flags = function() {
|
||||
return this.u8[this.pos++];
|
||||
}
|
||||
BinCommands.prototype.get_16 = function() {
|
||||
var v =
|
||||
this.u8[this.pos] +
|
||||
(this.u8[this.pos+1] << 8);
|
||||
this.pos = this.pos + 2;
|
||||
return v;
|
||||
};
|
||||
BinCommands.prototype.get_16s = function() {
|
||||
var v = this.get_16 ();
|
||||
if (v > 32767)
|
||||
return v - 65536;
|
||||
else
|
||||
return v;
|
||||
};
|
||||
BinCommands.prototype.get_32 = function() {
|
||||
var v =
|
||||
this.u8[this.pos] +
|
||||
(this.u8[this.pos+1] << 8) +
|
||||
(this.u8[this.pos+2] << 16) +
|
||||
(this.u8[this.pos+3] << 24);
|
||||
this.pos = this.pos + 4;
|
||||
return v;
|
||||
};
|
||||
BinCommands.prototype.get_image_url = function() {
|
||||
var size = this.get_32();
|
||||
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;
|
||||
};
|
||||
BinCommands.prototype.free_image_url = function(url) {
|
||||
URL.revokeObjectURL(url);
|
||||
};
|
||||
|
||||
function handleMessage(message)
|
||||
{
|
||||
var cmd;
|
||||
if (message instanceof ArrayBuffer)
|
||||
cmd = new BinCommands(message);
|
||||
else
|
||||
cmd = new TextCommands(message);
|
||||
outstandingCommands.push(cmd);
|
||||
var cmdObj = {};
|
||||
cmdObj.data = message;
|
||||
cmdObj.pos = 0;
|
||||
|
||||
outstandingCommands.push(cmdObj);
|
||||
if (outstandingCommands.length == 1) {
|
||||
handleOutstanding();
|
||||
}
|
||||
@@ -2812,18 +2759,6 @@ function setupDocument(document)
|
||||
}
|
||||
}
|
||||
|
||||
function newWS(loc) {
|
||||
var ws = null;
|
||||
if ("WebSocket" in window) {
|
||||
ws = new WebSocket(loc, "broadway");
|
||||
} else if ("MozWebSocket" in window) { // Firefox 6
|
||||
ws = new MozWebSocket(loc);
|
||||
} else {
|
||||
alert("WebSocket not supported, broadway will not work!");
|
||||
}
|
||||
return ws;
|
||||
}
|
||||
|
||||
function connect()
|
||||
{
|
||||
var url = window.location.toString();
|
||||
@@ -2836,39 +2771,41 @@ function connect()
|
||||
|
||||
var loc = window.location.toString().replace("http:", "ws:");
|
||||
loc = loc.substr(0, loc.lastIndexOf('/')) + "/socket";
|
||||
var ws = null;
|
||||
|
||||
var supports_binary = newWS (loc + "-test").binaryType == "blob";
|
||||
if (supports_binary) {
|
||||
ws = newWS (loc + "-bin");
|
||||
ws.binaryType = "arraybuffer";
|
||||
if ("WebSocket" in window) {
|
||||
ws = new WebSocket(loc, "broadway");
|
||||
} else if ("MozWebSocket" in window) { // Firefox 6
|
||||
ws = new MozWebSocket(loc);
|
||||
} else {
|
||||
ws = newWS (loc);
|
||||
alert("WebSocket not supported, input will not work!");
|
||||
return;
|
||||
}
|
||||
|
||||
ws.onopen = function() {
|
||||
inputSocket = ws;
|
||||
var w, h;
|
||||
if (useToplevelWindows) {
|
||||
w = window.screen.width;
|
||||
h = window.screen.height;
|
||||
} else {
|
||||
w = window.innerWidth;
|
||||
h = window.innerHeight;
|
||||
window.onresize = function(ev) {
|
||||
var w, h;
|
||||
ws.onopen = function() {
|
||||
inputSocket = ws;
|
||||
var w, h;
|
||||
if (useToplevelWindows) {
|
||||
w = window.screen.width;
|
||||
h = window.screen.height;
|
||||
} else {
|
||||
w = window.innerWidth;
|
||||
h = window.innerHeight;
|
||||
sendInput ("d", [w, h]);
|
||||
};
|
||||
}
|
||||
sendInput ("d", [w, h]);
|
||||
};
|
||||
ws.onclose = function() {
|
||||
inputSocket = null;
|
||||
};
|
||||
ws.onmessage = function(event) {
|
||||
handleMessage(event.data);
|
||||
};
|
||||
window.onresize = function(ev) {
|
||||
var w, h;
|
||||
w = window.innerWidth;
|
||||
h = window.innerHeight;
|
||||
sendInput ("d", [w, h]);
|
||||
};
|
||||
}
|
||||
sendInput ("d", [w, h]);
|
||||
};
|
||||
ws.onclose = function() {
|
||||
inputSocket = null;
|
||||
};
|
||||
ws.onmessage = function(event) {
|
||||
handleMessage(event.data);
|
||||
};
|
||||
|
||||
setupDocument(document);
|
||||
window.onunload = function (ev) {
|
||||
|
@@ -130,7 +130,7 @@ typedef struct HttpRequest {
|
||||
GString *request;
|
||||
} HttpRequest;
|
||||
|
||||
static void start_output (HttpRequest *request, gboolean proto_v7_plus, gboolean binary);
|
||||
static void start_output (HttpRequest *request, gboolean proto_v7_plus);
|
||||
|
||||
static void
|
||||
http_request_free (HttpRequest *request)
|
||||
@@ -149,7 +149,6 @@ struct BroadwayInput {
|
||||
gboolean seen_time;
|
||||
gint64 time_base;
|
||||
gboolean proto_v7_plus;
|
||||
gboolean binary;
|
||||
};
|
||||
|
||||
static void
|
||||
@@ -692,7 +691,7 @@ generate_handshake_response_wsietf_v7 (const gchar *key)
|
||||
}
|
||||
|
||||
static void
|
||||
start_input (HttpRequest *request, gboolean binary)
|
||||
start_input (HttpRequest *request)
|
||||
{
|
||||
char **lines;
|
||||
char *p;
|
||||
@@ -868,7 +867,6 @@ start_input (HttpRequest *request, gboolean binary)
|
||||
input->display = request->display;
|
||||
input->connection = g_object_ref (request->connection);
|
||||
input->proto_v7_plus = proto_v7_plus;
|
||||
input->binary = binary;
|
||||
|
||||
data_buffer = g_buffered_input_stream_peek_buffer (G_BUFFERED_INPUT_STREAM (request->data), &data_buffer_size);
|
||||
input->buffer = g_byte_array_sized_new (data_buffer_size);
|
||||
@@ -876,7 +874,7 @@ start_input (HttpRequest *request, gboolean binary)
|
||||
|
||||
broadway_display->input = input;
|
||||
|
||||
start_output (request, proto_v7_plus, binary);
|
||||
start_output (request, proto_v7_plus);
|
||||
|
||||
/* This will free and close the data input stream, but we got all the buffered content already */
|
||||
http_request_free (request);
|
||||
@@ -894,7 +892,7 @@ start_input (HttpRequest *request, gboolean binary)
|
||||
}
|
||||
|
||||
static void
|
||||
start_output (HttpRequest *request, gboolean proto_v7_plus, gboolean binary)
|
||||
start_output (HttpRequest *request, gboolean proto_v7_plus)
|
||||
{
|
||||
GSocket *socket;
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
@@ -914,7 +912,7 @@ start_output (HttpRequest *request, gboolean proto_v7_plus, gboolean binary)
|
||||
|
||||
broadway_display->output =
|
||||
broadway_output_new (g_io_stream_get_output_stream (G_IO_STREAM (request->connection)),
|
||||
broadway_display->saved_serial, proto_v7_plus, binary);
|
||||
broadway_display->saved_serial, proto_v7_plus);
|
||||
|
||||
_gdk_broadway_resync_windows ();
|
||||
|
||||
@@ -987,9 +985,7 @@ got_request (HttpRequest *request)
|
||||
else if (strcmp (escaped, "/broadway.js") == 0)
|
||||
send_data (request, "text/javascript", broadway_js, G_N_ELEMENTS(broadway_js) - 1);
|
||||
else if (strcmp (escaped, "/socket") == 0)
|
||||
start_input (request, FALSE);
|
||||
else if (strcmp (escaped, "/socket-bin") == 0)
|
||||
start_input (request, TRUE);
|
||||
start_input (request);
|
||||
else
|
||||
send_error (request, 404, "File not found");
|
||||
|
||||
|
@@ -274,6 +274,8 @@ gdk_pre_parse_libgtk_only (void)
|
||||
_gdk_rendering_mode = GDK_RENDERING_MODE_RECORDING;
|
||||
}
|
||||
|
||||
g_type_init ();
|
||||
|
||||
/* Do any setup particular to the windowing system */
|
||||
gdk_display_manager_get ();
|
||||
}
|
||||
|
@@ -24,8 +24,6 @@
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkdisplay.h"
|
||||
#include "gdkmain.h"
|
||||
#include "gdkwindow.h"
|
||||
|
||||
/**
|
||||
* gdk_pointer_ungrab:
|
||||
|
@@ -584,11 +584,12 @@ gdk_keymap_translate_keyboard_state (GdkKeymap *keymap,
|
||||
/**
|
||||
* gdk_keymap_add_virtual_modifiers:
|
||||
* @keymap: a #GdkKeymap
|
||||
* @state: (inout): pointer to the modifier mask to change
|
||||
* @state: (out): pointer to the modifier mask to change
|
||||
*
|
||||
* Maps the non-virtual modifiers (i.e Mod2, Mod3, ...) which are set
|
||||
* in @state to the virtual modifiers (i.e. Super, Hyper and Meta) and
|
||||
* set the corresponding bits in @state.
|
||||
* Adds virtual modifiers (i.e. Super, Hyper and Meta) which correspond
|
||||
* to the real modifiers (i.e Mod2, Mod3, ...) in @modifiers.
|
||||
* are set in @state to their non-virtual counterparts (i.e. Mod2,
|
||||
* Mod3,...) and set the corresponding bits in @state.
|
||||
*
|
||||
* GDK already does this before delivering key events, but for
|
||||
* compatibility reasons, it only sets the first virtual modifier
|
||||
@@ -611,7 +612,7 @@ gdk_keymap_add_virtual_modifiers (GdkKeymap *keymap,
|
||||
/**
|
||||
* gdk_keymap_map_virtual_modifiers:
|
||||
* @keymap: a #GdkKeymap
|
||||
* @state: (inout): pointer to the modifier state to map
|
||||
* @state: (out): pointer to the modifier state to map
|
||||
*
|
||||
* Maps the virtual modifiers (i.e. Super, Hyper and Meta) which
|
||||
* are set in @state to their non-virtual counterparts (i.e. Mod2,
|
||||
|
@@ -24,7 +24,6 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkkeys.h"
|
||||
#include "gdktypes.h"
|
||||
|
||||
|
||||
|
@@ -21,7 +21,6 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkscreenprivate.h"
|
||||
#include "gdkrectangle.h"
|
||||
#include "gdkwindow.h"
|
||||
|
@@ -29,7 +29,7 @@ G_BEGIN_DECLS
|
||||
|
||||
|
||||
/**
|
||||
* SECTION:gdktestutils
|
||||
* SECTION:gdktesting
|
||||
* @Short_description: Test utilities
|
||||
* @Title: Testing
|
||||
*
|
||||
|
@@ -73,6 +73,8 @@ guint gdk_threads_add_timeout_seconds (guint interval,
|
||||
gpointer data);
|
||||
|
||||
|
||||
#if !(GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_6)
|
||||
|
||||
/**
|
||||
* GDK_THREADS_ENTER:
|
||||
*
|
||||
@@ -98,6 +100,8 @@ guint gdk_threads_add_timeout_seconds (guint interval,
|
||||
*/
|
||||
#define GDK_THREADS_LEAVE() gdk_threads_leave()
|
||||
|
||||
#endif
|
||||
|
||||
#undef GDK_THREADS_DEPRECATED
|
||||
|
||||
G_END_DECLS
|
||||
|
@@ -90,16 +90,6 @@
|
||||
*/
|
||||
#define GDK_VERSION_3_6 (G_ENCODE_VERSION (3, 6))
|
||||
|
||||
/**
|
||||
* GDK_VERSION_3_8:
|
||||
*
|
||||
* A macro that evaluates to the 3.8 version of GDK, in a format
|
||||
* that can be used by the C pre-processor.
|
||||
*
|
||||
* Since: 3.8
|
||||
*/
|
||||
#define GDK_VERSION_3_8 (G_ENCODE_VERSION (3, 8))
|
||||
|
||||
|
||||
/* evaluates to the current stable version; for development cycles,
|
||||
* this means the next stable target
|
||||
@@ -227,18 +217,4 @@
|
||||
# define GDK_AVAILABLE_IN_3_6
|
||||
#endif
|
||||
|
||||
#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_8
|
||||
# define GDK_DEPRECATED_IN_3_8 GDK_DEPRECATED
|
||||
# define GDK_DEPRECATED_IN_3_8_FOR(f) GDK_DEPRECATED_FOR(f)
|
||||
#else
|
||||
# define GDK_DEPRECATED_IN_3_8
|
||||
# define GDK_DEPRECATED_IN_3_8_FOR(f)
|
||||
#endif
|
||||
|
||||
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_8
|
||||
# define GDK_AVAILABLE_IN_3_8 GDK_UNAVAILABLE(3, 8)
|
||||
#else
|
||||
# define GDK_AVAILABLE_IN_3_8
|
||||
#endif
|
||||
|
||||
#endif /* __GDK_VERSION_MACROS_H__ */
|
||||
|
198
gdk/gdkwindow.c
@@ -65,6 +65,25 @@
|
||||
* <firstterm>composited</firstterm> window it is the responsibility of the
|
||||
* application to render the window contents at the right spot.
|
||||
* </para>
|
||||
* <example id="composited-window-example">
|
||||
* <title>Composited windows</title>
|
||||
* <programlisting>
|
||||
* <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../examples/gdk/composited-window-example.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include>
|
||||
* </programlisting></example>
|
||||
* <para>
|
||||
* In the example <xref linkend="composited-window-example"/>, a button is
|
||||
* placed inside of an event box inside of a window. The event box is set as
|
||||
* composited and therefore is no longer automatically drawn to the screen.
|
||||
*
|
||||
* When the contents of the event box change, an expose event is generated on
|
||||
* its parent window (which, in this case, belongs to the toplevel #GtkWindow).
|
||||
* The expose handler for this widget is responsible for merging the changes
|
||||
* back on the screen in the way that it wishes.
|
||||
*
|
||||
* In our case, we merge the contents with a 50% transparency. We also set the
|
||||
* background colour of the window to red. The effect is that the background
|
||||
* shows through the button.
|
||||
* </para>
|
||||
* </refsect2>
|
||||
* <refsect2 id="OFFSCREEN-WINDOWS">
|
||||
* <title>Offscreen Windows</title>
|
||||
@@ -93,7 +112,7 @@
|
||||
* be it a toplevel window or a child window. In this setup the
|
||||
* GdkWindow (and other GdkDrawables) were platform independent classes,
|
||||
* and the actual platform specific implementation was in a delegate
|
||||
* object available as "impl" in the window object.
|
||||
* object availible as "impl" in the window object.
|
||||
*
|
||||
* With the addition of client side windows and offscreen windows this
|
||||
* changes a bit. The application-visible GdkWindow object behaves as
|
||||
@@ -235,7 +254,6 @@ static void gdk_window_invalidate_rect_full (GdkWindow *window,
|
||||
gboolean invalidate_children,
|
||||
ClearBg clear_bg);
|
||||
static void _gdk_window_propagate_has_alpha_background (GdkWindow *window);
|
||||
static cairo_surface_t *gdk_window_ref_impl_surface (GdkWindow *window);
|
||||
|
||||
static guint signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
@@ -245,42 +263,6 @@ static const cairo_user_data_key_t gdk_window_cairo_key;
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE (GdkWindow, gdk_window, G_TYPE_OBJECT)
|
||||
|
||||
#ifdef DEBUG_WINDOW_PRINTING
|
||||
char *
|
||||
print_region (cairo_region_t *region)
|
||||
{
|
||||
GString *s = g_string_new ("{");
|
||||
if (cairo_region_is_empty (region))
|
||||
{
|
||||
g_string_append (s, "empty");
|
||||
}
|
||||
else
|
||||
{
|
||||
int num = cairo_region_num_rectangles (region);
|
||||
cairo_rectangle_int_t r;
|
||||
|
||||
if (num == 1)
|
||||
{
|
||||
cairo_region_get_rectangle (region, 0, &r);
|
||||
g_string_append_printf (s, "%dx%d @%d,%d", r.width, r.height, r.x, r.y);
|
||||
}
|
||||
else
|
||||
{
|
||||
cairo_region_get_extents (region, &r);
|
||||
g_string_append_printf (s, "extent: %dx%d @%d,%d, details: ", r.width, r.height, r.x, r.y);
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
g_string_append_printf (s, "[%dx%d @%d,%d]", r.width, r.height, r.x, r.y);
|
||||
if (i != num -1)
|
||||
g_string_append (s, ", ");
|
||||
}
|
||||
}
|
||||
}
|
||||
g_string_append (s, "}");
|
||||
return g_string_free (s, FALSE);
|
||||
}
|
||||
#endif
|
||||
|
||||
GType
|
||||
_gdk_paintable_get_type (void)
|
||||
{
|
||||
@@ -668,13 +650,6 @@ gdk_window_has_no_impl (GdkWindow *window)
|
||||
return window->impl_window != window;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_window_has_alpha (GdkWindow *window)
|
||||
{
|
||||
return !gdk_window_has_impl (window) &&
|
||||
window->has_alpha_background;
|
||||
}
|
||||
|
||||
static void
|
||||
remove_layered_child_area (GdkWindow *window,
|
||||
cairo_region_t *region)
|
||||
@@ -702,7 +677,7 @@ remove_layered_child_area (GdkWindow *window,
|
||||
continue;
|
||||
|
||||
/* Only non-impl children with alpha add to the layered region */
|
||||
if (!gdk_window_has_alpha (child))
|
||||
if (!child->has_alpha_background && gdk_window_has_impl (child))
|
||||
continue;
|
||||
|
||||
r.x = child->x;
|
||||
@@ -804,7 +779,7 @@ remove_child_area (GdkWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
if (gdk_window_has_alpha (child))
|
||||
if (child->has_alpha_background)
|
||||
{
|
||||
if (layered_region != NULL)
|
||||
cairo_region_union (layered_region, child_region);
|
||||
@@ -1370,11 +1345,6 @@ gdk_window_new (GdkWindow *parent,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (attributes_mask & GDK_WA_VISUAL)
|
||||
{
|
||||
g_return_val_if_fail (gdk_visual_get_screen (attributes->visual) == screen, NULL);
|
||||
}
|
||||
|
||||
display = gdk_screen_get_display (screen);
|
||||
|
||||
window = _gdk_display_create_window (display);
|
||||
@@ -2701,7 +2671,7 @@ gdk_window_get_content (GdkWindow *window)
|
||||
|
||||
g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
|
||||
|
||||
surface = gdk_window_ref_impl_surface (window);
|
||||
surface = _gdk_window_ref_cairo_surface (window);
|
||||
content = cairo_surface_get_content (surface);
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
@@ -2776,55 +2746,60 @@ gdk_cairo_create_for_impl (GdkWindow *window)
|
||||
return cr;
|
||||
}
|
||||
|
||||
/* This is called whenever something is drawing directly to the
|
||||
* window, bypassing the double buffering. When this happens we
|
||||
* need to mark any the currently drawn data in the double buffer
|
||||
* as invalid to avoid later drawing it back over the directly
|
||||
* rendered pixels. We also need to mark this region as "flushed"
|
||||
* so that if we later try to paint on it double-buffered we need
|
||||
* to read back the on-window pixels rather than relying on what
|
||||
* is in the current double-buffer pixmap.
|
||||
*
|
||||
* Note that this doesn't correctly handle the case where the
|
||||
* non-double buffered drawing uses transparency and relies on
|
||||
* what the windows below it draws. A fix for that would require
|
||||
* drawing the existing double-buffered background to the window,
|
||||
* but that causes ugly flashes. Non-double buffered drawing is
|
||||
* typically only used in old code or when the drawed widget
|
||||
* already has a double-buffering layer, and in these cases the
|
||||
* pixels are opaque anyway. If you need transparency, don't
|
||||
* disable double buffering.
|
||||
*/
|
||||
/* Ensure that all content related to this (sub)window is pushed to the
|
||||
native region. If there is an active paint then that area is not
|
||||
pushed, in order to not show partially finished double buffers. */
|
||||
static void
|
||||
gdk_window_flush_implicit_paint (GdkWindow *window)
|
||||
{
|
||||
GdkWindow *impl_window;
|
||||
GdkWindowPaint *paint;
|
||||
cairo_region_t *region;
|
||||
GSList *list;
|
||||
|
||||
impl_window = gdk_window_get_impl_window (window);
|
||||
if (impl_window->implicit_paint == NULL)
|
||||
return;
|
||||
|
||||
paint = impl_window->implicit_paint;
|
||||
|
||||
region = cairo_region_copy (window->clip_region_with_children);
|
||||
|
||||
cairo_region_translate (region, window->abs_x, window->abs_y);
|
||||
|
||||
/* Anything in the whole flushed window that was drawn is now
|
||||
considered unpainted, so that we don't push it back at the
|
||||
end of the implicit paint overwriting the directly rendered
|
||||
pixels. */
|
||||
cairo_region_subtract (paint->region, region);
|
||||
|
||||
/* Save flushed area so we can read it back if we draw over it later */
|
||||
if (paint->flushed == NULL)
|
||||
paint->flushed = region;
|
||||
paint->flushed = cairo_region_copy (region);
|
||||
else
|
||||
cairo_region_union (paint->flushed, region);
|
||||
|
||||
cairo_region_intersect (region, paint->region);
|
||||
|
||||
/* Don't flush active double buffers, as that may show partially done
|
||||
* rendering */
|
||||
for (list = window->paint_stack; list != NULL; list = list->next)
|
||||
{
|
||||
cairo_region_union (paint->flushed, region);
|
||||
cairo_region_destroy (region);
|
||||
GdkWindowPaint *tmp_paint = list->data;
|
||||
|
||||
cairo_region_subtract (region, tmp_paint->region);
|
||||
}
|
||||
|
||||
if (!GDK_WINDOW_DESTROYED (window) && !cairo_region_is_empty (region))
|
||||
{
|
||||
cairo_t *cr;
|
||||
|
||||
/* Remove flushed region from the implicit paint */
|
||||
cairo_region_subtract (paint->region, region);
|
||||
|
||||
/* Some regions are valid, push these to window now */
|
||||
cr = gdk_cairo_create_for_impl (window);
|
||||
gdk_cairo_region (cr, region);
|
||||
cairo_clip (cr);
|
||||
cairo_set_source_surface (cr, paint->surface, 0, 0);
|
||||
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
|
||||
cairo_paint (cr);
|
||||
cairo_destroy (cr);
|
||||
}
|
||||
|
||||
cairo_region_destroy (region);
|
||||
}
|
||||
|
||||
/* Ends an implicit paint, paired with gdk_window_begin_implicit_paint returning TRUE */
|
||||
@@ -2996,7 +2971,8 @@ gdk_window_begin_paint_region (GdkWindow *window,
|
||||
by being drawn in back to front order. However, if implicit paints are not used, for
|
||||
instance if it was flushed due to a non-double-buffered paint in the middle of the
|
||||
expose we need to copy in the existing data here. */
|
||||
if (gdk_window_has_alpha (window) &&
|
||||
if (!gdk_window_has_impl (window) &&
|
||||
window->has_alpha_background &&
|
||||
(!implicit_paint ||
|
||||
(implicit_paint && implicit_paint->flushed != NULL && !cairo_region_is_empty (implicit_paint->flushed))))
|
||||
{
|
||||
@@ -3436,6 +3412,28 @@ gdk_window_flush (GdkWindow *window)
|
||||
gdk_window_flush_implicit_paint (window);
|
||||
}
|
||||
|
||||
/* If we're about to move/resize or otherwise change the
|
||||
* hierarchy of a client side window in an impl and we're
|
||||
* called from an expose event handler then we need to
|
||||
* flush any already painted parts of the implicit paint
|
||||
* that are not part of the current paint, as these may
|
||||
* be used when scrolling or may overdraw the changes
|
||||
* caused by the hierarchy change.
|
||||
*/
|
||||
static void
|
||||
gdk_window_flush_if_exposing (GdkWindow *window)
|
||||
{
|
||||
GdkWindow *impl_window;
|
||||
|
||||
impl_window = gdk_window_get_impl_window (window);
|
||||
|
||||
/* If we're in an implicit paint (i.e. in an expose handler, flush
|
||||
all the already finished exposes to get things to an uptodate state. */
|
||||
if (impl_window->implicit_paint)
|
||||
gdk_window_flush (window);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gdk_window_flush_recursive_helper (GdkWindow *window,
|
||||
GdkWindowImpl *impl)
|
||||
@@ -5336,6 +5334,8 @@ gdk_window_raise (GdkWindow *window)
|
||||
if (window->destroyed)
|
||||
return;
|
||||
|
||||
gdk_window_flush_if_exposing (window);
|
||||
|
||||
/* Keep children in (reverse) stacking order */
|
||||
gdk_window_raise_internal (window);
|
||||
|
||||
@@ -5456,6 +5456,8 @@ gdk_window_lower (GdkWindow *window)
|
||||
if (window->destroyed)
|
||||
return;
|
||||
|
||||
gdk_window_flush_if_exposing (window);
|
||||
|
||||
/* Keep children in (reverse) stacking order */
|
||||
gdk_window_lower_internal (window);
|
||||
|
||||
@@ -5511,6 +5513,8 @@ gdk_window_restack (GdkWindow *window,
|
||||
return;
|
||||
}
|
||||
|
||||
gdk_window_flush_if_exposing (window);
|
||||
|
||||
if (gdk_window_is_toplevel (window))
|
||||
{
|
||||
g_return_if_fail (gdk_window_is_toplevel (sibling));
|
||||
@@ -6066,6 +6070,8 @@ gdk_window_move_resize_internal (GdkWindow *window,
|
||||
window->y == y)))
|
||||
return;
|
||||
|
||||
gdk_window_flush_if_exposing (window);
|
||||
|
||||
/* Handle child windows */
|
||||
|
||||
expose = FALSE;
|
||||
@@ -6167,7 +6173,7 @@ gdk_window_move_resize_internal (GdkWindow *window,
|
||||
* Everything in the old and new regions that is not copied must be
|
||||
* invalidated (including children) as this is newly exposed
|
||||
*/
|
||||
if (gdk_window_has_alpha (window))
|
||||
if (window->has_alpha_background)
|
||||
copy_area = cairo_region_create (); /* Copy nothing for alpha windows */
|
||||
else
|
||||
copy_area = cairo_region_copy (new_region);
|
||||
@@ -6350,6 +6356,8 @@ gdk_window_scroll (GdkWindow *window,
|
||||
if (window->destroyed)
|
||||
return;
|
||||
|
||||
gdk_window_flush_if_exposing (window);
|
||||
|
||||
old_layered_area = cairo_region_copy (window->layered_region);
|
||||
old_native_child_region = collect_native_child_region (window, FALSE);
|
||||
if (old_native_child_region)
|
||||
@@ -6391,7 +6399,7 @@ gdk_window_scroll (GdkWindow *window,
|
||||
impl_window = gdk_window_get_impl_window (window);
|
||||
|
||||
/* Calculate the area that can be gotten by copying the old area */
|
||||
if (gdk_window_has_alpha (window))
|
||||
if (window->has_alpha_background)
|
||||
copy_area = cairo_region_create (); /* Copy nothing for alpha windows */
|
||||
else
|
||||
copy_area = cairo_region_copy (window->clip_region);
|
||||
@@ -6479,7 +6487,7 @@ gdk_window_move_region (GdkWindow *window,
|
||||
impl_window = gdk_window_get_impl_window (window);
|
||||
|
||||
/* compute source regions */
|
||||
if (gdk_window_has_alpha (window))
|
||||
if (window->has_alpha_background)
|
||||
copy_area = cairo_region_create (); /* Copy nothing for alpha windows */
|
||||
else
|
||||
copy_area = cairo_region_copy (region);
|
||||
@@ -9804,16 +9812,11 @@ proxy_button_event (GdkEvent *source_event,
|
||||
}
|
||||
|
||||
#ifdef DEBUG_WINDOW_PRINTING
|
||||
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
#include "x11/gdkx.h"
|
||||
#endif
|
||||
|
||||
static void
|
||||
gdk_window_print (GdkWindow *window,
|
||||
int indent)
|
||||
{
|
||||
char *s;
|
||||
GdkRectangle r;
|
||||
const char *window_types[] = {
|
||||
"root",
|
||||
"toplevel",
|
||||
@@ -9852,8 +9855,11 @@ gdk_window_print (GdkWindow *window,
|
||||
g_print (" abs[%d,%d]",
|
||||
window->abs_x, window->abs_y);
|
||||
|
||||
s = print_region (window->clip_region);
|
||||
g_print (" clipbox[%s]", s);
|
||||
cairo_region_get_extents (window->clip_region, &r);
|
||||
if (cairo_region_is_empty (window->clip_region))
|
||||
g_print (" clipbox[empty]");
|
||||
else
|
||||
g_print (" clipbox[%d,%d %dx%d]", r.x, r.y, r.width, r.height);
|
||||
|
||||
g_print ("\n");
|
||||
}
|
||||
@@ -10123,7 +10129,7 @@ gdk_window_create_similar_surface (GdkWindow * window,
|
||||
|
||||
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
|
||||
|
||||
window_surface = gdk_window_ref_impl_surface (window);
|
||||
window_surface = _gdk_window_ref_cairo_surface (window);
|
||||
|
||||
switch (_gdk_rendering_mode)
|
||||
{
|
||||
|
@@ -141,38 +141,6 @@
|
||||
return inMove;
|
||||
}
|
||||
|
||||
-(void)checkSendEnterNotify
|
||||
{
|
||||
GdkWindow *window = [[self contentView] gdkWindow];
|
||||
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
|
||||
|
||||
/* When a new window has been created, and the mouse
|
||||
* is in the window area, we will not receive an NSMouseEntered
|
||||
* event. Therefore, we synthesize an enter notify event manually.
|
||||
*/
|
||||
if (!initialPositionKnown)
|
||||
{
|
||||
initialPositionKnown = YES;
|
||||
|
||||
if (NSPointInRect ([NSEvent mouseLocation], [self frame]))
|
||||
{
|
||||
NSEvent *event;
|
||||
|
||||
event = [NSEvent enterExitEventWithType: NSMouseEntered
|
||||
location: [self mouseLocationOutsideOfEventStream]
|
||||
modifierFlags: 0
|
||||
timestamp: [[NSApp currentEvent] timestamp]
|
||||
windowNumber: [impl->toplevel windowNumber]
|
||||
context: NULL
|
||||
eventNumber: 0
|
||||
trackingNumber: [impl->view trackingRect]
|
||||
userData: nil];
|
||||
|
||||
[NSApp postEvent:event atStart:NO];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-(void)windowDidMove:(NSNotification *)aNotification
|
||||
{
|
||||
GdkWindow *window = [[self contentView] gdkWindow];
|
||||
@@ -189,8 +157,6 @@
|
||||
event->configure.height = window->height;
|
||||
|
||||
_gdk_event_queue_append (gdk_display_get_default (), event);
|
||||
|
||||
[self checkSendEnterNotify];
|
||||
}
|
||||
|
||||
-(void)windowDidResize:(NSNotification *)aNotification
|
||||
@@ -220,8 +186,6 @@
|
||||
event->configure.height = window->height;
|
||||
|
||||
_gdk_event_queue_append (gdk_display_get_default (), event);
|
||||
|
||||
[self checkSendEnterNotify];
|
||||
}
|
||||
|
||||
-(id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)styleMask backing:(NSBackingStoreType)backingType defer:(BOOL)flag screen:(NSScreen *)screen
|
||||
@@ -319,8 +283,6 @@
|
||||
[impl->toplevel orderFront:nil];
|
||||
|
||||
inShowOrHide = NO;
|
||||
|
||||
[self checkSendEnterNotify];
|
||||
}
|
||||
|
||||
- (void)hide
|
||||
@@ -331,8 +293,6 @@
|
||||
inShowOrHide = YES;
|
||||
[impl->toplevel orderOut:nil];
|
||||
inShowOrHide = NO;
|
||||
|
||||
initialPositionKnown = NO;
|
||||
}
|
||||
|
||||
- (BOOL)trackManualMove
|
||||
|
@@ -23,7 +23,6 @@
|
||||
@interface GdkQuartzNSWindow : NSWindow {
|
||||
BOOL inMove;
|
||||
BOOL inShowOrHide;
|
||||
BOOL initialPositionKnown;
|
||||
|
||||
/* Manually triggered move/resize (not by the window manager) */
|
||||
BOOL inManualMove;
|
||||
|
@@ -81,25 +81,6 @@
|
||||
if (NSEqualRects (rect, NSZeroRect))
|
||||
return;
|
||||
|
||||
if (!GDK_WINDOW_IS_MAPPED (gdk_window))
|
||||
{
|
||||
/* If the window is not yet mapped, clip_region_with_children
|
||||
* will be empty causing the usual code below to draw nothing.
|
||||
* To not see garbage on the screen, we draw an aesthetic color
|
||||
* here. The garbage would be visible if any widget enabled
|
||||
* the NSView's CALayer in order to add sublayers for custom
|
||||
* native rendering.
|
||||
*/
|
||||
[NSGraphicsContext saveGraphicsState];
|
||||
|
||||
[[NSColor windowBackgroundColor] setFill];
|
||||
[NSBezierPath fillRect:rect];
|
||||
|
||||
[NSGraphicsContext restoreGraphicsState];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* Clear our own bookkeeping of regions that need display */
|
||||
if (impl->needs_display_region)
|
||||
{
|
||||
@@ -167,6 +148,15 @@
|
||||
owner:self
|
||||
userData:nil
|
||||
assumeInside:NO];
|
||||
|
||||
if (NSPointInRect ([[self window] convertScreenToBase:[NSEvent mouseLocation]], rect))
|
||||
{
|
||||
/* When a new window (and thus view) has been created, and the mouse
|
||||
* is in the window area, we will not receive an NSMouseEntered
|
||||
* event. Therefore, we synthesize an enter notify event manually.
|
||||
*/
|
||||
_gdk_quartz_events_send_enter_notify_event (gdk_window);
|
||||
}
|
||||
}
|
||||
|
||||
-(void)viewDidMoveToWindow
|
||||
|
@@ -635,6 +635,21 @@ gdk_event_check (GSource *source)
|
||||
|
||||
gdk_threads_enter ();
|
||||
|
||||
/* Refresh the autorelease pool if we're at the base CFRunLoop level
|
||||
* (indicated by current_loop_level) and the base g_main_loop level
|
||||
* (indicated by g_main_depth()). Messing with the autorelease pool at
|
||||
* any level of nesting can cause access to deallocated memory because
|
||||
* autorelease_pool is static and releasing a pool will cause all pools
|
||||
* allocated inside of it to be released as well.
|
||||
*/
|
||||
if (current_loop_level == 0 && g_main_depth() == 0)
|
||||
{
|
||||
if (autorelease_pool)
|
||||
[autorelease_pool drain];
|
||||
|
||||
autorelease_pool = [[NSAutoreleasePool alloc] init];
|
||||
}
|
||||
|
||||
retval = (_gdk_event_queue_find_first (_gdk_display) != NULL ||
|
||||
_gdk_quartz_event_loop_check_pending ());
|
||||
|
||||
@@ -652,21 +667,6 @@ gdk_event_dispatch (GSource *source,
|
||||
|
||||
gdk_threads_enter ();
|
||||
|
||||
/* Refresh the autorelease pool if we're at the base CFRunLoop level
|
||||
* (indicated by current_loop_level) and the base g_main_loop level
|
||||
* (indicated by g_main_depth()). Messing with the autorelease pool at
|
||||
* any level of nesting can cause access to deallocated memory because
|
||||
* autorelease_pool is static and releasing a pool will cause all pools
|
||||
* allocated inside of it to be released as well.
|
||||
*/
|
||||
if (current_loop_level == 0 && g_main_depth() == 0)
|
||||
{
|
||||
if (autorelease_pool)
|
||||
[autorelease_pool drain];
|
||||
|
||||
autorelease_pool = [[NSAutoreleasePool alloc] init];
|
||||
}
|
||||
|
||||
_gdk_quartz_display_queue_events (_gdk_display);
|
||||
|
||||
event = _gdk_event_unqueue (_gdk_display);
|
||||
@@ -703,10 +703,6 @@ poll_func (GPollFD *ufds,
|
||||
NSDate *limit_date;
|
||||
gint n_ready;
|
||||
|
||||
static GPollFD *last_ufds;
|
||||
|
||||
last_ufds = ufds;
|
||||
|
||||
n_ready = select_thread_start_poll (ufds, nfds, timeout_);
|
||||
if (n_ready > 0)
|
||||
timeout_ = 0;
|
||||
@@ -725,16 +721,7 @@ poll_func (GPollFD *ufds,
|
||||
dequeue: YES];
|
||||
getting_events--;
|
||||
|
||||
/* We check if last_ufds did not change since the time this function was
|
||||
* called. It is possible that a recursive main loop (and thus recursive
|
||||
* invocation of this poll function) is triggered while in
|
||||
* nextEventMatchingMask:. If during that time new fds are added,
|
||||
* the cached fds array might be replaced in g_main_context_iterate().
|
||||
* So, we should avoid accessing the old fd array (still pointed at by
|
||||
* ufds) here in that case, since it might have been freed. We avoid this
|
||||
* by not calling the collect stage.
|
||||
*/
|
||||
if (last_ufds == ufds && n_ready < 0)
|
||||
if (n_ready < 0)
|
||||
n_ready = select_thread_collect_poll (ufds, nfds);
|
||||
|
||||
if (event &&
|
||||
|
@@ -58,62 +58,10 @@ static GdkWindow *find_toplevel_under_pointer (GdkDisplay *display,
|
||||
gint *y);
|
||||
|
||||
|
||||
static void
|
||||
gdk_quartz_ns_notification_callback (CFNotificationCenterRef center,
|
||||
void *observer,
|
||||
CFStringRef name,
|
||||
const void *object,
|
||||
CFDictionaryRef userInfo)
|
||||
{
|
||||
GdkEvent new_event;
|
||||
|
||||
new_event.type = GDK_SETTING;
|
||||
new_event.setting.window = gdk_screen_get_root_window (_gdk_screen);
|
||||
new_event.setting.send_event = FALSE;
|
||||
new_event.setting.action = GDK_SETTING_ACTION_CHANGED;
|
||||
new_event.setting.name = NULL;
|
||||
|
||||
/* Translate name */
|
||||
if (CFStringCompare (name,
|
||||
CFSTR("AppleNoRedisplayAppearancePreferenceChanged"),
|
||||
0) == kCFCompareEqualTo)
|
||||
new_event.setting.name = "gtk-primary-button-warps-slider";
|
||||
|
||||
if (!new_event.setting.name)
|
||||
return;
|
||||
|
||||
gdk_event_put (&new_event);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_quartz_events_init_notifications (void)
|
||||
{
|
||||
static gboolean notifications_initialized = FALSE;
|
||||
|
||||
if (notifications_initialized)
|
||||
return;
|
||||
notifications_initialized = TRUE;
|
||||
|
||||
/* Initialize any handlers for notifications we want to push to GTK
|
||||
* through GdkEventSettings.
|
||||
*/
|
||||
|
||||
/* This is an undocumented *distributed* notification to listen for changes
|
||||
* in scrollbar jump behavior. It is used by LibreOffice and WebKit as well.
|
||||
*/
|
||||
CFNotificationCenterAddObserver (CFNotificationCenterGetDistributedCenter (),
|
||||
NULL,
|
||||
&gdk_quartz_ns_notification_callback,
|
||||
CFSTR ("AppleNoRedisplayAppearancePreferenceChanged"),
|
||||
NULL,
|
||||
CFNotificationSuspensionBehaviorDeliverImmediately);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_quartz_events_init (void)
|
||||
{
|
||||
_gdk_quartz_event_loop_init ();
|
||||
gdk_quartz_events_init_notifications ();
|
||||
|
||||
current_keyboard_window = g_object_ref (_gdk_root);
|
||||
}
|
||||
@@ -224,11 +172,8 @@ static guint32
|
||||
get_time_from_ns_event (NSEvent *event)
|
||||
{
|
||||
double time = [event timestamp];
|
||||
|
||||
/* cast via double->uint64 conversion to make sure that it is
|
||||
* wrapped on 32-bit machines when it overflows
|
||||
*/
|
||||
return (guint32) (guint64) (time * 1000.0);
|
||||
|
||||
return time * 1000.0;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -401,89 +346,34 @@ get_window_point_from_screen_point (GdkWindow *window,
|
||||
*y = window->height - point.y;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_mouse_button_press_event (NSEventType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case NSLeftMouseDown:
|
||||
case NSRightMouseDown:
|
||||
case NSOtherMouseDown:
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static GdkWindow *
|
||||
get_toplevel_from_ns_event (NSEvent *nsevent,
|
||||
NSPoint *screen_point,
|
||||
gint *x,
|
||||
gint *y)
|
||||
{
|
||||
GdkWindow *toplevel = NULL;
|
||||
GdkWindow *toplevel;
|
||||
|
||||
if ([nsevent window])
|
||||
{
|
||||
GdkQuartzView *view;
|
||||
NSPoint point, view_point;
|
||||
NSRect view_frame;
|
||||
NSPoint point;
|
||||
|
||||
view = (GdkQuartzView *)[[nsevent window] contentView];
|
||||
|
||||
toplevel = [view gdkWindow];
|
||||
|
||||
point = [nsevent locationInWindow];
|
||||
view_point = [view convertPoint:point fromView:nil];
|
||||
view_frame = [view frame];
|
||||
*screen_point = [[nsevent window] convertBaseToScreen:point];
|
||||
|
||||
/* NSEvents come in with a window set, but with window coordinates
|
||||
* out of window bounds. For e.g. moved events this is fine, we use
|
||||
* this information to properly handle enter/leave notify and motion
|
||||
* events. For mouse button press/release, we want to avoid forwarding
|
||||
* these events however, because the window they relate to is not the
|
||||
* window set in the event. This situation appears to occur when button
|
||||
* presses come in just before (or just after?) a window is resized and
|
||||
* also when a button press occurs on the OS X window titlebar.
|
||||
*
|
||||
* By setting toplevel to NULL, we do another attempt to get the right
|
||||
* toplevel window below.
|
||||
*/
|
||||
if (is_mouse_button_press_event ([nsevent type]) &&
|
||||
(view_point.x < view_frame.origin.x ||
|
||||
view_point.x >= view_frame.origin.x + view_frame.size.width ||
|
||||
view_point.y < view_frame.origin.y ||
|
||||
view_point.y >= view_frame.origin.y + view_frame.size.height))
|
||||
{
|
||||
toplevel = NULL;
|
||||
|
||||
/* This is a hack for button presses to break all grabs. E.g. if
|
||||
* a menu is open and one clicks on the title bar (or anywhere
|
||||
* out of window bounds), we really want to pop down the menu (by
|
||||
* breaking the grabs) before OS X handles the action of the title
|
||||
* bar button.
|
||||
*
|
||||
* Because we cannot ingest this event into GDK, we have to do it
|
||||
* here, not very nice.
|
||||
*/
|
||||
_gdk_quartz_events_break_all_grabs (get_time_from_ns_event (nsevent));
|
||||
}
|
||||
else
|
||||
{
|
||||
*screen_point = [[nsevent window] convertBaseToScreen:point];
|
||||
|
||||
*x = point.x;
|
||||
*y = toplevel->height - point.y;
|
||||
}
|
||||
*x = point.x;
|
||||
*y = toplevel->height - point.y;
|
||||
}
|
||||
|
||||
if (!toplevel)
|
||||
else
|
||||
{
|
||||
/* Fallback used when no NSWindow set. This happens e.g. when
|
||||
* we allow motion events without a window set in gdk_event_translate()
|
||||
* that occur immediately after the main menu bar was clicked/used.
|
||||
* This fallback will not return coordinates contained in a window's
|
||||
* titlebar.
|
||||
*/
|
||||
*screen_point = [NSEvent mouseLocation];
|
||||
toplevel = find_toplevel_under_pointer (_gdk_display,
|
||||
@@ -530,7 +420,7 @@ generate_motion_event (GdkWindow *window)
|
||||
|
||||
event->any.type = GDK_MOTION_NOTIFY;
|
||||
event->motion.window = window;
|
||||
event->motion.time = get_time_from_ns_event ([NSApp currentEvent]);
|
||||
event->motion.time = GDK_CURRENT_TIME;
|
||||
event->motion.x = x;
|
||||
event->motion.y = y;
|
||||
event->motion.x_root = x_root;
|
||||
@@ -589,6 +479,39 @@ _gdk_quartz_events_update_focus_window (GdkWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_quartz_events_send_enter_notify_event (GdkWindow *window)
|
||||
{
|
||||
NSPoint screen_point;
|
||||
GdkEvent *event;
|
||||
gint x, y, x_root, y_root;
|
||||
|
||||
event = gdk_event_new (GDK_ENTER_NOTIFY);
|
||||
event->any.window = NULL;
|
||||
event->any.send_event = FALSE;
|
||||
|
||||
screen_point = [NSEvent mouseLocation];
|
||||
|
||||
_gdk_quartz_window_nspoint_to_gdk_xy (screen_point, &x_root, &y_root);
|
||||
get_window_point_from_screen_point (window, screen_point, &x, &y);
|
||||
|
||||
event->crossing.window = window;
|
||||
event->crossing.subwindow = NULL;
|
||||
event->crossing.time = GDK_CURRENT_TIME;
|
||||
event->crossing.x = x;
|
||||
event->crossing.y = y;
|
||||
event->crossing.x_root = x_root;
|
||||
event->crossing.y_root = y_root;
|
||||
event->crossing.mode = GDK_CROSSING_NORMAL;
|
||||
event->crossing.detail = GDK_NOTIFY_ANCESTOR;
|
||||
event->crossing.state = _gdk_quartz_events_get_current_keyboard_modifiers () |
|
||||
_gdk_quartz_events_get_current_mouse_modifiers ();
|
||||
|
||||
gdk_event_set_device (event, _gdk_display->core_pointer);
|
||||
|
||||
append_event (event, TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_quartz_events_send_map_event (GdkWindow *window)
|
||||
{
|
||||
@@ -622,18 +545,6 @@ find_toplevel_under_pointer (GdkDisplay *display,
|
||||
if (toplevel && WINDOW_IS_TOPLEVEL (toplevel))
|
||||
get_window_point_from_screen_point (toplevel, screen_point, x, y);
|
||||
|
||||
if (toplevel)
|
||||
{
|
||||
/* If the coordinates are out of window bounds, this toplevel is not
|
||||
* under the pointer and we thus return NULL. This can occur when
|
||||
* toplevel under pointer has not yet been updated due to a very recent
|
||||
* window resize. Alternatively, we should no longer be relying on
|
||||
* the toplevel_under_pointer value which is maintained in gdkwindow.c.
|
||||
*/
|
||||
if (*x < 0 || *y < 0 || *x >= toplevel->width || *y >= toplevel->height)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return toplevel;
|
||||
}
|
||||
|
||||
@@ -806,8 +717,6 @@ find_window_for_ns_event (NSEvent *nsevent,
|
||||
view = (GdkQuartzView *)[[nsevent window] contentView];
|
||||
|
||||
toplevel = get_toplevel_from_ns_event (nsevent, &screen_point, x, y);
|
||||
if (!toplevel)
|
||||
return NULL;
|
||||
_gdk_quartz_window_nspoint_to_gdk_xy (screen_point, x_root, y_root);
|
||||
|
||||
event_type = [nsevent type];
|
||||
@@ -1121,9 +1030,8 @@ synthesize_crossing_event (GdkWindow *window,
|
||||
switch ([nsevent type])
|
||||
{
|
||||
case NSMouseEntered:
|
||||
/* Enter events are considered always to be from another toplevel
|
||||
* window, this shouldn't negatively affect any app or gtk code,
|
||||
* and is the only way to make GtkMenu work. EEK EEK EEK.
|
||||
/* Enter events are considered always to be from the root window as we
|
||||
* can't know for sure from what window we enter.
|
||||
*/
|
||||
if (!(window->event_mask & GDK_ENTER_NOTIFY_MASK))
|
||||
return FALSE;
|
||||
@@ -1133,11 +1041,14 @@ synthesize_crossing_event (GdkWindow *window,
|
||||
x_root, y_root,
|
||||
GDK_ENTER_NOTIFY,
|
||||
GDK_CROSSING_NORMAL,
|
||||
GDK_NOTIFY_NONLINEAR);
|
||||
GDK_NOTIFY_ANCESTOR);
|
||||
return TRUE;
|
||||
|
||||
case NSMouseExited:
|
||||
/* See above */
|
||||
/* Exited always is to the root window as far as we are concerned,
|
||||
* since there is no way to reliably get information about what new
|
||||
* window is entered when exiting one.
|
||||
*/
|
||||
if (!(window->event_mask & GDK_LEAVE_NOTIFY_MASK))
|
||||
return FALSE;
|
||||
|
||||
@@ -1146,7 +1057,7 @@ synthesize_crossing_event (GdkWindow *window,
|
||||
x_root, y_root,
|
||||
GDK_LEAVE_NOTIFY,
|
||||
GDK_CROSSING_NORMAL,
|
||||
GDK_NOTIFY_NONLINEAR);
|
||||
GDK_NOTIFY_ANCESTOR);
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
@@ -1343,9 +1254,9 @@ gdk_event_translate (GdkEvent *event,
|
||||
}
|
||||
|
||||
/* Also when in a manual resize, we ignore events so that these are
|
||||
* pushed to GdkQuartzNSWindow's sendEvent handler.
|
||||
* pushed to GdkQuartzWindow's sendEvent handler.
|
||||
*/
|
||||
if ([(GdkQuartzNSWindow *)nswindow isInManualResize])
|
||||
if ([(GdkQuartzWindow *)nswindow isInManualResize])
|
||||
return FALSE;
|
||||
|
||||
/* Find the right GDK window to send the event to, taking grabs and
|
||||
@@ -1472,9 +1383,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
|
||||
if (dx != 0.0 || dy != 0.0)
|
||||
{
|
||||
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
|
||||
if (gdk_quartz_osx_version() >= GDK_OSX_LION &&
|
||||
[nsevent hasPreciseScrollingDeltas])
|
||||
if ([nsevent hasPreciseScrollingDeltas])
|
||||
{
|
||||
GdkEvent *emulated_event;
|
||||
|
||||
@@ -1486,7 +1395,6 @@ gdk_event_translate (GdkEvent *event,
|
||||
append_event (emulated_event, TRUE);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
fill_scroll_event (window, event, nsevent,
|
||||
x, y, x_root, y_root,
|
||||
dx, dy, direction);
|
||||
@@ -1637,19 +1545,6 @@ _gdk_quartz_screen_get_setting (GdkScreen *screen,
|
||||
|
||||
GDK_QUARTZ_RELEASE_POOL;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
else if (strcmp (name, "gtk-primary-button-warps-slider") == 0)
|
||||
{
|
||||
GDK_QUARTZ_ALLOC_POOL;
|
||||
|
||||
BOOL setting = [[NSUserDefaults standardUserDefaults] boolForKey:@"AppleScrollerPagingBehavior"];
|
||||
|
||||
/* If the Apple property is YES, it means "warp" */
|
||||
g_value_set_boolean (value, setting == YES);
|
||||
|
||||
GDK_QUARTZ_RELEASE_POOL;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@@ -176,7 +176,7 @@ const static struct {
|
||||
{ 67, GDK_KEY_asterisk, GDK_KEY_KP_Multiply },
|
||||
{ 69, GDK_KEY_plus, GDK_KEY_KP_Add },
|
||||
{ 75, GDK_KEY_slash, GDK_KEY_KP_Divide },
|
||||
{ 76, GDK_KEY_Return, GDK_KEY_KP_Enter },
|
||||
{ 76, 0x01000003, GDK_KEY_KP_Enter },
|
||||
{ 78, GDK_KEY_minus, GDK_KEY_KP_Subtract },
|
||||
{ 81, GDK_KEY_equal, GDK_KEY_KP_Equal },
|
||||
{ 82, GDK_KEY_0, GDK_KEY_KP_0 },
|
||||
@@ -629,15 +629,17 @@ gdk_quartz_keymap_get_entries_for_keycode (GdkKeymap *keymap,
|
||||
return *n_entries > 0;
|
||||
}
|
||||
|
||||
#define GET_KEYVAL(keycode, group, level) (keyval_array[(keycode * KEYVALS_PER_KEYCODE + group * 2 + level)])
|
||||
|
||||
static guint
|
||||
gdk_quartz_keymap_lookup_key (GdkKeymap *keymap,
|
||||
const GdkKeymapKey *key)
|
||||
{
|
||||
return GET_KEYVAL (key->keycode, key->group, key->level);
|
||||
/* FIXME: Implement */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define GET_KEYVAL(keycode, group, level) (keyval_array[(keycode * KEYVALS_PER_KEYCODE + group * 2 + level)])
|
||||
|
||||
static guint
|
||||
translate_keysym (guint hardware_keycode,
|
||||
gint group,
|
||||
|
@@ -64,6 +64,7 @@ void _gdk_quartz_events_send_map_event (GdkWindow *window);
|
||||
GdkModifierType _gdk_quartz_events_get_current_keyboard_modifiers (void);
|
||||
GdkModifierType _gdk_quartz_events_get_current_mouse_modifiers (void);
|
||||
|
||||
void _gdk_quartz_events_send_enter_notify_event (GdkWindow *window);
|
||||
void _gdk_quartz_events_break_all_grabs (guint32 time);
|
||||
|
||||
/* Event loop */
|
||||
|
@@ -2315,31 +2315,28 @@ gdk_quartz_window_focus (GdkWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
static gint
|
||||
window_type_hint_to_level (GdkWindowTypeHint hint)
|
||||
static
|
||||
gint window_type_hint_to_level (GdkWindowTypeHint hint)
|
||||
{
|
||||
/* the order in this switch statement corresponds to the actual
|
||||
* stacking order: the first group is top, the last group is bottom
|
||||
*/
|
||||
switch (hint)
|
||||
{
|
||||
case GDK_WINDOW_TYPE_HINT_POPUP_MENU:
|
||||
case GDK_WINDOW_TYPE_HINT_COMBO:
|
||||
case GDK_WINDOW_TYPE_HINT_DND:
|
||||
case GDK_WINDOW_TYPE_HINT_TOOLTIP:
|
||||
return NSPopUpMenuWindowLevel;
|
||||
|
||||
case GDK_WINDOW_TYPE_HINT_NOTIFICATION:
|
||||
case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN:
|
||||
return NSStatusWindowLevel;
|
||||
case GDK_WINDOW_TYPE_HINT_DOCK:
|
||||
case GDK_WINDOW_TYPE_HINT_UTILITY:
|
||||
return NSFloatingWindowLevel;
|
||||
|
||||
case GDK_WINDOW_TYPE_HINT_MENU: /* Torn-off menu */
|
||||
case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU: /* Menu from menubar */
|
||||
return NSTornOffMenuWindowLevel;
|
||||
|
||||
case GDK_WINDOW_TYPE_HINT_DOCK:
|
||||
case GDK_WINDOW_TYPE_HINT_UTILITY:
|
||||
return NSFloatingWindowLevel;
|
||||
case GDK_WINDOW_TYPE_HINT_NOTIFICATION:
|
||||
case GDK_WINDOW_TYPE_HINT_TOOLTIP:
|
||||
return NSStatusWindowLevel;
|
||||
|
||||
case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN:
|
||||
case GDK_WINDOW_TYPE_HINT_POPUP_MENU:
|
||||
case GDK_WINDOW_TYPE_HINT_COMBO:
|
||||
case GDK_WINDOW_TYPE_HINT_DND:
|
||||
return NSPopUpMenuWindowLevel;
|
||||
|
||||
case GDK_WINDOW_TYPE_HINT_NORMAL: /* Normal toplevel window */
|
||||
case GDK_WINDOW_TYPE_HINT_DIALOG: /* Dialog window */
|
||||
@@ -2354,7 +2351,7 @@ window_type_hint_to_level (GdkWindowTypeHint hint)
|
||||
return NSNormalWindowLevel;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static gboolean
|
||||
window_type_hint_to_shadow (GdkWindowTypeHint hint)
|
||||
{
|
||||
switch (hint)
|
||||
@@ -2384,31 +2381,13 @@ window_type_hint_to_shadow (GdkWindowTypeHint hint)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
window_type_hint_to_hides_on_deactivate (GdkWindowTypeHint hint)
|
||||
{
|
||||
switch (hint)
|
||||
{
|
||||
case GDK_WINDOW_TYPE_HINT_UTILITY:
|
||||
case GDK_WINDOW_TYPE_HINT_MENU: /* Torn-off menu */
|
||||
case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN:
|
||||
case GDK_WINDOW_TYPE_HINT_NOTIFICATION:
|
||||
case GDK_WINDOW_TYPE_HINT_TOOLTIP:
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_quartz_window_set_type_hint (GdkWindow *window,
|
||||
GdkWindowTypeHint hint)
|
||||
{
|
||||
GdkWindowImplQuartz *impl;
|
||||
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window) ||
|
||||
!WINDOW_IS_TOPLEVEL (window))
|
||||
return;
|
||||
@@ -2423,7 +2402,6 @@ gdk_quartz_window_set_type_hint (GdkWindow *window,
|
||||
|
||||
[impl->toplevel setHasShadow: window_type_hint_to_shadow (hint)];
|
||||
[impl->toplevel setLevel: window_type_hint_to_level (hint)];
|
||||
[impl->toplevel setHidesOnDeactivate: window_type_hint_to_hides_on_deactivate (hint)];
|
||||
}
|
||||
|
||||
static GdkWindowTypeHint
|
||||
@@ -2641,7 +2619,6 @@ gdk_quartz_window_set_decorations (GdkWindow *window,
|
||||
defer:NO];
|
||||
[impl->toplevel setHasShadow: window_type_hint_to_shadow (impl->type_hint)];
|
||||
[impl->toplevel setLevel: window_type_hint_to_level (impl->type_hint)];
|
||||
[impl->toplevel setHidesOnDeactivate: window_type_hint_to_hides_on_deactivate (impl->type_hint)];
|
||||
[impl->toplevel setContentView:old_view];
|
||||
}
|
||||
|
||||
|
@@ -183,7 +183,6 @@ gdk_device_core_set_window_cursor (GdkDevice *device,
|
||||
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);
|
||||
|
||||
g_object_unref (cursor);
|
||||
}
|
||||
@@ -1241,14 +1240,14 @@ 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;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_SHIFT, XKB_STATE_EFFECTIVE) > 0)?GDK_SHIFT_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_CAPS, XKB_STATE_EFFECTIVE) > 0)?GDK_LOCK_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_CTRL, XKB_STATE_EFFECTIVE) > 0)?GDK_CONTROL_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_ALT, XKB_STATE_EFFECTIVE) > 0)?GDK_MOD1_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, "Mod2", XKB_STATE_EFFECTIVE) > 0)?GDK_MOD2_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, "Mod3", XKB_STATE_EFFECTIVE) > 0)?GDK_MOD3_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_LOGO, XKB_STATE_EFFECTIVE) > 0)?GDK_MOD4_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, "Mod5", XKB_STATE_EFFECTIVE) > 0)?GDK_MOD5_MASK:0;
|
||||
|
||||
return modifiers;
|
||||
}
|
||||
@@ -1325,11 +1324,16 @@ deliver_key_event(GdkWaylandDevice *device,
|
||||
struct xkb_state *xkb_state;
|
||||
GdkKeymap *keymap;
|
||||
xkb_keysym_t sym;
|
||||
uint32_t num_syms;
|
||||
const xkb_keysym_t *syms;
|
||||
|
||||
keymap = device->keymap;
|
||||
xkb_state = _gdk_wayland_keymap_get_xkb_state (keymap);
|
||||
|
||||
sym = xkb_state_key_get_one_sym (xkb_state, key);
|
||||
num_syms = xkb_key_get_syms (xkb_state, key, &syms);
|
||||
sym = XKB_KEY_NoSymbol;
|
||||
if (num_syms == 1)
|
||||
sym = syms[0];
|
||||
|
||||
device->time = time;
|
||||
device->modifiers = get_modifier (xkb_state);
|
||||
|
@@ -96,8 +96,7 @@ static void
|
||||
output_handle_geometry(void *data,
|
||||
struct wl_output *wl_output,
|
||||
int x, int y, int physical_width, int physical_height,
|
||||
int subpixel, const char *make, const char *model,
|
||||
int32_t transform)
|
||||
int subpixel, const char *make, const char *model)
|
||||
{
|
||||
/*
|
||||
g_signal_emit_by_name (screen, "monitors-changed");
|
||||
@@ -120,8 +119,8 @@ static const struct wl_output_listener output_listener = {
|
||||
};
|
||||
|
||||
static void
|
||||
gdk_registry_handle_global(void *data, struct wl_registry *registry, uint32_t id,
|
||||
const char *interface, uint32_t version)
|
||||
gdk_display_handle_global(struct wl_display *display, uint32_t id,
|
||||
const char *interface, uint32_t version, void *data)
|
||||
{
|
||||
GdkWaylandDisplay *display_wayland = data;
|
||||
GdkDisplay *gdk_display = GDK_DISPLAY_OBJECT (data);
|
||||
@@ -129,29 +128,27 @@ gdk_registry_handle_global(void *data, struct wl_registry *registry, uint32_t id
|
||||
|
||||
if (strcmp(interface, "wl_compositor") == 0) {
|
||||
display_wayland->compositor =
|
||||
wl_registry_bind(display_wayland->wl_registry, id, &wl_compositor_interface, 1);
|
||||
wl_display_bind(display, id, &wl_compositor_interface);
|
||||
} else if (strcmp(interface, "wl_shm") == 0) {
|
||||
display_wayland->shm =
|
||||
wl_registry_bind(display_wayland->wl_registry, id, &wl_shm_interface, 1);
|
||||
display_wayland->shm = wl_display_bind(display, id, &wl_shm_interface);
|
||||
|
||||
/* SHM interface is prerequisite */
|
||||
_gdk_wayland_display_load_cursor_theme(display_wayland);
|
||||
} else if (strcmp(interface, "wl_shell") == 0) {
|
||||
display_wayland->shell =
|
||||
wl_registry_bind(display_wayland->wl_registry, id, &wl_shell_interface, 1);
|
||||
display_wayland->shell = wl_display_bind(display, id, &wl_shell_interface);
|
||||
} else if (strcmp(interface, "wl_output") == 0) {
|
||||
display_wayland->output =
|
||||
wl_registry_bind(display_wayland->wl_registry, id, &wl_output_interface, 1);
|
||||
wl_display_bind(display, id, &wl_output_interface);
|
||||
wl_output_add_listener(display_wayland->output,
|
||||
&output_listener, display_wayland);
|
||||
} else if (strcmp(interface, "wl_seat") == 0) {
|
||||
seat = wl_registry_bind(display_wayland->wl_registry, id, &wl_seat_interface, 1);
|
||||
seat = wl_display_bind (display, id, &wl_seat_interface);
|
||||
_gdk_wayland_device_manager_add_device (gdk_display->device_manager,
|
||||
seat);
|
||||
} else if (strcmp(interface, "wl_data_device_manager") == 0) {
|
||||
display_wayland->data_device_manager =
|
||||
wl_registry_bind(display_wayland->wl_registry, id,
|
||||
&wl_data_device_manager_interface, 1);
|
||||
wl_display_bind(display, id,
|
||||
&wl_data_device_manager_interface);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,10 +210,6 @@ gdk_display_init_egl(GdkDisplay *display)
|
||||
}
|
||||
#endif
|
||||
|
||||
static const struct wl_registry_listener registry_listener = {
|
||||
gdk_registry_handle_global
|
||||
};
|
||||
|
||||
GdkDisplay *
|
||||
_gdk_wayland_display_open (const gchar *display_name)
|
||||
{
|
||||
@@ -238,13 +231,14 @@ _gdk_wayland_display_open (const gchar *display_name)
|
||||
display->device_manager = _gdk_wayland_device_manager_new (display);
|
||||
|
||||
/* Set up listener so we'll catch all events. */
|
||||
display_wayland->wl_registry = wl_display_get_registry(display_wayland->wl_display);
|
||||
wl_registry_add_listener(display_wayland->wl_registry, ®istry_listener, display_wayland);
|
||||
wl_display_add_global_listener(display_wayland->wl_display,
|
||||
gdk_display_handle_global, display_wayland);
|
||||
|
||||
#ifdef GDK_WAYLAND_USE_EGL
|
||||
gdk_display_init_egl(display);
|
||||
#else
|
||||
wl_display_dispatch(display_wayland->wl_display);
|
||||
wl_display_iterate(wl_display, WL_DISPLAY_READABLE);
|
||||
wl_display_roundtrip(wl_display);
|
||||
#endif
|
||||
|
||||
display_wayland->event_source =
|
||||
@@ -357,7 +351,8 @@ gdk_wayland_display_flush (GdkDisplay *display)
|
||||
g_return_if_fail (GDK_IS_DISPLAY (display));
|
||||
|
||||
if (!display->closed)
|
||||
wl_display_flush(GDK_WAYLAND_DISPLAY (display)->wl_display);;
|
||||
_gdk_wayland_display_flush (display,
|
||||
GDK_WAYLAND_DISPLAY (display)->event_source);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@@ -76,7 +76,6 @@ struct _GdkWaylandDisplay
|
||||
|
||||
/* Wayland fields below */
|
||||
struct wl_display *wl_display;
|
||||
struct wl_registry *wl_registry;
|
||||
struct wl_compositor *compositor;
|
||||
struct wl_shm *shm;
|
||||
struct wl_shell *shell;
|
||||
|
@@ -136,7 +136,7 @@ gdk_wayland_display_manager_lookup_keyval (GdkDisplayManager *manager,
|
||||
{
|
||||
g_return_val_if_fail (keyval_name != NULL, 0);
|
||||
|
||||
return xkb_keysym_from_name (keyval_name, 0);
|
||||
return xkb_keysym_from_name(keyval_name);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
|
@@ -44,7 +44,8 @@ gdk_event_source_prepare(GSource *base, gint *timeout)
|
||||
if (_gdk_event_queue_find_first (source->display) != NULL)
|
||||
return TRUE;
|
||||
|
||||
wl_display_flush(display->wl_display);
|
||||
while (source->mask & WL_DISPLAY_WRITABLE)
|
||||
wl_display_iterate(display->wl_display, WL_DISPLAY_WRITABLE);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -96,6 +97,16 @@ static GSourceFuncs wl_glib_source_funcs = {
|
||||
gdk_event_source_finalize
|
||||
};
|
||||
|
||||
static int
|
||||
gdk_event_source_update(uint32_t mask, void *data)
|
||||
{
|
||||
GdkWaylandEventSource *source = data;
|
||||
|
||||
source->mask = mask;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_wayland_display_deliver_event (GdkDisplay *display, GdkEvent *event)
|
||||
{
|
||||
@@ -123,7 +134,8 @@ _gdk_wayland_display_event_source_new (GdkDisplay *display)
|
||||
|
||||
display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
wl_source->display = display;
|
||||
wl_source->pfd.fd = wl_display_get_fd(display_wayland->wl_display);
|
||||
wl_source->pfd.fd = wl_display_get_fd(display_wayland->wl_display,
|
||||
gdk_event_source_update, source);
|
||||
wl_source->pfd.events = G_IO_IN | G_IO_ERR;
|
||||
g_source_add_poll(source, &wl_source->pfd);
|
||||
|
||||
@@ -136,6 +148,16 @@ _gdk_wayland_display_event_source_new (GdkDisplay *display)
|
||||
return source;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_wayland_display_flush (GdkDisplay *display, GSource *source)
|
||||
{
|
||||
GdkWaylandEventSource *wayland_source = (GdkWaylandEventSource *) source;
|
||||
|
||||
while (wayland_source->mask & WL_DISPLAY_WRITABLE)
|
||||
wl_display_iterate(GDK_WAYLAND_DISPLAY (display)->wl_display,
|
||||
WL_DISPLAY_WRITABLE);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_wayland_display_queue_events (GdkDisplay *display)
|
||||
{
|
||||
@@ -144,9 +166,10 @@ _gdk_wayland_display_queue_events (GdkDisplay *display)
|
||||
|
||||
display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
source = (GdkWaylandEventSource *) display_wayland->event_source;
|
||||
|
||||
if (source->pfd.revents)
|
||||
{
|
||||
wl_display_dispatch(display_wayland->wl_display);
|
||||
source->pfd.revents = 0;
|
||||
wl_display_iterate(display_wayland->wl_display, WL_DISPLAY_READABLE);
|
||||
source->pfd.revents = 0;
|
||||
}
|
||||
}
|
||||
|
@@ -221,7 +221,7 @@ _gdk_wayland_keymap_new ()
|
||||
names.layout = "us";
|
||||
names.variant = "";
|
||||
names.options = "";
|
||||
keymap->xkb_keymap = xkb_keymap_new_from_names (context, &names, 0);
|
||||
keymap->xkb_keymap = xkb_map_new_from_names(context, &names, XKB_MAP_COMPILE_PLACEHOLDER);
|
||||
keymap->xkb_state = xkb_state_new (keymap->xkb_keymap);
|
||||
xkb_context_unref (context);
|
||||
|
||||
@@ -246,7 +246,7 @@ _gdk_wayland_keymap_new_from_fd (uint32_t format,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
keymap->xkb_keymap = xkb_keymap_new_from_string (context, map_str, format, 0);
|
||||
keymap->xkb_keymap = xkb_map_new_from_string (context, map_str, format, XKB_MAP_COMPILE_PLACEHOLDER);
|
||||
munmap (map_str, size);
|
||||
close (fd);
|
||||
keymap->xkb_state = xkb_state_new (keymap->xkb_keymap);
|
||||
|
@@ -137,6 +137,7 @@ GdkKeymap *_gdk_wayland_device_get_keymap (GdkDevice *device);
|
||||
void _gdk_wayland_display_deliver_event (GdkDisplay *display, GdkEvent *event);
|
||||
GSource *_gdk_wayland_display_event_source_new (GdkDisplay *display);
|
||||
void _gdk_wayland_display_queue_events (GdkDisplay *display);
|
||||
void _gdk_wayland_display_flush (GdkDisplay *display, GSource *source);
|
||||
|
||||
GdkAppLaunchContext *_gdk_wayland_display_get_app_launch_context (GdkDisplay *display);
|
||||
|
||||
|