Compare commits
18 Commits
wip/cssnod
...
touch-sele
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c46630553 | ||
|
|
e0ac74b50e | ||
|
|
7a574f6ba8 | ||
|
|
b8d160c637 | ||
|
|
c1cff4f846 | ||
|
|
dc699fd02a | ||
|
|
9798a80d85 | ||
|
|
87fab63a5c | ||
|
|
2d7fe86c7e | ||
|
|
88c15def46 | ||
|
|
faab5ecbd9 | ||
|
|
100e57c326 | ||
|
|
35715a449e | ||
|
|
8305d93e8b | ||
|
|
fa230ffb11 | ||
|
|
cceea46f36 | ||
|
|
b97f276ee6 | ||
|
|
a167753741 |
2
HACKING
2
HACKING
@@ -17,7 +17,7 @@ can be found here:
|
||||
|
||||
Information about using git with GNOME can be found here:
|
||||
|
||||
https://wiki.gnome.org/Git
|
||||
http://live.gnome.org/Git
|
||||
|
||||
In order to get GIT GTK+ installed on your system, you need to have
|
||||
the most recent GIT versions of GLib, Pango, and ATK installed as well.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
## Makefile.am for GTK+
|
||||
include $(top_srcdir)/Makefile.decl
|
||||
|
||||
SRC_SUBDIRS = gdk gtk libgail-util modules demos tests testsuite examples
|
||||
SRC_SUBDIRS = util gdk gtk libgail-util modules demos tests testsuite examples
|
||||
SUBDIRS = po po-properties $(SRC_SUBDIRS) docs m4macros build
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
|
||||
@@ -21,8 +21,7 @@ EXTRA_DIST += \
|
||||
gtk-zip.sh.in \
|
||||
sanitize-la.sh \
|
||||
po/README.translators \
|
||||
po/po2tbl.sed.in \
|
||||
make-pot
|
||||
po/po2tbl.sed.in
|
||||
|
||||
MAINTAINERCLEANFILES = \
|
||||
$(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \
|
||||
|
||||
426
NEWS
426
NEWS
@@ -1,429 +1,3 @@
|
||||
Overview of Changes in GTK+ 3.15.12
|
||||
===================================
|
||||
|
||||
* GtkMenuButton:
|
||||
- Improve accessible names
|
||||
|
||||
* GtkCellRendererPixbuf:
|
||||
- Always follow state changes, the ::follow-state property
|
||||
is now ignored. This is necessary to make HighContrast
|
||||
and symbolic icons remain visible e.g. in selected rows.
|
||||
|
||||
* GtkEntry:
|
||||
- Rework the size allocation code to be less arcane. This
|
||||
changed the semantics of the get_frame_size() vfunc. GtkEntry
|
||||
subclasses that override this vfunc may need adjustment.
|
||||
|
||||
* Wayland:
|
||||
- Support hi-dpi cursors
|
||||
|
||||
* Bugs fixed:
|
||||
745829 crash when double-clicking close button while popover...
|
||||
746141 wayland: Support HiDPI pointer cursors
|
||||
746192 Insensitive backdrop ToolButtons are not drawn correctly
|
||||
746201 Sidebar icons are black on black in HighContrast theme
|
||||
746202 use insensitive color for unfocused selected items
|
||||
746205 gemfile: needs add source rubygems.org
|
||||
746282 pixman warnings after recent changes
|
||||
746301 Opening "Sound" panel generates pixman error
|
||||
|
||||
* Translation updates:
|
||||
Bosnian
|
||||
Bulgarian
|
||||
Catalan
|
||||
Danish
|
||||
Punjabi
|
||||
Slovenian
|
||||
Swedish
|
||||
Vietnamese
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.15.11
|
||||
===================================
|
||||
|
||||
* Go back to requiring GTK_FRAME_EXTENTS support for CSD,
|
||||
to fix shadow problems in KDE.
|
||||
|
||||
* Bug fixes:
|
||||
535929 Fix warnings from xReply test in configure.in
|
||||
577862 FileFilter name not set
|
||||
669008 Kerberos authentication popup
|
||||
712760 Clang static analysis fixes
|
||||
739070 Undefined reference to get_xkb() when building with --disable-xkb
|
||||
744288 gdk_gl_context_set_required_version() handles version requests...
|
||||
744589 nautilus bookmarks changing places randomly
|
||||
745065 GtkPrintOperation dialog creation fails when GTK is locally loaded
|
||||
745463 Search suggestions are not shown in Clocks / Weather
|
||||
745479 Tracker search in file chooser causes a crash
|
||||
745562 gedit titlebar is no longer draggable
|
||||
745578 sincos is not portable
|
||||
745622 Selected text not highlighted in GtkInfoBar
|
||||
745721 wayland: Add support for gtk_window_set_modal
|
||||
745918 add padding to textview in CSS section of GtkInspector
|
||||
745969 CSD windows cannot be moved immediately after being resized
|
||||
746013 Invalid write of size 8
|
||||
Print dialog: Fix icons in HighContrast
|
||||
Fix selected menu items in HighContrast
|
||||
App chooser: Fix icons in HighContrast
|
||||
|
||||
* Translation updates:
|
||||
French
|
||||
Galician
|
||||
Kazakh
|
||||
Korean
|
||||
Lithuanian
|
||||
Polish
|
||||
Slovak
|
||||
Swedish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.15.10
|
||||
===================================
|
||||
|
||||
* GtkFileChooser:
|
||||
- Don't start search too eagerly
|
||||
- Use fts with tracker
|
||||
- Make tracker queries more similar to nautilus
|
||||
|
||||
GtkWindow:
|
||||
- Improve window dragging on header bars
|
||||
|
||||
* Printing:
|
||||
- Make avahi-browsed printers work
|
||||
- Set printer state correctly
|
||||
|
||||
* Wayland
|
||||
- Exit cleanly if the compositor goes away
|
||||
- Don't ignore early maximization/fullscreening
|
||||
- Make subsurface popovers work under Weston
|
||||
|
||||
* GL
|
||||
- Port GdkGears example to modern OpenGL
|
||||
|
||||
* Bugs fixed:
|
||||
741511 Critical message: NULL is passed to g_object_unref() in spi_...
|
||||
743323 avahi-discovered CUPS printers don't work
|
||||
743427 subsurface-using popovers don't work on Weston
|
||||
744879 Another core dump when clicking the Back button
|
||||
745225 eventcontroller: Don't crash if the widget is destroyed first
|
||||
745263 The Open button in the new file chooser is too low/thin
|
||||
745289 wayland: do not use g_error() on connection errors
|
||||
745303 Wayland: Initial setup window is not maximised
|
||||
745344 overlay scrollbar fail
|
||||
745400 fix a couple of issues in gdkglcontext-win32
|
||||
703610 Problems with UC-Logic WA60 tablet
|
||||
729366 Changes to folder name are not shown when creating new fol...
|
||||
745315 Overshoot deceleration causes WebKitGTK1 web view to jump ...
|
||||
|
||||
* Translation updates
|
||||
Afrikaans
|
||||
Czech
|
||||
French
|
||||
Greek
|
||||
Hebrew
|
||||
Hungarian
|
||||
Kazakh
|
||||
Lithuanian
|
||||
Polish
|
||||
Slovak
|
||||
Spanish
|
||||
Vietnamese
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.15.9
|
||||
==================================
|
||||
|
||||
* GtkScrolledWindow
|
||||
- Avoid 'jumping' when zoom scrolling kicks in
|
||||
- Make zoom scrolling less easy to trigger
|
||||
- Make steppers use smooth autoscrolling
|
||||
|
||||
* Input methods can now be turned off entirely, which
|
||||
can be useful to free up the Ctrl-Shift-u shortcut
|
||||
|
||||
* Add some DND support to gtk3-icon-browser
|
||||
|
||||
* Bugs fixed:
|
||||
696505 Segfault on Windows x64: gtkstatusicon.c tries to put 64-bit...
|
||||
744942 quartz: Avoid segfaulting when calling gdk_window_ensure_native
|
||||
744991 Fix loading of GResource SVGs
|
||||
745052 Icon theme code assumes directories with mtime 0 don't exist
|
||||
745076 Various DPI and OpenGL related fixes in the Wayland backend
|
||||
Fix crash and miscalculation in css bitmask manipulation
|
||||
Fix a crash due to too large surfaces
|
||||
|
||||
* Translation updates
|
||||
Chinese (Taiwan)
|
||||
Hebrew
|
||||
Hungarian
|
||||
Galician
|
||||
Greek
|
||||
Slovak
|
||||
Spanish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.15.8
|
||||
==================================
|
||||
|
||||
* CSS
|
||||
- Support animated font weight changes
|
||||
|
||||
* GtkScrolledWindow:
|
||||
- Ensure indicators appear in the correct place
|
||||
|
||||
* Wayland:
|
||||
- DND fixes
|
||||
|
||||
* GtkPopover:
|
||||
- has a map/unmap animation now
|
||||
|
||||
* Bugs fixed:
|
||||
743647 image-missing is missing from libgtk's resources
|
||||
744054 Clarify documentation for event propagation a...
|
||||
744683 Tooltips should have ATK_ROLE_TOOL_TIP (like ...
|
||||
|
||||
* Translation updates
|
||||
Galician
|
||||
Hebrew
|
||||
Hungarian
|
||||
Italian
|
||||
Norwegian bokmål
|
||||
Punjabi
|
||||
Slovenian
|
||||
Spanish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.15.7
|
||||
==================================
|
||||
|
||||
* GtkListBox now supports models with gtk_list_box_bind_model
|
||||
|
||||
* GtkNotebook has a new function to support tab dnd
|
||||
|
||||
* GtkSidebar was renamed to GtkStackSidebar to better convey what it does
|
||||
|
||||
* GtkFileChooser now has a location column for search
|
||||
|
||||
* GdkGLProfile has been removed
|
||||
|
||||
* Bugs
|
||||
695945 implement minimize / maximize functionality
|
||||
708320 listbox: Update the cursor row when the row's child gets focus
|
||||
741946 OpenGL context should allow for GL attribute selection
|
||||
743350 main: Make gtk_get_option_group() available to bindings
|
||||
744148 gtk: x: fix compilation without x11 backend
|
||||
744172 Wayland: Clients won't work on compositors that support wl_seat < 4
|
||||
744204 File chooser in gedit try to open directory instead of navigatin...
|
||||
744394 GtkGLArea documentation does not reflect changes in the api
|
||||
744400 Add specific CSS class for the close/minimize/maximize button
|
||||
744407 Can't support core 3.2 gl context on llvmpipe
|
||||
744455 wayland: Update to xdg-shell unstable v5
|
||||
|
||||
* Translation updates:
|
||||
Hungarian
|
||||
Norwegian bokmål
|
||||
Slovenian
|
||||
Spanish
|
||||
Turkish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.15.5
|
||||
==================================
|
||||
|
||||
* GTK+ types now support the GLib g_autoptr() facility for
|
||||
automatic cleanup of automatic variables. GTK+ itself does
|
||||
not use g_autoptr() internally.
|
||||
|
||||
* GtkSearchEntry has gained ::next-match, ::previous-match
|
||||
and ::stop-search signals and a gtk_search_entry_handle_event()
|
||||
function, which help in providing a richer search experience
|
||||
and make search entries usable outside of GtkSearchBar.
|
||||
|
||||
* GtkFileChooser:
|
||||
- The search has been reintegrated in the UI, there is now
|
||||
a toggle button on the header bar to go to search mode,
|
||||
in addition to the Alt-S shortcut.
|
||||
- The file chooser button now accepts files by drag-and-drop properly.
|
||||
|
||||
* GtkScrolledWindow has gained a new ::edge-reached signal, which
|
||||
triggers when the edge of the scrollable area is reached.
|
||||
|
||||
* CSS:
|
||||
- Performance improvements
|
||||
|
||||
* OpenGL:
|
||||
- It is now possible to specify the required GL version, as well
|
||||
as some other options (debug, forward compatible) when creating
|
||||
a GdkGLContext
|
||||
- Support for the OpenGL legacy profile has been dropped. Most examples
|
||||
have been updated, with the exception of gdkgears, which will be fixed
|
||||
in the next snapshot
|
||||
- Use shader version 1.50
|
||||
|
||||
* Mir backend: Many improvements
|
||||
|
||||
* Bugs fixed:
|
||||
712752 GtkClipboard: add _get_default and _get_primary
|
||||
725164 [crash] update_current_folder_get_info_cb at gtkfilechooserwidget.c
|
||||
732051 Crash can result if a child widget is destroyed while its tab is...
|
||||
735316 Default font antialiasing results in wrong behavior on OS X
|
||||
740336 Wrong (white) background colour in notes grid
|
||||
740613 XConvertSelection crashes Gtk+ apps
|
||||
742636 Freeze if window closed while resume-events pending
|
||||
742953 GdkGLContext will not create a core context
|
||||
743146 Crash in gdk_gl_texture_from_surface() when a GtkGLArea is packe...
|
||||
743193 Fix transfer annotation for tree_model parameter of gtk_tree_get...
|
||||
743229 clipboard: support selection notification on wayland
|
||||
743257 Popover not dismissed on clicking the header bar
|
||||
743286 Mention that the path returned by gtk_tree_row_reference_get_pat...
|
||||
743330 Wintab initialization glitches
|
||||
743341 GtkImage does not correctly reflect icon theme changes.
|
||||
743393 DND icons don't work in the inspector
|
||||
743422 valgrind: Conditional jump or move depends on uninitialised valu...
|
||||
743451 Drag and drop on GtkFileChooserButton doesn't work
|
||||
743592 crash on link click in about dialogue
|
||||
743593 GtkWidget's va_marshaller for "event-after" signal is incorrect
|
||||
743633 gdkscreen-wayland: Don't leak wl_output objects
|
||||
743638 getting-started: Update example-0.c to use GtkApplication
|
||||
743647 image-missing is missing from libgtk's resources
|
||||
743659 All folders hidden after returning from search mode in GtkFileCh...
|
||||
743660 Pressing Ctrl should not start a search in the file chooser
|
||||
743680 getting-started: update Basics section to correspond to example-...
|
||||
613833 Unnecessary queue_resize() for GtkImage
|
||||
741946 OpenGL context should allow for GL attribute selection
|
||||
742566 Bitfield structure members used for booleans
|
||||
742848 scrolledwindow: should emit edge-overshot when scrollbar reaches end
|
||||
743395 Regression in gnome-terminal starting with gtk commit 27285f1 ' ...
|
||||
743640 add __attribute__((cleanup)) support
|
||||
743770 Memory leak in plugman example
|
||||
743894 don't trigger interactive overlay scrollbar when drag-selecting
|
||||
743917 Gtk modules must be compatible with both gtk 2 and 3
|
||||
743975 Better deprecation information for GtkStatusIcon
|
||||
744203 gdkgl shaders use depricated GLSL version
|
||||
744212 gdk_gl_context_set_required_version() interprets requests for 4...
|
||||
|
||||
* Translation updates:
|
||||
Hebrew
|
||||
Hungarian
|
||||
Icelandic
|
||||
Lithuanian
|
||||
Norwegian bokmål
|
||||
Russian
|
||||
Slovak
|
||||
Spanish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.15.4
|
||||
==================================
|
||||
|
||||
* GtkTextView
|
||||
- Allow to customize multi-click behaviors, using the new
|
||||
::extend-selection signal
|
||||
- Selection can now be extended by scrolling
|
||||
- Better behavior and appearance for text selection with touch
|
||||
|
||||
* GtkApplication:
|
||||
- Use app menu fallback with ssh connections
|
||||
- Provide a mechanism to hide unnecessary app menu items
|
||||
on OS X, so a single menu file can be used across platforms
|
||||
|
||||
* GtkCalendar:
|
||||
- Show other months in a different color under Adwaita again
|
||||
- Ensure we always show a bit of the other month on both ends
|
||||
|
||||
* GtkScrolledWindow
|
||||
- Make overlay scrollbars more dynamic
|
||||
|
||||
* GtkFileChooser:
|
||||
- Make bookmark DND insert at the right location
|
||||
- Make '~' and '/' work in recent mode
|
||||
- Make Ctrl-L work in recent mode
|
||||
- Re-integrate search
|
||||
|
||||
* CSS:
|
||||
- Introduce immutable style nodes
|
||||
- Performance improvements
|
||||
- Reduced memory consumption
|
||||
|
||||
* GtkInspector:
|
||||
- Add a magnifier for the selected widget
|
||||
- Show more display information
|
||||
- Show memory address of objects
|
||||
|
||||
* Wayland:
|
||||
- Use subsurfaces for popovers, so popovers can extend beyond the
|
||||
window boundaries
|
||||
- Prefer the Wayland backend over X11 if both are available
|
||||
|
||||
* GL:
|
||||
- Fix interaction with hi-dpi
|
||||
- Add OpenGL support to the Windows backend
|
||||
|
||||
* Bugs:
|
||||
111503 Customization of text selection bounds on double click
|
||||
301835 should the calendar start on the 1st of month?
|
||||
477454 libgtk crashed in gtk_notebook_button_release
|
||||
671802 no menu fallback with ssh -X or sudo
|
||||
671895 gtk_print_context_get_hard_margins needs to take into account page...
|
||||
674537 GtkMenuPositionFunc: x and y should be "inout"
|
||||
705582 gtk_recent_manager_init fails to check settings==NULL
|
||||
710612 [PATCH] Allow to extend selection with mouse scrollwheel
|
||||
738338 quartz: NSWindow NULL check in get_scale_factor
|
||||
738891 Use GDK_WINDOW_SUBSURFACE for popovers
|
||||
739038 gtk_recent_manager_set_filename: assertion failed: (priv->filename...
|
||||
740758 Add getters for device vendor/product IDs
|
||||
740795 GDK: Add OpenGL Support for Windows
|
||||
741259 gtkmodelmenuitem: force icon scaling
|
||||
741569 Minor theme bug: square progress bars
|
||||
741610 Finish up support for macos menubar
|
||||
741652 Leaking menus when attaching to a button
|
||||
741702 Right margin not respected with RTL text in non-wrapping mode only
|
||||
741827 typo in testsuite/reftests/Makefile.am causes build failure on Min...
|
||||
741897 documentation fix
|
||||
741969 GTK_STOCK_COPY
|
||||
742010 GtkLabel eats thumb-button clicks
|
||||
742170 cut/copy/paste binding entries are registered 2x
|
||||
742181 "show images in menus" causes weird padding outside GNOME
|
||||
742243 GtkScrolledWindow draws overshoot at the wrong position
|
||||
742311 On cellrenderertext, notify for "size" and "size-points" propertie...
|
||||
742343 Hide scrollbar in GtkFileChooser if appropriate
|
||||
742518 object overview should include the pointer to the object in memory
|
||||
742631 Left padding on File Chooser List
|
||||
742653 gtkfilechooserwidget: When using an extra widget, show or hide the...
|
||||
742664 Portabilitiy issues with GTK-Inspector 32-bit and non-gnome3 desktop
|
||||
742702 GtkTreeView separator has wrong color if not active
|
||||
742704 GtkComboBox: Separators not visible with Adwaita
|
||||
742727 nautilus adding bookmark by dragging appear always at top
|
||||
742764 Fix check for 'y' padding in gtk_cell_renderer_set_padding()
|
||||
742771 Properly ignore BadWindow and BadDrawable in get_child_info_handler()
|
||||
742774 Properly check result of g_utf8_get_char_validated()
|
||||
742778 Fix accessible_class->widget_set initialization
|
||||
742785 Fix event->button.y_root when using mouse buttons and dnd canceled
|
||||
742786 Fix save_hot_y init in gtk_drag_get_icon()
|
||||
742940 Adjust annotations of gtk_status_icon_position_menu to match GtkMe...
|
||||
742980 cannot start broadway on FreeBSD
|
||||
743037 Typo in gdk_window_get_root_coords documentation
|
||||
743101 commit 77b876fa breaks zathura
|
||||
743117 / and ~ Don't work in filechooser's recent mode
|
||||
743157 gtk3-demo editable cells treeview problem
|
||||
742646 DnD images not shown
|
||||
|
||||
* Translation updates:
|
||||
Basque
|
||||
British English
|
||||
Czech
|
||||
Galician
|
||||
German
|
||||
Greek
|
||||
Hebrew
|
||||
Hungarian
|
||||
Icelandic
|
||||
Lithuanian
|
||||
Russian
|
||||
Spanish
|
||||
Vietnamese
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.15.3
|
||||
==================================
|
||||
|
||||
|
||||
@@ -99,11 +99,6 @@ Release notes for 3.16
|
||||
has non-scrolling parts similar to treeview headers, there is no need
|
||||
to implement this vfunc.
|
||||
|
||||
* The GtkSearchEntry widget has gained a number of new signal that
|
||||
are emitted when certain key sequences are seen. In particular, it
|
||||
now handles the Escape key and emits ::stop-search. Applications that
|
||||
expect to handle Escape themselves will need to be updated.
|
||||
|
||||
Release notes for 3.14
|
||||
======================
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ Please refer to the following GNOME Live! page for a more detailed ouline
|
||||
on the process of building the GTK+ stack and its dependencies with Visual
|
||||
C++:
|
||||
|
||||
https://wiki.gnome.org/Projects/GTK+/Win32/MSVCCompilationOfGTKStack
|
||||
https://live.gnome.org/GTK%2B/Win32/MSVCCompilationOfGTKStack
|
||||
|
||||
Alternative 1 also generates Microsoft import libraries (.lib), if you
|
||||
have lib.exe available. It might also work for cross-compilation from
|
||||
|
||||
@@ -24,7 +24,7 @@ EXTRA_DIST += \
|
||||
gtk3-icon-browser.vcxproj.filters \
|
||||
gailutil.vcxproj \
|
||||
gailutil.vcxproj.filters \
|
||||
gtk-install.vcxproj \
|
||||
install.vcxproj \
|
||||
broadwayd.vcxproj \
|
||||
broadwayd.vcxproj.filters \
|
||||
gdk-broadway.vcxproj \
|
||||
|
||||
@@ -5,7 +5,7 @@ the use of the library.
|
||||
A more detailed outline for instructions on building the GTK+ with Visual
|
||||
C++ can be found in the following GNOME Live! page:
|
||||
|
||||
https://wiki.gnome.org/Projects/GTK+/Win32/MSVCCompilationOfGTKStack
|
||||
https://live.gnome.org/GTK%2B/Win32/MSVCCompilationOfGTKStack
|
||||
|
||||
This VS10 solution and the projects it includes are intented to be used
|
||||
in a GTK+ source tree unpacked from a tarball. In a git checkout you
|
||||
|
||||
@@ -89,7 +89,6 @@
|
||||
<AdditionalDependencies>atk-1.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
@@ -114,7 +113,6 @@
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
@@ -137,7 +135,6 @@
|
||||
<AdditionalDependencies>atk-1.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
@@ -161,7 +158,6 @@
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
|
||||
@@ -147,7 +147,6 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
@@ -170,7 +169,6 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
@@ -190,7 +188,6 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
@@ -212,7 +209,6 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
@@ -237,7 +233,6 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
@@ -260,7 +255,6 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
@@ -280,7 +274,6 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
@@ -302,7 +295,6 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
|
||||
@@ -22,7 +22,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtk-encode-symbolic-svg", "
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gailutil", "gailutil.vcxproj", "{29E3E814-1BA3-4AD7-A3A7-3669CB80A942}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtk-install", "gtk-install.vcxproj", "{2093D218-190E-4194-9421-3BA7CBF33B15}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "install", "install.vcxproj", "{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -156,22 +156,22 @@ Global
|
||||
{29E3E814-1BA3-4AD7-A3A7-3669CB80A942}.Release_Broadway|Win32.Build.0 = Release|Win32
|
||||
{29E3E814-1BA3-4AD7-A3A7-3669CB80A942}.Release_Broadway|x64.ActiveCfg = Release|x64
|
||||
{29E3E814-1BA3-4AD7-A3A7-3669CB80A942}.Release_Broadway|x64.Build.0 = Release|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|x64.Build.0 = Debug|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|Win32.Build.0 = Release|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|x64.ActiveCfg = Release|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|x64.Build.0 = Release|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|Win32.ActiveCfg = Debug_Broadway|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|Win32.Build.0 = Debug_Broadway|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|x64.ActiveCfg = Debug_Broadway|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|x64.Build.0 = Debug_Broadway|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|Win32.ActiveCfg = Release_Broadway|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|Win32.Build.0 = Release_Broadway|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|x64.ActiveCfg = Release_Broadway|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|x64.Build.0 = Release_Broadway|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.Build.0 = Debug|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.Build.0 = Release|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.ActiveCfg = Release|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.Build.0 = Release|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|Win32.ActiveCfg = Debug_Broadway|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|Win32.Build.0 = Debug_Broadway|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|x64.ActiveCfg = Debug_Broadway|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|x64.Build.0 = Debug_Broadway|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|Win32.ActiveCfg = Release_Broadway|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|Win32.Build.0 = Release_Broadway|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|x64.ActiveCfg = Release_Broadway|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|x64.Build.0 = Release_Broadway|x64
|
||||
{3281202A-CD26-4C67-B892-EB34BDBC612F}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{3281202A-CD26-4C67-B892-EB34BDBC612F}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{3281202A-CD26-4C67-B892-EB34BDBC612F}.Debug|x64.ActiveCfg = Debug|x64
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
<AdditionalIncludeDirectories>..\..\..;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\include;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\atk-1.0;$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\gdk-pixbuf-2.0;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>HAVE_CONFIG_H;G_DISABLE_SINGLE_INCLUDES;ATK_DISABLE_SINGLE_INCLUDES;GDK_PIXBUF_DISABLE_SINGLE_INCLUDES;GTK_DISABLE_SINGLE_INCLUDES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedIncludeFiles>msvc_recommended_pragmas.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalOptions>/d2Zi+ %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>pangocairo-1.0.lib;cairo.lib;cairo-gobject.lib;pango-1.0.lib;gdk_pixbuf-2.0.lib;gio-2.0.lib;gmodule-2.0.lib;gobject-2.0.lib;glib-2.0.lib;intl.lib;epoxy.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
|
||||
@@ -11,69 +11,26 @@
|
||||
<GtkDoInstallBin>
|
||||
mkdir $(CopyDir)\bin
|
||||
mkdir $(CopyDir)\lib
|
||||
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll" $(CopyDir)\bin
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gdk$(GtkDllSuffix).pdb" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gdk-$(ApiVersion).lib" $(CopyDir)\lib
|
||||
|
||||
if "$(Configuration)" == "Release_Broadway" goto DO_BROADWAY_BIN
|
||||
if "$(Configuration)" == "Debug_Broadway" goto DO_BROADWAY_BIN
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll" $(CopyDir)\bin
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb" $(CopyDir)\bin
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll" $(CopyDir)\bin
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gailutil$(GtkDllSuffix).pdb" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk-$(ApiVersion).lib" $(CopyDir)\lib
|
||||
copy "$(BinDir)\gailutil-$(ApiVersion).lib" $(CopyDir)\lib
|
||||
copy "$(BinDir)\gtk3-demo.exe" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk3-demo.pdb" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk3-demo-application.exe" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk3-demo-application.pdb" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk3-icon-browser.exe" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk3-icon-browser.pdb" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk-encode-symbolic-svg.exe" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk-encode-symbolic-svg.pdb" $(CopyDir)\bin
|
||||
copy "$(BinDir)\*.dll" $(CopyDir)\bin
|
||||
copy "$(BinDir)\*-$(ApiVersion).lib" $(CopyDir)\lib
|
||||
copy "$(BinDir)\*.exe" $(CopyDir)\bin
|
||||
goto DONE_BIN
|
||||
|
||||
:DO_BROADWAY_BIN
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gdk-$(ApiVersion).lib" $(CopyDir)\lib
|
||||
copy "$(BinDir)\broadwayd.exe" $(CopyDir)\bin
|
||||
copy "$(BinDir)\broadwayd.pdb" $(CopyDir)\bin
|
||||
|
||||
if "$(Configuration)" == "Release_Broadway" goto DO_BROADWAY_RELEASE
|
||||
if "$(Configuration)" == "Debug_Broadway" goto DO_BROADWAY_DEBUG
|
||||
:DO_BROADWAY_RELEASE
|
||||
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).pdb $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib
|
||||
copy .\Release\$(Platform)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib
|
||||
copy .\Release\$(Platform)\bin\gtk3-demo.exe $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk3-demo.pdb $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk3-demo-application.exe $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk3-demo-application.pdb $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk3-icon-browser.exe $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin
|
||||
|
||||
goto DONE_BIN
|
||||
|
||||
:DO_BROADWAY_DEBUG
|
||||
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).pdb $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib
|
||||
copy .\Debug\$(Platform)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib
|
||||
copy .\Debug\$(Platform)\bin\gtk3-demo.exe $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk3-demo.pdb $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk3-demo-application.exe $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk3-demo-application.pdb $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk3-icon-browser.exe $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin
|
||||
|
||||
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib
|
||||
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib
|
||||
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\*.exe $(CopyDir)\bin
|
||||
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib
|
||||
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib
|
||||
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\*.exe $(CopyDir)\bin
|
||||
:DONE_BIN
|
||||
</GtkDoInstallBin>
|
||||
<GtkDoInstall>
|
||||
@@ -86,7 +43,6 @@ mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y
|
||||
mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gtk\deprecated
|
||||
copy ..\..\..\gdk\win32\gdkwin32.h $(CopyDir)\include\gtk-$(ApiVersion)\gdk
|
||||
copy ..\..\..\gdk\gdk.h $(CopyDir)\include\gtk-3.0\gdk\gdk.h
|
||||
copy ..\..\..\gdk\gdk-autocleanup.h $(CopyDir)\include\gtk-3.0\gdk\gdk-autocleanup.h
|
||||
copy ..\..\..\gdk\gdkapplaunchcontext.h $(CopyDir)\include\gtk-3.0\gdk\gdkapplaunchcontext.h
|
||||
copy ..\..\..\gdk\gdkcairo.h $(CopyDir)\include\gtk-3.0\gdk\gdkcairo.h
|
||||
copy ..\..\..\gdk\gdkcursor.h $(CopyDir)\include\gtk-3.0\gdk\gdkcursor.h
|
||||
@@ -130,9 +86,7 @@ copy ..\..\..\gdk\win32\gdkwin32misc.h $(CopyDir)\include\gtk-3.0\gdk\win32\gdkw
|
||||
copy ..\..\..\gdk\win32\gdkwin32screen.h $(CopyDir)\include\gtk-3.0\gdk\win32\gdkwin32screen.h
|
||||
copy ..\..\..\gdk\win32\gdkwin32window.h $(CopyDir)\include\gtk-3.0\gdk\win32\gdkwin32window.h
|
||||
copy ..\..\..\gtk\gtk.h $(CopyDir)\include\gtk-3.0\gtk\gtk.h
|
||||
copy ..\..\..\gtk\gtk-autocleanups.h $(CopyDir)\include\gtk-3.0\gtk\gtk-autocleanups.h
|
||||
copy ..\..\..\gtk\gtkx.h $(CopyDir)\include\gtk-3.0\gtk\gtkx.h
|
||||
copy ..\..\..\gtk\gtkx-autocleanups.h $(CopyDir)\include\gtk-3.0\gtk\gtkx-autocleanups.h
|
||||
copy ..\..\..\gtk\gtk-a11y.h $(CopyDir)\include\gtk-3.0\gtk\gtk-a11y.h
|
||||
copy ..\..\..\gtk\gtkaboutdialog.h $(CopyDir)\include\gtk-3.0\gtk\gtkaboutdialog.h
|
||||
copy ..\..\..\gtk\gtkaccelgroup.h $(CopyDir)\include\gtk-3.0\gtk\gtkaccelgroup.h
|
||||
@@ -343,7 +297,6 @@ copy ..\..\..\gtk\gtkwindowgroup.h $(CopyDir)\include\gtk-3.0\gtk\gtkwindowgroup
|
||||
copy ..\..\..\gtk\gtktextlayout.h $(CopyDir)\include\gtk-3.0\gtk\gtktextlayout.h
|
||||
copy ..\..\..\gtk\gtktypebuiltins.h $(CopyDir)\include\gtk-3.0\gtk\gtktypebuiltins.h
|
||||
copy ..\..\..\gtk\gtkversion.h $(CopyDir)\include\gtk-3.0\gtk\gtkversion.h
|
||||
copy ..\..\..\gtk\a11y\gtk-a11y-autocleanups.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtk-a11y-autocleanups.h
|
||||
copy ..\..\..\gtk\a11y\gtkarrowaccessible.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtkarrowaccessible.h
|
||||
copy ..\..\..\gtk\a11y\gtkbooleancellaccessible.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtkbooleancellaccessible.h
|
||||
copy ..\..\..\gtk\a11y\gtkbuttonaccessible.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtkbuttonaccessible.h
|
||||
|
||||
@@ -89,7 +89,6 @@
|
||||
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
@@ -109,7 +108,6 @@
|
||||
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
@@ -134,7 +132,6 @@
|
||||
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
@@ -154,7 +151,6 @@
|
||||
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
|
||||
@@ -161,7 +161,6 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\iconbrowserapp.c" />
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\iconbrowserwin.c" />
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\iconstore.c" />
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\main.c" />
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\resources.c" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\iconbrowserapp.c"><Filter>Sources</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\iconbrowserwin.c"><Filter>Sources</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\iconstore.c"><Filter>Sources</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\main.c"><Filter>Sources</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\resources.c"><Filter>Sources</Filter></ClCompile>
|
||||
</ItemGroup>
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{2093D218-190E-4194-9421-3BA7CBF33B15}</ProjectGuid>
|
||||
<RootNamespace>gtkinstall</RootNamespace>
|
||||
<ProjectGuid>{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}</ProjectGuid>
|
||||
<RootNamespace>install</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
@@ -219,4 +219,4 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
@@ -20,7 +20,7 @@ EXTRA_DIST += \
|
||||
gtk3-icon-browser.vcxproj.filters \
|
||||
gailutil.vcxproj \
|
||||
gailutil.vcxproj.filters \
|
||||
gtk-install.vcxproj \
|
||||
install.vcxproj \
|
||||
broadwayd.vcxproj \
|
||||
broadwayd.vcxproj.filters \
|
||||
gdk-broadway.vcxproj \
|
||||
|
||||
@@ -20,7 +20,7 @@ EXTRA_DIST += \
|
||||
gtk3-icon-browser.vcxproj.filters \
|
||||
gailutil.vcxproj \
|
||||
gailutil.vcxproj.filters \
|
||||
gtk-install.vcxproj \
|
||||
install.vcxproj \
|
||||
broadwayd.vcxproj \
|
||||
broadwayd.vcxproj.filters \
|
||||
gdk-broadway.vcxproj \
|
||||
|
||||
@@ -14,7 +14,7 @@ EXTRA_DIST += \
|
||||
gtk3-demo-application.vcproj \
|
||||
gtk3-icon-browser.vcproj \
|
||||
gailutil.vcproj \
|
||||
gtk-install.vcproj \
|
||||
install.vcproj \
|
||||
broadwayd.vcproj \
|
||||
gdk-broadway.vcproj \
|
||||
gtk-build-defines.vsprops \
|
||||
|
||||
@@ -5,7 +5,7 @@ the use of the library.
|
||||
A more detailed outline for instructions on building the GTK+ with Visual
|
||||
C++ can be found in the following GNOME Live! page:
|
||||
|
||||
https://wiki.gnome.org/Projects/GTK+/Win32/MSVCCompilationOfGTKStack
|
||||
https://live.gnome.org/GTK%2B/Win32/MSVCCompilationOfGTKStack
|
||||
|
||||
This VS9 solution and the projects it includes are intented to be used
|
||||
in a GTK+ source tree unpacked from a tarball. In a git checkout you
|
||||
|
||||
@@ -57,7 +57,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gailutil", "gailutil.vcproj
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5} = {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtk-install", "gtk-install.vcproj", "{2093D218-190E-4194-9421-3BA7CBF33B15}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "install", "install.vcproj", "{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F7} = {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F7}
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5} = {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}
|
||||
@@ -161,22 +161,22 @@ Global
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}.Release_Broadway|Win32.Build.0 = Release|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}.Release_Broadway|x64.ActiveCfg = Release|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}.Release_Broadway|x64.Build.0 = Release|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|x64.Build.0 = Debug|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|Win32.Build.0 = Release|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|x64.ActiveCfg = Release|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|x64.Build.0 = Release|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|Win32.ActiveCfg = Debug_Broadway|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|Win32.Build.0 = Debug_Broadway|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|x64.ActiveCfg = Debug_Broadway|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|x64.Build.0 = Debug_Broadway|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|Win32.ActiveCfg = Release_Broadway|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|Win32.Build.0 = Release_Broadway|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|x64.ActiveCfg = Release_Broadway|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|x64.Build.0 = Release_Broadway|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.Build.0 = Debug|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.Build.0 = Release|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.ActiveCfg = Release|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.Build.0 = Release|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|Win32.ActiveCfg = Debug_Broadway|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|Win32.Build.0 = Debug_Broadway|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|x64.ActiveCfg = Debug_Broadway|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|x64.Build.0 = Debug_Broadway|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|Win32.ActiveCfg = Release_Broadway|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|Win32.Build.0 = Release_Broadway|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|x64.ActiveCfg = Release_Broadway|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|x64.Build.0 = Release_Broadway|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FC}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FC}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FC}.Debug|x64.ActiveCfg = Debug|x64
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
AdditionalIncludeDirectories="..\..\..;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\include;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\atk-1.0;$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\gdk-pixbuf-2.0"
|
||||
PreprocessorDefinitions="HAVE_CONFIG_H;G_DISABLE_SINGLE_INCLUDES;ATK_DISABLE_SINGLE_INCLUDES;GDK_PIXBUF_DISABLE_SINGLE_INCLUDES;GTK_DISABLE_SINGLE_INCLUDES"
|
||||
ForcedIncludeFiles="msvc_recommended_pragmas.h"
|
||||
AdditionalOptions="/MP"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
|
||||
@@ -10,63 +10,26 @@
|
||||
Value="
|
||||
mkdir $(CopyDir)\bin

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

|
||||
|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gdk$(GtkDllSuffix).pdb $(CopyDir)\bin

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

|
||||
|
||||
if "$(ConfigurationName)" == "Release_Broadway" goto DO_BROADWAY_BIN

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" goto DO_BROADWAY_BIN

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).pdb $(CopyDir)\bin

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

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

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

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

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

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-demo-application.pdb $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-icon-browser.exe $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin

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

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

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

|
||||
goto DONE_BIN

|
||||
|
||||
:DO_BROADWAY_BIN

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll $(CopyDir)\bin

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

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

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\broadwayd.pdb $(CopyDir)\bin

|
||||
|
||||
if "$(ConfigurationName)" == "Release_Broadway" goto DO_BROADWAY_RELEASE

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" goto DO_BROADWAY_DEBUG

|
||||
:DO_BROADWAY_RELEASE

|
||||
copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib

|
||||
copy .\Release\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib

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

|
||||
copy .\Release\$(PlatformName)\bin\gtk3-demo.pdb $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk3-demo-application.exe $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk3-demo-application.pdb $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk3-icon-browser.exe $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin

|
||||
goto DONE_BIN

|
||||
|
||||
:DO_BROADWAY_DEBUG

|
||||
copy .\Debug\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib

|
||||
copy .\Debug\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib

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

|
||||
copy .\Debug\$(PlatformName)\bin\gtk3-demo.pdb $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk3-demo-application.exe $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk3-demo-application.pdb $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk3-icon-browser.exe $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin

|
||||
if "$(ConfigurationName)" == "Release_Broadway" copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
if "$(ConfigurationName)" == "Release_Broadway" copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
if "$(ConfigurationName)" == "Release_Broadway" copy .\Release\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib

|
||||
if "$(ConfigurationName)" == "Release_Broadway" copy .\Release\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib

|
||||
if "$(ConfigurationName)" == "Release_Broadway" copy .\Release\$(PlatformName)\bin\*.exe $(CopyDir)\bin

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" copy .\Debug\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" copy .\Debug\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" copy .\Debug\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" copy .\Debug\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" copy .\Debug\$(PlatformName)\bin\*.exe $(CopyDir)\bin

|
||||
:DONE_BIN

|
||||
"
|
||||
/>
|
||||
@@ -82,7 +45,6 @@ mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y

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

|
||||
copy ..\..\..\gdk\win32\gdkwin32.h $(CopyDir)\include\gtk-$(ApiVersion)\gdk

|
||||
copy ..\..\..\gdk\gdk.h $(CopyDir)\include\gtk-3.0\gdk\gdk.h

|
||||
copy ..\..\..\gdk\gdk-autocleanup.h $(CopyDir)\include\gtk-3.0\gdk\gdk-autocleanup.h

|
||||
copy ..\..\..\gdk\gdkapplaunchcontext.h $(CopyDir)\include\gtk-3.0\gdk\gdkapplaunchcontext.h

|
||||
copy ..\..\..\gdk\gdkcairo.h $(CopyDir)\include\gtk-3.0\gdk\gdkcairo.h

|
||||
copy ..\..\..\gdk\gdkcursor.h $(CopyDir)\include\gtk-3.0\gdk\gdkcursor.h

|
||||
@@ -126,9 +88,7 @@ copy ..\..\..\gdk\win32\gdkwin32misc.h $(CopyDir)\include\gtk-3.0\gdk\win32\gdkw
|
||||
copy ..\..\..\gdk\win32\gdkwin32screen.h $(CopyDir)\include\gtk-3.0\gdk\win32\gdkwin32screen.h

|
||||
copy ..\..\..\gdk\win32\gdkwin32window.h $(CopyDir)\include\gtk-3.0\gdk\win32\gdkwin32window.h

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

|
||||
copy ..\..\..\gtk\gtk-autocleanups.h $(CopyDir)\include\gtk-3.0\gtk\gtk-autocleanups.h

|
||||
copy ..\..\..\gtk\gtkx.h $(CopyDir)\include\gtk-3.0\gtk\gtkx.h

|
||||
copy ..\..\..\gtk\gtkx-autocleanups.h $(CopyDir)\include\gtk-3.0\gtk\gtkx-autocleanups.h

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

|
||||
copy ..\..\..\gtk\gtkaboutdialog.h $(CopyDir)\include\gtk-3.0\gtk\gtkaboutdialog.h

|
||||
copy ..\..\..\gtk\gtkaccelgroup.h $(CopyDir)\include\gtk-3.0\gtk\gtkaccelgroup.h

|
||||
@@ -339,7 +299,6 @@ copy ..\..\..\gtk\gtkwindowgroup.h $(CopyDir)\include\gtk-3.0\gtk\gtkwindowgroup
|
||||
copy ..\..\..\gtk\gtktextlayout.h $(CopyDir)\include\gtk-3.0\gtk\gtktextlayout.h

|
||||
copy ..\..\..\gtk\gtktypebuiltins.h $(CopyDir)\include\gtk-3.0\gtk\gtktypebuiltins.h

|
||||
copy ..\..\..\gtk\gtkversion.h $(CopyDir)\include\gtk-3.0\gtk\gtkversion.h

|
||||
copy ..\..\..\gtk\a11y\gtk-a11y-autocleanups.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtk-a11y-autocleanups.h

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

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

|
||||
copy ..\..\..\gtk\a11y\gtkbuttonaccessible.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtkbuttonaccessible.h

|
||||
|
||||
@@ -158,7 +158,6 @@
|
||||
>
|
||||
<File RelativePath="..\..\..\demos\icon-browser\iconbrowserapp.c" />
|
||||
<File RelativePath="..\..\..\demos\icon-browser\iconbrowserwin.c" />
|
||||
<File RelativePath="..\..\..\demos\icon-browser\iconstore.c" />
|
||||
<File RelativePath="..\..\..\demos\icon-browser\main.c" />
|
||||
<File RelativePath="..\..\..\demos\icon-browser\resources.c" />
|
||||
</Filter>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="gtk-install"
|
||||
ProjectGUID="{2093D218-190E-4194-9421-3BA7CBF33B15}"
|
||||
RootNamespace="gtkinstall"
|
||||
Name="install"
|
||||
ProjectGUID="{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}"
|
||||
RootNamespace="install"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="131072"
|
||||
>
|
||||
@@ -141,9 +141,6 @@
|
||||
#define HAVE_ROUND 1
|
||||
#endif
|
||||
|
||||
/* Define to 1 if sincos() is available */
|
||||
/* #undef HAVE_SINCOS */
|
||||
|
||||
/* Have the sockaddr_un.sun_len member */
|
||||
/* #undef HAVE_SOCKADDR_UN_SUN_LEN */
|
||||
|
||||
|
||||
48
configure.ac
48
configure.ac
@@ -10,7 +10,7 @@
|
||||
|
||||
m4_define([gtk_major_version], [3])
|
||||
m4_define([gtk_minor_version], [15])
|
||||
m4_define([gtk_micro_version], [12])
|
||||
m4_define([gtk_micro_version], [3])
|
||||
m4_define([gtk_interface_age], [0])
|
||||
m4_define([gtk_binary_age],
|
||||
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
|
||||
@@ -41,14 +41,14 @@ AC_CANONICAL_HOST
|
||||
m4_define([gtk_binary_version], [3.0.0])
|
||||
|
||||
# required versions of other packages
|
||||
m4_define([glib_required_version], [2.43.4])
|
||||
m4_define([glib_required_version], [2.43.0])
|
||||
m4_define([pango_required_version], [1.36.7])
|
||||
m4_define([atk_required_version], [2.15.1])
|
||||
m4_define([cairo_required_version], [1.14.0])
|
||||
m4_define([gdk_pixbuf_required_version], [2.30.0])
|
||||
m4_define([introspection_required_version], [1.39.0])
|
||||
m4_define([wayland_required_version], [1.5.91])
|
||||
m4_define([mirclient_required_version], [0.11.0])
|
||||
m4_define([mirclient_required_version], [0.9.0])
|
||||
m4_define([epoxy_required_version], [1.0])
|
||||
GLIB_REQUIRED_VERSION=glib_required_version
|
||||
PANGO_REQUIRED_VERSION=pango_required_version
|
||||
@@ -147,6 +147,7 @@ AC_PROG_MKDIR_P
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_MAKE_SET
|
||||
|
||||
|
||||
GETTEXT_PACKAGE=gtk30
|
||||
AC_SUBST(GETTEXT_PACKAGE)
|
||||
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
|
||||
@@ -500,6 +501,11 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
AC_DEFINE_UNQUOTED(GTK_COMPILED_WITH_DEBUGGING, "${enable_debug}",
|
||||
[Define if debugging is enabled])
|
||||
|
||||
|
||||
# Build time sanity check...
|
||||
AM_SANITY_CHECK
|
||||
|
||||
@@ -665,15 +671,6 @@ fi
|
||||
# i18n stuff
|
||||
ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`"
|
||||
AM_GLIB_GNU_GETTEXT
|
||||
|
||||
AC_MSG_CHECKING([whether xgettext supports ui files])
|
||||
if $ac_cv_path_XGETTEXT --output=- --language=Glade $srcdir/gtk/ui/gtkfilechooserwidget.ui > /dev/null 2>&1; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([GNU gettext 0.18.3 or newer is required])
|
||||
fi
|
||||
|
||||
LIBS="$LIBS $INTLLIBS"
|
||||
AC_CONFIG_COMMANDS([po-properties],
|
||||
[[case "$CONFIG_FILES" in *po-properties/Makefile.in*)
|
||||
@@ -826,7 +823,7 @@ AC_TYPE_UID_T
|
||||
|
||||
# Check for round(), rint(), isnan(), isinf() and nearbyint()
|
||||
AC_CHECK_LIB(m,round,,)
|
||||
AC_CHECK_FUNCS(round rint nearbyint sincos)
|
||||
AC_CHECK_FUNCS(round rint nearbyint)
|
||||
AC_CHECK_DECLS([isnan, isinf], [], [], [[#include <math.h>]])
|
||||
|
||||
# Checks for gdkspawn
|
||||
@@ -1031,16 +1028,22 @@ if test "x$enable_x11_backend" = xyes; then
|
||||
AC_CHECK_FUNC(XextFindDisplay, :,
|
||||
AC_MSG_ERROR([*** libX11 and libXext not found. Check 'config.log' for more details.]))
|
||||
|
||||
# Check if <X11/extensions/XIproto.h> is needed for xReply.
|
||||
# Check for xReply
|
||||
|
||||
AC_CHECK_TYPE([xReply], ,
|
||||
[AC_CHECK_TYPE([xReply],
|
||||
[AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], 1,
|
||||
[Define if <X11/extensions/XIproto.h> needed for xReply])],
|
||||
[AC_MSG_ERROR([xReply type unavailable. X11 is too old])],
|
||||
[[#include <X11/extensions/XIproto.h>
|
||||
#include <X11/Xlibint.h>]])],
|
||||
[[#include <X11/Xlibint.h>]])
|
||||
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;]])],
|
||||
[AC_MSG_RESULT([no])],
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/XIproto.h>
|
||||
#include <X11/Xlibint.h>]],
|
||||
[[xReply *rep = NULL;
|
||||
rep = rep;]])],
|
||||
[AC_MSG_RESULT([yes])
|
||||
AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], [1],
|
||||
[Define if <X11/extensions/XIproto.h> needed for xReply])],
|
||||
[AC_MSG_RESULT([unknown])
|
||||
AC_MSG_ERROR([xReply type unavailable. X11 is too old])])])
|
||||
|
||||
# Check for XKB support.
|
||||
|
||||
@@ -1908,6 +1911,7 @@ gtk/makefile.msc
|
||||
gtk/gtkversion.h
|
||||
gtk/gtk-win32.rc
|
||||
gtk/libgtk3.manifest
|
||||
util/Makefile
|
||||
libgail-util/Makefile
|
||||
modules/Makefile
|
||||
modules/input/Makefile
|
||||
|
||||
@@ -136,8 +136,6 @@ RESOURCES = \
|
||||
brick2.png \
|
||||
background.jpg \
|
||||
floppybuddy.gif \
|
||||
glarea-fragment.glsl \
|
||||
glarea-vertex.glsl \
|
||||
gnome-applets.png \
|
||||
gnome-calendar.png \
|
||||
gnome-foot.png \
|
||||
|
||||
@@ -140,8 +140,4 @@
|
||||
<gresource prefix="/popover">
|
||||
<file>popover.ui</file>
|
||||
</gresource>
|
||||
<gresource prefix="/glarea">
|
||||
<file>glarea-fragment.glsl</file>
|
||||
<file>glarea-vertex.glsl</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
|
||||
@@ -158,18 +158,11 @@ add_item (GtkWidget *button, gpointer data)
|
||||
/* Insert a new row below the current one */
|
||||
gtk_tree_view_get_cursor (treeview, &path, NULL);
|
||||
model = gtk_tree_view_get_model (treeview);
|
||||
if (path)
|
||||
{
|
||||
gtk_tree_model_get_iter (model, ¤t, path);
|
||||
gtk_tree_path_free (path);
|
||||
gtk_list_store_insert_after (GTK_LIST_STORE (model), &iter, ¤t);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_list_store_insert (GTK_LIST_STORE (model), &iter, -1);
|
||||
}
|
||||
gtk_tree_model_get_iter (model, ¤t, path);
|
||||
gtk_tree_path_free (path);
|
||||
|
||||
/* Set the data for the new row */
|
||||
gtk_list_store_insert_after (GTK_LIST_STORE (model), &iter, ¤t);
|
||||
gtk_list_store_set (GTK_LIST_STORE (model), &iter,
|
||||
COLUMN_ITEM_NUMBER, foo.number,
|
||||
COLUMN_ITEM_PRODUCT, foo.product,
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
#version 330
|
||||
|
||||
out vec4 outputColor;
|
||||
|
||||
void main() {
|
||||
float lerpVal = gl_FragCoord.y / 500.0f;
|
||||
|
||||
outputColor = mix(vec4(1.0f, 0.85f, 0.35f, 1.0f), vec4(0.2f, 0.2f, 0.2f, 1.0f), lerpVal);
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
#version 330
|
||||
|
||||
layout(location = 0) in vec4 position;
|
||||
uniform mat4 mvp;
|
||||
|
||||
void main() {
|
||||
gl_Position = mvp * position;
|
||||
}
|
||||
@@ -3,7 +3,6 @@
|
||||
* GtkGLArea is a widget that allows custom drawing using OpenGL calls.
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <epoxy/gl.h>
|
||||
|
||||
@@ -24,261 +23,35 @@ enum {
|
||||
static float rotation_angles[N_AXIS] = { 0.0 };
|
||||
|
||||
/* The object we are drawing */
|
||||
static const GLfloat vertex_data[] = {
|
||||
0.f, 0.5f, 0.f, 1.f,
|
||||
0.5f, -0.366f, 0.f, 1.f,
|
||||
-0.5f, -0.366f, 0.f, 1.f,
|
||||
};
|
||||
|
||||
/* Initialize the GL buffers */
|
||||
static void
|
||||
init_buffers (GLuint *vao_out,
|
||||
GLuint *buffer_out)
|
||||
{
|
||||
GLuint vao, buffer;
|
||||
|
||||
/* We only use one VAO, so we always keep it bound */
|
||||
glGenVertexArrays (1, &vao);
|
||||
glBindVertexArray (vao);
|
||||
|
||||
/* This is the buffer that holds the vertices */
|
||||
glGenBuffers (1, &buffer);
|
||||
glBindBuffer (GL_ARRAY_BUFFER, buffer);
|
||||
glBufferData (GL_ARRAY_BUFFER, sizeof (vertex_data), vertex_data, GL_STATIC_DRAW);
|
||||
glBindBuffer (GL_ARRAY_BUFFER, 0);
|
||||
|
||||
if (vao_out != NULL)
|
||||
*vao_out = vao;
|
||||
|
||||
if (buffer_out != NULL)
|
||||
*buffer_out = buffer;
|
||||
}
|
||||
|
||||
/* Create and compile a shader */
|
||||
static GLuint
|
||||
create_shader (int type,
|
||||
const char *src)
|
||||
{
|
||||
GLuint shader;
|
||||
int status;
|
||||
|
||||
shader = glCreateShader (type);
|
||||
glShaderSource (shader, 1, &src, NULL);
|
||||
glCompileShader (shader);
|
||||
|
||||
glGetShaderiv (shader, GL_COMPILE_STATUS, &status);
|
||||
if (status == GL_FALSE)
|
||||
{
|
||||
int log_len;
|
||||
char *buffer;
|
||||
|
||||
glGetShaderiv (shader, GL_INFO_LOG_LENGTH, &log_len);
|
||||
|
||||
buffer = g_malloc (log_len + 1);
|
||||
glGetShaderInfoLog (shader, log_len, NULL, buffer);
|
||||
|
||||
g_warning ("Compile failure in %s shader:\n%s\n",
|
||||
type == GL_VERTEX_SHADER ? "vertex" : "fragment",
|
||||
buffer);
|
||||
|
||||
g_free (buffer);
|
||||
|
||||
glDeleteShader (shader);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
return shader;
|
||||
}
|
||||
|
||||
/* Initialize the shaders and link them into a program */
|
||||
static void
|
||||
init_shaders (GLuint *program_out,
|
||||
GLuint *mvp_out)
|
||||
{
|
||||
GLuint vertex, fragment;
|
||||
GLuint program = 0;
|
||||
GLuint mvp = 0;
|
||||
int status;
|
||||
GBytes *source;
|
||||
|
||||
source = g_resources_lookup_data ("/glarea/glarea-vertex.glsl", 0, NULL);
|
||||
vertex = create_shader (GL_VERTEX_SHADER, g_bytes_get_data (source, NULL));
|
||||
g_bytes_unref (source);
|
||||
|
||||
if (vertex == 0)
|
||||
{
|
||||
*program_out = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
source = g_resources_lookup_data ("/glarea/glarea-fragment.glsl", 0, NULL);
|
||||
fragment = create_shader (GL_FRAGMENT_SHADER, g_bytes_get_data (source, NULL));
|
||||
g_bytes_unref (source);
|
||||
|
||||
if (fragment == 0)
|
||||
{
|
||||
glDeleteShader (vertex);
|
||||
*program_out = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
program = glCreateProgram ();
|
||||
glAttachShader (program, vertex);
|
||||
glAttachShader (program, fragment);
|
||||
|
||||
glLinkProgram (program);
|
||||
|
||||
glGetProgramiv (program, GL_LINK_STATUS, &status);
|
||||
if (status == GL_FALSE)
|
||||
{
|
||||
int log_len;
|
||||
char *buffer;
|
||||
|
||||
glGetProgramiv (program, GL_INFO_LOG_LENGTH, &log_len);
|
||||
|
||||
buffer = g_malloc (log_len + 1);
|
||||
glGetProgramInfoLog (program, log_len, NULL, buffer);
|
||||
|
||||
g_warning ("Linking failure:\n%s\n", buffer);
|
||||
|
||||
g_free (buffer);
|
||||
|
||||
glDeleteProgram (program);
|
||||
program = 0;
|
||||
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Get the location of the "mvp" uniform */
|
||||
mvp = glGetUniformLocation (program, "mvp");
|
||||
|
||||
glDetachShader (program, vertex);
|
||||
glDetachShader (program, fragment);
|
||||
|
||||
out:
|
||||
glDeleteShader (vertex);
|
||||
glDeleteShader (fragment);
|
||||
|
||||
if (program_out != NULL)
|
||||
*program_out = program;
|
||||
|
||||
if (mvp_out != NULL)
|
||||
*mvp_out = mvp;
|
||||
}
|
||||
|
||||
static void
|
||||
compute_mvp (float *res,
|
||||
float phi,
|
||||
float theta,
|
||||
float psi)
|
||||
{
|
||||
float x = phi * (G_PI / 180.f);
|
||||
float y = theta * (G_PI / 180.f);
|
||||
float z = psi * (G_PI / 180.f);
|
||||
float c1 = cosf (x), s1 = sinf (x);
|
||||
float c2 = cosf (y), s2 = sinf (y);
|
||||
float c3 = cosf (z), s3 = sinf (z);
|
||||
float c3c2 = c3 * c2;
|
||||
float s3c1 = s3 * c1;
|
||||
float c3s2s1 = c3 * s2 * s1;
|
||||
float s3s1 = s3 * s1;
|
||||
float c3s2c1 = c3 * s2 * c1;
|
||||
float s3c2 = s3 * c2;
|
||||
float c3c1 = c3 * c1;
|
||||
float s3s2s1 = s3 * s2 * s1;
|
||||
float c3s1 = c3 * s1;
|
||||
float s3s2c1 = s3 * s2 * c1;
|
||||
float c2s1 = c2 * s1;
|
||||
float c2c1 = c2 * c1;
|
||||
|
||||
/* initialize to the identity matrix */
|
||||
res[0] = 1.f; res[4] = 0.f; res[8] = 0.f; res[12] = 0.f;
|
||||
res[1] = 0.f; res[5] = 1.f; res[9] = 0.f; res[13] = 0.f;
|
||||
res[2] = 0.f; res[6] = 0.f; res[10] = 1.f; res[14] = 0.f;
|
||||
res[3] = 0.f; res[7] = 0.f; res[11] = 0.f; res[15] = 1.f;
|
||||
|
||||
/* apply all three rotations using the three matrices:
|
||||
*
|
||||
* ⎡ c3 s3 0 ⎤ ⎡ c2 0 -s2 ⎤ ⎡ 1 0 0 ⎤
|
||||
* ⎢ -s3 c3 0 ⎥ ⎢ 0 1 0 ⎥ ⎢ 0 c1 s1 ⎥
|
||||
* ⎣ 0 0 1 ⎦ ⎣ s2 0 c2 ⎦ ⎣ 0 -s1 c1 ⎦
|
||||
*/
|
||||
res[0] = c3c2; res[4] = s3c1 + c3s2s1; res[8] = s3s1 - c3s2c1; res[12] = 0.f;
|
||||
res[1] = -s3c2; res[5] = c3c1 - s3s2s1; res[9] = c3s1 + s3s2c1; res[13] = 0.f;
|
||||
res[2] = s2; res[6] = -c2s1; res[10] = c2c1; res[14] = 0.f;
|
||||
res[3] = 0.f; res[7] = 0.f; res[11] = 0.f; res[15] = 1.f;
|
||||
}
|
||||
|
||||
static GLuint position_buffer;
|
||||
static GLuint program;
|
||||
static GLuint mvp_location;
|
||||
|
||||
/* We need to set up our state when we realize the GtkGLArea widget */
|
||||
static void
|
||||
realize (GtkWidget *widget)
|
||||
{
|
||||
gtk_gl_area_make_current (GTK_GL_AREA (widget));
|
||||
|
||||
init_buffers (&position_buffer, NULL);
|
||||
init_shaders (&program, &mvp_location);
|
||||
}
|
||||
|
||||
/* We should tear down the state when unrealizing */
|
||||
static void
|
||||
unrealize (GtkWidget *widget)
|
||||
{
|
||||
gtk_gl_area_make_current (GTK_GL_AREA (widget));
|
||||
|
||||
glDeleteBuffers (1, &position_buffer);
|
||||
glDeleteProgram (program);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_triangle (void)
|
||||
{
|
||||
float mvp[16];
|
||||
|
||||
/* Compute the model view projection matrix using the
|
||||
* rotation angles specified through the GtkRange widgets
|
||||
*/
|
||||
compute_mvp (mvp,
|
||||
rotation_angles[X_AXIS],
|
||||
rotation_angles[Y_AXIS],
|
||||
rotation_angles[Z_AXIS]);
|
||||
|
||||
/* Use our shaders */
|
||||
glUseProgram (program);
|
||||
|
||||
/* Update the "mvp" matrix we use in the shader */
|
||||
glUniformMatrix4fv (mvp_location, 1, GL_FALSE, &mvp[0]);
|
||||
|
||||
/* Use the vertices in our buffer */
|
||||
glBindBuffer (GL_ARRAY_BUFFER, position_buffer);
|
||||
glEnableVertexAttribArray (0);
|
||||
glVertexAttribPointer (0, 4, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
|
||||
/* Draw the three vertices as a triangle */
|
||||
glDrawArrays (GL_TRIANGLES, 0, 3);
|
||||
|
||||
/* We finished using the buffers and program */
|
||||
glDisableVertexAttribArray (0);
|
||||
glBindBuffer (GL_ARRAY_BUFFER, 0);
|
||||
glUseProgram (0);
|
||||
glColor3f (1.0f, 0.85f, 0.35f);
|
||||
glBegin (GL_TRIANGLES);
|
||||
{
|
||||
glVertex3f ( 0.0, 0.6, 0.0);
|
||||
glVertex3f (-0.2, -0.3, 0.0);
|
||||
glVertex3f ( 0.2, -0.3, 0.0);
|
||||
}
|
||||
glEnd ();
|
||||
}
|
||||
|
||||
/* The main rendering callback */
|
||||
static gboolean
|
||||
render (GtkGLArea *area,
|
||||
GdkGLContext *context)
|
||||
{
|
||||
/* Clear the viewport */
|
||||
glClearColor (0.5, 0.5, 0.5, 1.0);
|
||||
glClear (GL_COLOR_BUFFER_BIT);
|
||||
|
||||
/* Draw our object */
|
||||
glMatrixMode (GL_MODELVIEW);
|
||||
glLoadIdentity ();
|
||||
glRotatef (rotation_angles[X_AXIS], 1, 0, 0);
|
||||
glRotatef (rotation_angles[Y_AXIS], 0, 1, 0);
|
||||
glRotatef (rotation_angles[Z_AXIS], 0, 0, 1);
|
||||
|
||||
draw_triangle ();
|
||||
|
||||
/* Flush the contents of the pipeline */
|
||||
glFlush ();
|
||||
|
||||
return TRUE;
|
||||
@@ -365,7 +138,7 @@ create_glarea_window (GtkWidget *do_widget)
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "GtkGLArea - Golden Triangle");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 600);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 400);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 12);
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL);
|
||||
|
||||
@@ -378,13 +151,7 @@ create_glarea_window (GtkWidget *do_widget)
|
||||
gtk_widget_set_vexpand (gl_area, TRUE);
|
||||
gtk_container_add (GTK_CONTAINER (box), gl_area);
|
||||
|
||||
/* We need to initialize and free GL resources, so we use
|
||||
* the realize and unrealize signals on the widget
|
||||
*/
|
||||
g_signal_connect (gl_area, "realize", G_CALLBACK (realize), NULL);
|
||||
g_signal_connect (gl_area, "unrealize", G_CALLBACK (unrealize), NULL);
|
||||
|
||||
/* The main "draw" call for GtkGLArea */
|
||||
/* the main "draw" call for GtkGLArea */
|
||||
g_signal_connect (gl_area, "render", G_CALLBACK (render), NULL);
|
||||
|
||||
controls = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE);
|
||||
|
||||
@@ -218,6 +218,7 @@ add_columns (GtkTreeView *treeview)
|
||||
|
||||
/* column for symbolic icon */
|
||||
renderer = gtk_cell_renderer_pixbuf_new ();
|
||||
g_object_set (G_OBJECT (renderer), "follow-state", TRUE, NULL);
|
||||
column = gtk_tree_view_column_new_with_attributes ("Symbolic icon",
|
||||
renderer,
|
||||
"icon-name",
|
||||
|
||||
@@ -543,7 +543,7 @@ add_data_tab (const gchar *demoname)
|
||||
* not an image. Let's try something else then.
|
||||
*/
|
||||
g_object_ref_sink (widget);
|
||||
g_object_unref (widget);
|
||||
gtk_widget_destroy (widget);
|
||||
|
||||
bytes = g_resources_lookup_data (resource_name, 0, NULL);
|
||||
g_assert (bytes);
|
||||
|
||||
@@ -42,34 +42,6 @@ window_key_press_event_cb (GtkWidget *widget,
|
||||
return gtk_search_bar_handle_event (bar, event);
|
||||
}
|
||||
|
||||
static void
|
||||
search_changed (GtkSearchEntry *entry,
|
||||
GtkLabel *label)
|
||||
{
|
||||
gtk_label_set_text (label, "search-changed");
|
||||
}
|
||||
|
||||
static void
|
||||
next_match (GtkSearchEntry *entry,
|
||||
GtkLabel *label)
|
||||
{
|
||||
gtk_label_set_text (label, "next-match");
|
||||
}
|
||||
|
||||
static void
|
||||
previous_match (GtkSearchEntry *entry,
|
||||
GtkLabel *label)
|
||||
{
|
||||
gtk_label_set_text (label, "previous-match");
|
||||
}
|
||||
|
||||
static void
|
||||
stop_search (GtkSearchEntry *entry,
|
||||
GtkLabel *label)
|
||||
{
|
||||
gtk_label_set_text (label, "stop-search");
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_search_entry2 (GtkWidget *do_widget)
|
||||
{
|
||||
@@ -127,8 +99,6 @@ do_search_entry2 (GtkWidget *do_widget)
|
||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), 0);
|
||||
|
||||
label = gtk_label_new ("Result:");
|
||||
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
|
||||
gtk_widget_set_margin_start (label, 6);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
|
||||
|
||||
label = gtk_label_new ("");
|
||||
@@ -138,27 +108,6 @@ do_search_entry2 (GtkWidget *do_widget)
|
||||
G_CALLBACK (search_changed_cb), label);
|
||||
g_signal_connect (entry, "changed",
|
||||
G_CALLBACK (changed_cb), label);
|
||||
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), 0);
|
||||
|
||||
label = gtk_label_new ("Signal:");
|
||||
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
|
||||
gtk_widget_set_margin_start (label, 6);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
|
||||
|
||||
label = gtk_label_new ("");
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
|
||||
|
||||
g_signal_connect (entry, "search-changed",
|
||||
G_CALLBACK (search_changed), label);
|
||||
g_signal_connect (entry, "next-match",
|
||||
G_CALLBACK (next_match), label);
|
||||
g_signal_connect (entry, "previous-match",
|
||||
G_CALLBACK (previous_match), label);
|
||||
g_signal_connect (entry, "stop-search",
|
||||
G_CALLBACK (stop_search), label);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/* Stack Sidebar
|
||||
/* Sidebar
|
||||
*
|
||||
* GtkStackSidebar provides an automatic sidebar widget to control
|
||||
* navigation of a GtkStack object. This widget automatically updates it
|
||||
* content based on what is presently available in the GtkStack object,
|
||||
* and using the "title" child property to set the display labels.
|
||||
* GtkSidebar provides an automatic sidebar widget to control navigation
|
||||
* of a GtkStack object. This widget automatically updates it content
|
||||
* based on what is presently available in the GtkStack object, and
|
||||
* using the "title" child property to set the display labels.
|
||||
*/
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
@@ -21,7 +21,7 @@ do_sidebar (GtkWidget *do_widget)
|
||||
GtkWidget *header;
|
||||
const gchar* pages[] = {
|
||||
"Welcome to GTK+",
|
||||
"GtkStackSidebar Widget",
|
||||
"GtkSidebar Widget",
|
||||
"Automatic navigation",
|
||||
"Consistent appearance",
|
||||
"Scrolling",
|
||||
@@ -43,18 +43,18 @@ do_sidebar (GtkWidget *do_widget)
|
||||
header = gtk_header_bar_new ();
|
||||
gtk_header_bar_set_show_close_button (GTK_HEADER_BAR(header), TRUE);
|
||||
gtk_window_set_titlebar (GTK_WINDOW(window), header);
|
||||
gtk_window_set_title (GTK_WINDOW(window), "Stack Sidebar demo");
|
||||
gtk_window_set_title (GTK_WINDOW(window), "Sidebar demo");
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
sidebar = gtk_stack_sidebar_new ();
|
||||
sidebar = gtk_sidebar_new ();
|
||||
gtk_box_pack_start (GTK_BOX (box), sidebar, FALSE, FALSE, 0);
|
||||
|
||||
stack = gtk_stack_new ();
|
||||
gtk_stack_set_transition_type (GTK_STACK (stack), GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN);
|
||||
gtk_stack_sidebar_set_stack (GTK_STACK_SIDEBAR (sidebar), GTK_STACK (stack));
|
||||
gtk_sidebar_set_stack (GTK_SIDEBAR (sidebar), GTK_STACK (stack));
|
||||
|
||||
/* Separator between sidebar and stack */
|
||||
widget = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
|
||||
|
||||
@@ -20,7 +20,6 @@ gtk3_icon_browser_SOURCES = \
|
||||
main.c \
|
||||
iconbrowserapp.c iconbrowserapp.h \
|
||||
iconbrowserwin.c iconbrowserwin.h \
|
||||
iconstore.c iconstore.h \
|
||||
resources.c
|
||||
|
||||
BUILT_SOURCES = \
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include <string.h>
|
||||
#include "iconbrowserapp.h"
|
||||
#include "iconbrowserwin.h"
|
||||
#include "iconstore.h"
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
typedef struct
|
||||
@@ -43,6 +42,13 @@ struct _IconBrowserWindowClass
|
||||
GtkApplicationWindowClass parent_class;
|
||||
};
|
||||
|
||||
enum {
|
||||
NAME_COLUMN,
|
||||
SYMBOLIC_NAME_COLUMN,
|
||||
DESCRIPTION_COLUMN,
|
||||
CONTEXT_COLUMN
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE(IconBrowserWindow, icon_browser_window, GTK_TYPE_APPLICATION_WINDOW);
|
||||
|
||||
static void
|
||||
@@ -58,31 +64,16 @@ search_text_changed (GtkEntry *entry, IconBrowserWindow *win)
|
||||
gtk_tree_model_filter_refilter (win->filter_model);
|
||||
}
|
||||
|
||||
static GdkPixbuf *
|
||||
get_icon (GtkWidget *image, const gchar *name, gint size)
|
||||
{
|
||||
GtkIconInfo *info;
|
||||
GtkStyleContext *context;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
context = gtk_widget_get_style_context (image);
|
||||
info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (), name, size, 0);
|
||||
pixbuf = gtk_icon_info_load_symbolic_for_context (info, context, NULL, NULL);
|
||||
g_object_unref (info);
|
||||
|
||||
return pixbuf;
|
||||
}
|
||||
|
||||
static void
|
||||
set_image (GtkWidget *image, const gchar *name, gint size)
|
||||
{
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
gtk_image_set_from_icon_name (GTK_IMAGE (image), name, 1);
|
||||
gtk_image_set_pixel_size (GTK_IMAGE (image), size);
|
||||
pixbuf = get_icon (image, name, size);
|
||||
gtk_drag_source_set_icon_pixbuf (gtk_widget_get_parent (image), pixbuf);
|
||||
g_object_unref (pixbuf);
|
||||
}
|
||||
|
||||
static void
|
||||
selection_changed (GtkIconView *icon_view, IconBrowserWindow *win)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -96,14 +87,14 @@ item_activated (GtkIconView *icon_view, GtkTreePath *path, IconBrowserWindow *wi
|
||||
gtk_tree_model_get_iter (GTK_TREE_MODEL (win->filter_model), &iter, path);
|
||||
|
||||
if (win->symbolic)
|
||||
column = ICON_STORE_SYMBOLIC_NAME_COLUMN;
|
||||
column = SYMBOLIC_NAME_COLUMN;
|
||||
else
|
||||
column = ICON_STORE_NAME_COLUMN;
|
||||
column = NAME_COLUMN;
|
||||
gtk_tree_model_get (GTK_TREE_MODEL (win->filter_model), &iter,
|
||||
column, &name,
|
||||
ICON_STORE_DESCRIPTION_COLUMN, &description,
|
||||
DESCRIPTION_COLUMN, &description,
|
||||
-1);
|
||||
|
||||
|
||||
if (name == NULL || !gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), name))
|
||||
{
|
||||
g_free (description);
|
||||
@@ -155,10 +146,10 @@ add_icon (IconBrowserWindow *win,
|
||||
symbolic_name = NULL;
|
||||
}
|
||||
gtk_list_store_insert_with_values (win->store, NULL, -1,
|
||||
ICON_STORE_NAME_COLUMN, regular_name,
|
||||
ICON_STORE_SYMBOLIC_NAME_COLUMN, symbolic_name,
|
||||
ICON_STORE_DESCRIPTION_COLUMN, description,
|
||||
ICON_STORE_CONTEXT_COLUMN, context,
|
||||
NAME_COLUMN, regular_name,
|
||||
SYMBOLIC_NAME_COLUMN, symbolic_name,
|
||||
DESCRIPTION_COLUMN, description,
|
||||
CONTEXT_COLUMN, context,
|
||||
-1);
|
||||
}
|
||||
|
||||
@@ -711,13 +702,13 @@ icon_visible_func (GtkTreeModel *model,
|
||||
search_text = gtk_entry_get_text (GTK_ENTRY (win->searchentry));
|
||||
|
||||
if (win->symbolic)
|
||||
column = ICON_STORE_SYMBOLIC_NAME_COLUMN;
|
||||
column = SYMBOLIC_NAME_COLUMN;
|
||||
else
|
||||
column = ICON_STORE_NAME_COLUMN;
|
||||
column = NAME_COLUMN;
|
||||
|
||||
gtk_tree_model_get (model, iter,
|
||||
column, &name,
|
||||
ICON_STORE_CONTEXT_COLUMN, &context,
|
||||
CONTEXT_COLUMN, &context,
|
||||
-1);
|
||||
if (!name)
|
||||
visible = FALSE;
|
||||
@@ -740,11 +731,9 @@ symbolic_toggled (GtkToggleButton *toggle, IconBrowserWindow *win)
|
||||
win->symbolic = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle));
|
||||
|
||||
if (win->symbolic)
|
||||
column = ICON_STORE_SYMBOLIC_NAME_COLUMN;
|
||||
column = SYMBOLIC_NAME_COLUMN;
|
||||
else
|
||||
column = ICON_STORE_NAME_COLUMN;
|
||||
|
||||
icon_store_set_text_column (ICON_STORE (win->store), column);
|
||||
column = NAME_COLUMN;
|
||||
|
||||
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (win->list), win->cell, "icon-name", column, NULL);
|
||||
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (win->list), win->text_cell, "text", column, NULL);
|
||||
@@ -760,72 +749,17 @@ search_mode_toggled (GObject *searchbar, GParamSpec *pspec, IconBrowserWindow *w
|
||||
gtk_list_box_unselect_all (GTK_LIST_BOX (win->context_list));
|
||||
}
|
||||
|
||||
static void
|
||||
get_image_data (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
GtkSelectionData *selection,
|
||||
guint target_info,
|
||||
guint time,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *image;
|
||||
const gchar *name;
|
||||
gint size;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
image = gtk_bin_get_child (GTK_BIN (widget));
|
||||
|
||||
gtk_image_get_icon_name (GTK_IMAGE (image), &name, NULL);
|
||||
size = gtk_image_get_pixel_size (GTK_IMAGE (image));
|
||||
|
||||
pixbuf = get_icon (image, name, size);
|
||||
gtk_selection_data_set_pixbuf (selection, pixbuf);
|
||||
g_object_unref (pixbuf);
|
||||
}
|
||||
|
||||
static void
|
||||
setup_image_dnd (GtkWidget *image)
|
||||
{
|
||||
GtkWidget *parent;
|
||||
|
||||
parent = gtk_widget_get_parent (image);
|
||||
gtk_drag_source_set (parent, GDK_BUTTON1_MASK, NULL, 0, GDK_ACTION_COPY);
|
||||
gtk_drag_source_add_image_targets (parent);
|
||||
g_signal_connect (parent, "drag-data-get", G_CALLBACK (get_image_data), NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
icon_browser_window_init (IconBrowserWindow *win)
|
||||
{
|
||||
GtkTargetList *list;
|
||||
GtkTargetEntry *targets;
|
||||
gint n_targets;
|
||||
|
||||
gtk_widget_init_template (GTK_WIDGET (win));
|
||||
|
||||
list = gtk_target_list_new (NULL, 0);
|
||||
gtk_target_list_add_text_targets (list, 0);
|
||||
targets = gtk_target_table_new_from_list (list, &n_targets);
|
||||
gtk_target_list_unref (list);
|
||||
|
||||
gtk_icon_view_enable_model_drag_source (GTK_ICON_VIEW (win->list),
|
||||
GDK_BUTTON1_MASK,
|
||||
targets, n_targets,
|
||||
GDK_ACTION_COPY);
|
||||
|
||||
gtk_target_table_free (targets, n_targets);
|
||||
|
||||
setup_image_dnd (win->image1);
|
||||
setup_image_dnd (win->image2);
|
||||
setup_image_dnd (win->image3);
|
||||
setup_image_dnd (win->image4);
|
||||
setup_image_dnd (win->image5);
|
||||
|
||||
win->contexts = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_free);
|
||||
|
||||
gtk_tree_model_filter_set_visible_func (win->filter_model, icon_visible_func, win, NULL);
|
||||
gtk_window_set_transient_for (GTK_WINDOW (win->details), GTK_WINDOW (win));
|
||||
|
||||
|
||||
g_signal_connect (win->searchbar, "notify::search-mode-enabled",
|
||||
G_CALLBACK (search_mode_toggled), win);
|
||||
|
||||
@@ -837,8 +771,6 @@ icon_browser_window_init (IconBrowserWindow *win)
|
||||
static void
|
||||
icon_browser_window_class_init (IconBrowserWindowClass *class)
|
||||
{
|
||||
g_type_ensure (ICON_STORE_TYPE);
|
||||
|
||||
gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (class),
|
||||
"/org/gtk/iconbrowser/window.ui");
|
||||
|
||||
@@ -862,6 +794,7 @@ icon_browser_window_class_init (IconBrowserWindowClass *class)
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, description);
|
||||
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), search_text_changed);
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), selection_changed);
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), item_activated);
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), selected_context_changed);
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), symbolic_toggled);
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
#include "iconstore.h"
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
struct _IconStore
|
||||
{
|
||||
GtkListStore parent;
|
||||
|
||||
gint text_column;
|
||||
};
|
||||
|
||||
struct _IconStoreClass
|
||||
{
|
||||
GtkListStoreClass parent_class;
|
||||
};
|
||||
|
||||
static void icon_store_drag_source_init (GtkTreeDragSourceIface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (IconStore, icon_store, GTK_TYPE_LIST_STORE,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_DRAG_SOURCE,
|
||||
icon_store_drag_source_init))
|
||||
|
||||
|
||||
static void
|
||||
icon_store_init (IconStore *store)
|
||||
{
|
||||
GType types[4] = { G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING };
|
||||
|
||||
gtk_list_store_set_column_types (GTK_LIST_STORE (store), 4, types);
|
||||
|
||||
store->text_column = ICON_STORE_NAME_COLUMN;
|
||||
}
|
||||
|
||||
static void
|
||||
icon_store_class_init (IconStoreClass *class)
|
||||
{
|
||||
}
|
||||
|
||||
static gboolean
|
||||
row_draggable (GtkTreeDragSource *drag_source,
|
||||
GtkTreePath *path)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
drag_data_delete (GtkTreeDragSource *drag_source,
|
||||
GtkTreePath *path)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
|
||||
if (gtk_tree_model_get_iter (GTK_TREE_MODEL (drag_source), &iter, path))
|
||||
return gtk_list_store_remove (GTK_LIST_STORE (drag_source), &iter);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
drag_data_get (GtkTreeDragSource *drag_source,
|
||||
GtkTreePath *path,
|
||||
GtkSelectionData *selection)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
gchar *text;
|
||||
|
||||
if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (drag_source), &iter, path))
|
||||
return FALSE;
|
||||
|
||||
gtk_tree_model_get (GTK_TREE_MODEL (drag_source), &iter,
|
||||
ICON_STORE (drag_source)->text_column, &text,
|
||||
-1);
|
||||
|
||||
gtk_selection_data_set_text (selection, text, -1);
|
||||
|
||||
g_free (text);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
icon_store_drag_source_init (GtkTreeDragSourceIface *iface)
|
||||
{
|
||||
iface->row_draggable = row_draggable;
|
||||
iface->drag_data_delete = drag_data_delete;
|
||||
iface->drag_data_get = drag_data_get;
|
||||
}
|
||||
|
||||
void
|
||||
icon_store_set_text_column (IconStore *store, gint text_column)
|
||||
{
|
||||
store->text_column = text_column;
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
#ifndef __ICON_STORE_H
|
||||
#define __ICON_STORE_H
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
|
||||
#define ICON_STORE_TYPE (icon_store_get_type ())
|
||||
#define ICON_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ICON_STORE_TYPE, IconStore))
|
||||
|
||||
|
||||
typedef struct _IconStore IconStore;
|
||||
typedef struct _IconStoreClass IconStoreClass;
|
||||
|
||||
enum {
|
||||
ICON_STORE_NAME_COLUMN,
|
||||
ICON_STORE_SYMBOLIC_NAME_COLUMN,
|
||||
ICON_STORE_DESCRIPTION_COLUMN,
|
||||
ICON_STORE_CONTEXT_COLUMN
|
||||
};
|
||||
|
||||
GType icon_store_get_type (void);
|
||||
|
||||
void icon_store_set_text_column (IconStore *store,
|
||||
gint column);
|
||||
|
||||
#endif /* __ICON_STORE_H */
|
||||
@@ -1,7 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 3.8 -->
|
||||
<object class="IconStore" id="store">
|
||||
<object class="GtkListStore" id="store">
|
||||
<columns>
|
||||
<column type="gchararray"/>
|
||||
<column type="gchararray"/>
|
||||
<column type="gchararray"/>
|
||||
<column type="gchararray"/>
|
||||
</columns>
|
||||
</object>
|
||||
<object class="GtkTreeModelFilter" id="filter_model">
|
||||
<property name="child_model">store</property>
|
||||
@@ -102,8 +108,7 @@
|
||||
<object class="GtkIconView" id="list">
|
||||
<property name="visible">True</property>
|
||||
<property name="model">filter_model</property>
|
||||
<property name="selection-mode">none</property>
|
||||
<property name="activate-on-single-click">True</property>
|
||||
<signal name="selection_changed" handler="selection_changed"/>
|
||||
<signal name="item_activated" handler="item_activated"/>
|
||||
<child>
|
||||
<object class="GtkCellRendererPixbuf" id="cell">
|
||||
@@ -151,17 +156,12 @@
|
||||
<property name="row-spacing">10</property>
|
||||
<property name="column-spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkEventBox">
|
||||
<object class="GtkImage" id="image1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image1">
|
||||
<property name="visible">True</property>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
</object>
|
||||
</child>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
@@ -169,17 +169,12 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEventBox">
|
||||
<object class="GtkImage" id="image2">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image2">
|
||||
<property name="visible">True</property>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
</object>
|
||||
</child>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
@@ -187,17 +182,12 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEventBox">
|
||||
<object class="GtkImage" id="image3">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image3">
|
||||
<property name="visible">True</property>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
</object>
|
||||
</child>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">2</property>
|
||||
@@ -205,17 +195,12 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEventBox">
|
||||
<object class="GtkImage" id="image4">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image4">
|
||||
<property name="visible">True</property>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
</object>
|
||||
</child>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">3</property>
|
||||
@@ -223,17 +208,12 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEventBox">
|
||||
<object class="GtkImage" id="image5">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image5">
|
||||
<property name="visible">True</property>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
</object>
|
||||
</child>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">4</property>
|
||||
|
||||
@@ -62,7 +62,6 @@ uninstall-update-icon-cache:
|
||||
|
||||
EXTRA_DIST += \
|
||||
widget-factory.ui \
|
||||
widget-factory.css \
|
||||
menus.ui \
|
||||
widget-factory.gresource.xml \
|
||||
data/source.svg \
|
||||
|
||||
@@ -159,12 +159,6 @@ spin_value_reset (GtkWidget *button, GtkAdjustment *adjustment)
|
||||
static gint pulse_time = 250;
|
||||
static gint pulse_entry_mode = 0;
|
||||
|
||||
static void
|
||||
remove_pulse (gpointer pulse_id)
|
||||
{
|
||||
g_source_remove (GPOINTER_TO_UINT (pulse_id));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
pulse_it (GtkWidget *widget)
|
||||
{
|
||||
@@ -176,7 +170,7 @@ pulse_it (GtkWidget *widget)
|
||||
gtk_progress_bar_pulse (GTK_PROGRESS_BAR (widget));
|
||||
|
||||
pulse_id = g_timeout_add (pulse_time, (GSourceFunc)pulse_it, widget);
|
||||
g_object_set_data_full (G_OBJECT (widget), "pulse_id", GUINT_TO_POINTER (pulse_id), remove_pulse);
|
||||
g_object_set_data (G_OBJECT (widget), "pulse_id", GUINT_TO_POINTER (pulse_id));
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
@@ -196,14 +190,18 @@ update_pulse_time (GtkAdjustment *adjustment, GtkWidget *widget)
|
||||
|
||||
if (value == 100)
|
||||
{
|
||||
g_object_set_data (G_OBJECT (widget), "pulse_id", NULL);
|
||||
if (pulse_id != 0)
|
||||
{
|
||||
g_source_remove (pulse_id);
|
||||
g_object_set_data (G_OBJECT (widget), "pulse_id", NULL);
|
||||
}
|
||||
}
|
||||
else if (value < 100)
|
||||
{
|
||||
if (pulse_id == 0 && (GTK_IS_PROGRESS_BAR (widget) || pulse_entry_mode % 3 == 2))
|
||||
{
|
||||
pulse_id = g_timeout_add (pulse_time, (GSourceFunc)pulse_it, widget);
|
||||
g_object_set_data_full (G_OBJECT (widget), "pulse_id", GUINT_TO_POINTER (pulse_id), remove_pulse);
|
||||
g_object_set_data (G_OBJECT (widget), "pulse_id", GUINT_TO_POINTER (pulse_id));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -214,6 +212,8 @@ on_entry_icon_release (GtkEntry *entry,
|
||||
GdkEvent *event,
|
||||
gpointer user_data)
|
||||
{
|
||||
guint pulse_id;
|
||||
|
||||
if (icon_pos != GTK_ENTRY_ICON_SECONDARY)
|
||||
return;
|
||||
|
||||
@@ -221,7 +221,12 @@ on_entry_icon_release (GtkEntry *entry,
|
||||
|
||||
if (pulse_entry_mode % 3 == 0)
|
||||
{
|
||||
g_object_set_data (G_OBJECT (entry), "pulse_id", NULL);
|
||||
pulse_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (entry), "pulse_id"));
|
||||
if (pulse_id != 0)
|
||||
{
|
||||
g_source_remove (pulse_id);
|
||||
g_object_set_data (G_OBJECT (entry), "pulse_id", NULL);
|
||||
}
|
||||
gtk_entry_set_progress_fraction (entry, 0);
|
||||
}
|
||||
else if (pulse_entry_mode % 3 == 1)
|
||||
@@ -308,37 +313,27 @@ on_page_combo_changed (GtkComboBox *combo,
|
||||
{
|
||||
GtkWidget *from;
|
||||
GtkWidget *to;
|
||||
GtkWidget *print;
|
||||
|
||||
from = GTK_WIDGET (g_object_get_data (G_OBJECT (combo), "range_from_spin"));
|
||||
to = GTK_WIDGET (g_object_get_data (G_OBJECT (combo), "range_to_spin"));
|
||||
print = GTK_WIDGET (g_object_get_data (G_OBJECT (combo), "print_button"));
|
||||
|
||||
switch (gtk_combo_box_get_active (combo))
|
||||
{
|
||||
case 0: /* Range */
|
||||
gtk_widget_set_sensitive (from, TRUE);
|
||||
gtk_widget_set_sensitive (to, TRUE);
|
||||
gtk_widget_set_sensitive (print, TRUE);
|
||||
break;
|
||||
case 1: /* All */
|
||||
gtk_widget_set_sensitive (from, FALSE);
|
||||
gtk_widget_set_sensitive (to, FALSE);
|
||||
gtk_spin_button_set_value (GTK_SPIN_BUTTON (from), 1);
|
||||
gtk_spin_button_set_value (GTK_SPIN_BUTTON (to), 99);
|
||||
gtk_widget_set_sensitive (print, TRUE);
|
||||
break;
|
||||
case 2: /* Current */
|
||||
gtk_widget_set_sensitive (from, FALSE);
|
||||
gtk_widget_set_sensitive (to, FALSE);
|
||||
gtk_spin_button_set_value (GTK_SPIN_BUTTON (from), 7);
|
||||
gtk_spin_button_set_value (GTK_SPIN_BUTTON (to), 7);
|
||||
gtk_widget_set_sensitive (print, TRUE);
|
||||
break;
|
||||
case 4:
|
||||
gtk_widget_set_sensitive (from, FALSE);
|
||||
gtk_widget_set_sensitive (to, FALSE);
|
||||
gtk_widget_set_sensitive (print, FALSE);
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
@@ -352,8 +347,8 @@ on_range_from_changed (GtkSpinButton *from)
|
||||
|
||||
to = GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (from), "range_to_spin"));
|
||||
|
||||
v1 = gtk_spin_button_get_value_as_int (from);
|
||||
v2 = gtk_spin_button_get_value_as_int (to);
|
||||
v1 = gtk_spin_button_get_value_as_int (from);
|
||||
v2 = gtk_spin_button_get_value_as_int (to);
|
||||
|
||||
if (v1 > v2)
|
||||
gtk_spin_button_set_value (to, v1);
|
||||
@@ -367,8 +362,8 @@ on_range_to_changed (GtkSpinButton *to)
|
||||
|
||||
from = GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (to), "range_from_spin"));
|
||||
|
||||
v1 = gtk_spin_button_get_value_as_int (from);
|
||||
v2 = gtk_spin_button_get_value_as_int (to);
|
||||
v1 = gtk_spin_button_get_value_as_int (from);
|
||||
v2 = gtk_spin_button_get_value_as_int (to);
|
||||
|
||||
if (v1 > v2)
|
||||
gtk_spin_button_set_value (from, v2);
|
||||
@@ -728,7 +723,7 @@ populate_colors (GtkWidget *widget)
|
||||
GdkRGBA rgba;
|
||||
|
||||
gtk_list_box_set_header_func (GTK_LIST_BOX (widget), update_title_header, NULL, NULL);
|
||||
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (colors); i++)
|
||||
{
|
||||
row = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 20);
|
||||
@@ -1109,21 +1104,6 @@ osd_frame_button_press (GtkWidget *frame, GdkEventButton *event, gpointer data)
|
||||
return GDK_EVENT_STOP;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
page_combo_separator_func (GtkTreeModel *model,
|
||||
GtkTreeIter *iter,
|
||||
gpointer data)
|
||||
{
|
||||
gchar *text;
|
||||
gboolean res;
|
||||
|
||||
gtk_tree_model_get (model, iter, 0, &text, -1);
|
||||
res = g_strcmp0 (text, "-") == 0;
|
||||
g_free (text);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static void
|
||||
activate (GApplication *app)
|
||||
{
|
||||
@@ -1132,7 +1112,6 @@ activate (GApplication *app)
|
||||
GtkWidget *widget;
|
||||
GtkWidget *widget2;
|
||||
GtkWidget *widget3;
|
||||
GtkWidget *widget4;
|
||||
GtkWidget *stack;
|
||||
GtkWidget *dialog;
|
||||
GtkAdjustment *adj;
|
||||
@@ -1157,7 +1136,7 @@ activate (GApplication *app)
|
||||
g_type_ensure (my_text_view_get_type ());
|
||||
|
||||
provider = gtk_css_provider_new ();
|
||||
gtk_css_provider_load_from_resource (provider, "/org/gtk/WidgetFactory/widget-factory.css");
|
||||
gtk_css_provider_load_from_data (provider, ".circular-button { border-radius: 20px; outline-radius: 20px; }", -1, NULL);
|
||||
gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
|
||||
GTK_STYLE_PROVIDER (provider),
|
||||
GTK_STYLE_PROVIDER_PRIORITY_USER);
|
||||
@@ -1280,15 +1259,12 @@ activate (GApplication *app)
|
||||
populate_colors ((GtkWidget *)gtk_builder_get_object (builder, "munsell"));
|
||||
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "page_combo");
|
||||
gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (widget), page_combo_separator_func, NULL, NULL);
|
||||
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "range_from_spin");
|
||||
widget3 = (GtkWidget *)gtk_builder_get_object (builder, "range_to_spin");
|
||||
widget4 = (GtkWidget *)gtk_builder_get_object (builder, "print_button");
|
||||
g_object_set_data (G_OBJECT (widget), "range_from_spin", widget2);
|
||||
g_object_set_data (G_OBJECT (widget3), "range_from_spin", widget2);
|
||||
g_object_set_data (G_OBJECT (widget), "range_to_spin", widget3);
|
||||
g_object_set_data (G_OBJECT (widget2), "range_to_spin", widget3);
|
||||
g_object_set_data (G_OBJECT (widget), "print_button", widget4);
|
||||
|
||||
set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "quitmenuitem")));
|
||||
set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "deletemenuitem")));
|
||||
@@ -1336,7 +1312,6 @@ int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GtkApplication *app;
|
||||
GAction *action;
|
||||
static GActionEntry app_entries[] = {
|
||||
{ "about", activate_about, NULL, NULL, NULL },
|
||||
{ "quit", activate_quit, NULL, NULL, NULL },
|
||||
@@ -1354,8 +1329,6 @@ main (int argc, char *argv[])
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (app),
|
||||
app_entries, G_N_ELEMENTS (app_entries),
|
||||
app);
|
||||
action = g_action_map_lookup_action (G_ACTION_MAP (app), "wine");
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), FALSE);
|
||||
|
||||
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
.circular-button {
|
||||
border-radius: 20px;
|
||||
outline-radius: 20px;
|
||||
}
|
||||
|
||||
.small-button {
|
||||
padding: 0;
|
||||
outline-width: 0;
|
||||
}
|
||||
@@ -3,9 +3,6 @@
|
||||
<gresource prefix="/org/gtk/WidgetFactory">
|
||||
<file preprocess="xml-stripblanks">widget-factory.ui</file>
|
||||
</gresource>
|
||||
<gresource prefix="/org/gtk/WidgetFactory">
|
||||
<file>widget-factory.css</file>
|
||||
</gresource>
|
||||
<gresource prefix="/org/gtk/WidgetFactory/gtk">
|
||||
<file preprocess="xml-stripblanks">menus.ui</file>
|
||||
</gresource>
|
||||
|
||||
@@ -1060,7 +1060,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
<object class="GtkFileChooserButton" id="filechooserbutton1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="local_only">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
@@ -1571,7 +1570,9 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
<property name="title" translatable="yes">Icon</property>
|
||||
<property name="reorderable">True</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererPixbuf" id="cellrendererpixbuf1"/>
|
||||
<object class="GtkCellRendererPixbuf" id="cellrendererpixbuf1">
|
||||
<property name="follow_state">true</property>
|
||||
</object>
|
||||
<attributes>
|
||||
<attribute name="icon_name">1</attribute>
|
||||
</attributes>
|
||||
@@ -2894,15 +2895,6 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="tooltip-text" translatable="yes">Search for it</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="label" translatable="yes">Insert</property>
|
||||
<property name="icon-name">insert-image</property>
|
||||
<property name="tooltip-text" translatable="yes">Insert something</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
@@ -3081,7 +3073,9 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="selection_mode">multiple</property>
|
||||
<property name="model">iconsmodel</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererPixbuf" id="iconviewcell"/>
|
||||
<object class="GtkCellRendererPixbuf" id="iconviewcell">
|
||||
<property name="follow-state">True</property>
|
||||
</object>
|
||||
<attributes>
|
||||
<attribute name="icon-name">0</attribute>
|
||||
</attributes>
|
||||
@@ -3406,7 +3400,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<child>
|
||||
<object class="GtkStackSidebar">
|
||||
<object class="GtkSidebar">
|
||||
<property name="visible">True</property>
|
||||
<property name="stack">sidebar_stack</property>
|
||||
</object>
|
||||
@@ -3579,8 +3573,6 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<item>Range</item>
|
||||
<item>All</item>
|
||||
<item>Current</item>
|
||||
<item>-</item>
|
||||
<item>None</item>
|
||||
</items>
|
||||
</object>
|
||||
</child>
|
||||
@@ -3599,7 +3591,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="print_button">
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="label">Print</property>
|
||||
</object>
|
||||
@@ -3627,7 +3619,6 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<object class="GtkToolbar">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="toolbar-style">icons</property>
|
||||
<property name="icon-size">1</property>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="toolbutton1">
|
||||
@@ -3867,41 +3858,11 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="height-request">120</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="tab-expand">True</property>
|
||||
<property name="tab-fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkBox">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<child type="center">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Page 1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="focus-on-click">False</property>
|
||||
<style>
|
||||
<class name="small-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">window-close-symbolic</property>
|
||||
<property name="icon-size">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack-type">end</property>
|
||||
</packing>
|
||||
</child>
|
||||
<property name="label" translatable="yes">Page 1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
@@ -3909,41 +3870,11 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="tab-expand">True</property>
|
||||
<property name="tab-fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkBox">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<child type="center">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Page 2</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="focus-on-click">False</property>
|
||||
<style>
|
||||
<class name="small-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">window-close-symbolic</property>
|
||||
<property name="icon-size">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack-type">end</property>
|
||||
</packing>
|
||||
</child>
|
||||
<property name="label" translatable="yes">Page 2</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
@@ -28,7 +28,6 @@ IGNORE_HFILES= \
|
||||
gdkprivate.h \
|
||||
gdk*private.h \
|
||||
keyname-table.h \
|
||||
wayland/xdg-shell-client-protocol.h \
|
||||
win32 \
|
||||
x11 \
|
||||
quartz
|
||||
|
||||
@@ -713,8 +713,6 @@ GdkGrabOwnership
|
||||
|
||||
<SUBSECTION>
|
||||
gdk_device_get_name
|
||||
gdk_device_get_vendor_id
|
||||
gdk_device_get_product_id
|
||||
gdk_device_get_source
|
||||
gdk_device_set_mode
|
||||
gdk_device_get_mode
|
||||
@@ -1288,25 +1286,12 @@ gdk_frame_get_type
|
||||
<SECTION>
|
||||
<FILE>gdkglcontext</FILE>
|
||||
GdkGLContext
|
||||
gdk_gl_context_get_display
|
||||
gdk_gl_context_get_window
|
||||
gdk_gl_context_get_shared_context
|
||||
gdk_gl_context_get_version
|
||||
|
||||
<SUBSECTION>
|
||||
gdk_gl_context_set_required_version
|
||||
gdk_gl_context_get_required_version
|
||||
gdk_gl_context_set_debug_enabled
|
||||
gdk_gl_context_get_debug_enabled
|
||||
gdk_gl_context_set_forward_compatible
|
||||
gdk_gl_context_get_forward_compatible
|
||||
|
||||
<SUBSECTION>
|
||||
GdkGLError
|
||||
gdk_gl_context_realize
|
||||
gdk_gl_context_make_current
|
||||
gdk_gl_context_get_current
|
||||
gdk_gl_context_clear_current
|
||||
gdk_gl_context_get_current
|
||||
GdkGLProfile
|
||||
GdkGLError
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GDK_GL_CONTEXT
|
||||
|
||||
@@ -19,217 +19,85 @@ HFILE_GLOB=$(top_srcdir)/gtk/*.h
|
||||
CFILE_GLOB=$(top_srcdir)/gtk/*.c
|
||||
|
||||
# Header files to ignore when scanning
|
||||
IGNORE_HFILES = \
|
||||
inspector \
|
||||
a11y \
|
||||
gtkaccelgroupprivate.h \
|
||||
gtkaccelmapprivate.h \
|
||||
gtkadjustmentprivate.h \
|
||||
gtkallocatedbitmaskprivate.h \
|
||||
gtkappchooserprivate.h \
|
||||
gtkapplicationprivate.h \
|
||||
gtkbindingsprivate.h \
|
||||
gtkbitmaskprivate.h \
|
||||
gtkboxprivate.h \
|
||||
gtkbuilderprivate.h \
|
||||
gtkbuttonprivate.h \
|
||||
gtkcairoblurprivate.h \
|
||||
gtkcellareaboxcontextprivate.h \
|
||||
gtkclipboardprivate.h \
|
||||
gtkcolorchooserprivate.h \
|
||||
gtkcoloreditorprivate.h \
|
||||
gtkcolorplaneprivate.h \
|
||||
gtkcolorscaleprivate.h \
|
||||
gtkcolorswatchprivate.h \
|
||||
gtkcomboboxprivate.h \
|
||||
gtkcontainerprivate.h \
|
||||
gtkcssanimatedstyleprivate.h \
|
||||
gtkcssanimationprivate.h \
|
||||
gtkcssarrayvalueprivate.h \
|
||||
gtkcssbgsizevalueprivate.h \
|
||||
gtkcssbordervalueprivate.h \
|
||||
gtkcsscolorvalueprivate.h \
|
||||
gtkcsscornervalueprivate.h \
|
||||
gtkcsscustompropertyprivate.h \
|
||||
gtkcsseasevalueprivate.h \
|
||||
gtkcssenginevalueprivate.h \
|
||||
gtkcssenumvalueprivate.h \
|
||||
gtkcssiconthemevalueprivate.h \
|
||||
gtkcssimagebuiltinprivate.h \
|
||||
gtkcssimagecrossfadeprivate.h \
|
||||
gtkcssimagegradientprivate.h \
|
||||
gtkcssimageiconthemeprivate.h \
|
||||
gtkcssimagelinearprivate.h \
|
||||
gtkcssimageprivate.h \
|
||||
gtkcssimagescaledprivate.h \
|
||||
gtkcssimagesurfaceprivate.h \
|
||||
gtkcssimageurlprivate.h \
|
||||
gtkcssimagevalueprivate.h \
|
||||
gtkcssimagewin32private.h \
|
||||
gtkcssinheritvalueprivate.h \
|
||||
gtkcssinitialvalueprivate.h \
|
||||
gtkcsskeyframesprivate.h \
|
||||
gtkcsslookupprivate.h \
|
||||
gtkcssmatcherprivate.h \
|
||||
gtkcssnodedeclarationprivate.h \
|
||||
gtkcssnumbervalueprivate.h \
|
||||
gtkcssparserprivate.h \
|
||||
gtkcsspositionvalueprivate.h \
|
||||
gtkcssproviderprivate.h \
|
||||
gtkcssrepeatvalueprivate.h \
|
||||
gtkcssrgbavalueprivate.h \
|
||||
gtkcsssectionprivate.h \
|
||||
gtkcssselectorprivate.h \
|
||||
gtkcssshadowsvalueprivate.h \
|
||||
gtkcssshadowvalueprivate.h \
|
||||
gtkcssshorthandpropertyprivate.h\
|
||||
gtkcssstaticstyleprivate.h \
|
||||
gtkcssstringvalueprivate.h \
|
||||
gtkcssstylefuncsprivate.h \
|
||||
gtkcssstyleprivate.h \
|
||||
gtkcssstylepropertyprivate.h \
|
||||
gtkcsstransformvalueprivate.h \
|
||||
gtkcsstransitionprivate.h \
|
||||
gtkcsstypedvalueprivate.h \
|
||||
gtkcsstypesprivate.h \
|
||||
gtkcssunsetvalueprivate.h \
|
||||
gtkcssvalueprivate.h \
|
||||
gtkdialogprivate.h \
|
||||
gtkentryprivate.h \
|
||||
gtkeventcontrollerprivate.h \
|
||||
gtkfilechooserprivate.h \
|
||||
gtkfontchooserprivate.h \
|
||||
gtkgesturedragprivate.h \
|
||||
gtkgesturelongpressprivate.h \
|
||||
gtkgesturemultipressprivate.h \
|
||||
gtkgesturepanprivate.h \
|
||||
gtkgestureprivate.h \
|
||||
gtkgesturerotateprivate.h \
|
||||
gtkgesturesingleprivate.h \
|
||||
gtkgestureswipeprivate.h \
|
||||
gtkgesturezoomprivate.h \
|
||||
gtkheaderbarprivate.h \
|
||||
gtkhslaprivate.h \
|
||||
gtkiconhelperprivate.h \
|
||||
gtkiconviewprivate.h \
|
||||
gtkimageprivate.h \
|
||||
gtkimmoduleprivate.h \
|
||||
gtklabelprivate.h \
|
||||
gtklockbuttonprivate.h \
|
||||
gtkmagnifierprivate.h \
|
||||
gtkmenubuttonprivate.h \
|
||||
gtkmenuitemprivate.h \
|
||||
gtkmenuprivate.h \
|
||||
gtkmenushellprivate.h \
|
||||
gtkmodulesprivate.h \
|
||||
gtkmountoperationprivate.h \
|
||||
gtkorientableprivate.h \
|
||||
gtkpixelcacheprivate.h \
|
||||
gtkpopoverprivate.h \
|
||||
gtkprinter-private.h \
|
||||
gtkprintoperation-private.h \
|
||||
gtkprivate.h \
|
||||
gtkrangeprivate.h \
|
||||
gtkrecentchooserprivate.h \
|
||||
gtkrenderbackgroundprivate.h \
|
||||
gtkrenderborderprivate.h \
|
||||
gtkrendericonprivate.h \
|
||||
gtkrenderprivate.h \
|
||||
gtkroundedboxprivate.h \
|
||||
gtkscaleprivate.h \
|
||||
gtksearchentryprivate.h \
|
||||
gtkselectionprivate.h \
|
||||
gtksettingsprivate.h \
|
||||
gtksizegroup-private.h \
|
||||
gtksizerequestcacheprivate.h \
|
||||
gtksocketprivate.h \
|
||||
gtkstyleanimationprivate.h \
|
||||
gtkstylecascadeprivate.h \
|
||||
gtkstylecontextprivate.h \
|
||||
gtkstylepropertyprivate.h \
|
||||
gtkstyleproviderprivate.h \
|
||||
gtktextchildprivate.h \
|
||||
gtktexthandleprivate.h \
|
||||
gtktextiterprivate.h \
|
||||
gtktextmarkprivate.h \
|
||||
gtktexttagprivate.h \
|
||||
gtktogglebuttonprivate.h \
|
||||
gtktoolbarprivate.h \
|
||||
gtktoolpaletteprivate.h \
|
||||
gtktooltipprivate.h \
|
||||
gtktreeprivate.h \
|
||||
gtkwidgetprivate.h \
|
||||
gtkwin32themeprivate.h \
|
||||
gtkwindowprivate.h \
|
||||
IGNORE_HFILES= \
|
||||
fnmatch.h \
|
||||
gtkactionmuxer.h \
|
||||
gtkactionobserver.h \
|
||||
gtkactionobservable.h \
|
||||
gtk9slice.h \
|
||||
gtkanimationdescription.h \
|
||||
gtkbitmaskprivateimpl.h \
|
||||
gtkbookmarksmanager.h \
|
||||
gtkdbusgenerated.c \
|
||||
gtkdbusgenerated.h \
|
||||
gtkdebug.h \
|
||||
gtkactionhelper.h \
|
||||
gtkapplicationprivate.h \
|
||||
gtkbuilderprivate.h \
|
||||
gtkcolorchooserprivate.h \
|
||||
gtkcoloreditorprivate.h \
|
||||
gtkcolorplaneprivate.h \
|
||||
gtkcolorscaleprivate.h \
|
||||
gtkcolorswatchprivate.h \
|
||||
gtkdndcursors.h \
|
||||
gtkentryprivate.h \
|
||||
gtkfilechooserdefault.h \
|
||||
gtkfilechooserembed.h \
|
||||
gtkfilechooserentry.h \
|
||||
gtkfilechooserprivate.h \
|
||||
gtkfilechoosersettings.h \
|
||||
gtkfilechooserutils.h \
|
||||
gtkfilesystem.h \
|
||||
gtkfilesystemmodel.h \
|
||||
gtkfilesystemunix.h \
|
||||
gtkfilesystemwin32.h \
|
||||
gtkfontchooserutils.h \
|
||||
gtkiconcache.h \
|
||||
gtkiconcachevalidator.h \
|
||||
gtkiconthemeparser.h \
|
||||
gtkintl.h \
|
||||
gtkkeyhash.h \
|
||||
gtkkineticscrolling.h \
|
||||
gtkmarshal.h \
|
||||
gtkmenuprivate.h \
|
||||
gtkmnemonichash.h \
|
||||
gtkmenutracker.h \
|
||||
gtkmenutrackeritem.h \
|
||||
gtkmenusectionbox.h \
|
||||
gtkmodelmenu.h \
|
||||
gtkmodelmenuitem.h \
|
||||
gtkmodifierstyle.h \
|
||||
gtkpathbar.h \
|
||||
gtkplugprivate.h \
|
||||
gtkprintbackend.h \
|
||||
gtkprinteroption.h \
|
||||
gtkprinteroptionset.h \
|
||||
gtkprinteroptionwidget.h \
|
||||
gtkprinter-private.h \
|
||||
gtkprint-win32.h \
|
||||
gtkprintutils.h \
|
||||
gtkprintoperation-private.h \
|
||||
gtkprivate.h \
|
||||
gtkprivatetypebuiltins.h \
|
||||
gtkquery.h \
|
||||
gtkrbtree.h \
|
||||
gtkrecentchooserdefault.h \
|
||||
gtkrecentchooserutils.h \
|
||||
gtkrecentchooserprivate.h \
|
||||
gtksearchengine.h \
|
||||
gtksearchenginebeagle.h \
|
||||
gtksearchenginetracker.h \
|
||||
gtksearchenginesimple.h \
|
||||
gtksearchenginequartz.h \
|
||||
gtksequence.h \
|
||||
gtksocketprivate.h \
|
||||
gtktextbtree.h \
|
||||
gtktextbufferserialize.h \
|
||||
gtktextbufferserializ.h \
|
||||
gtktextchildprivate.h \
|
||||
gtktextdisplay.h \
|
||||
gtktexthandleprivate.h \
|
||||
gtktextiterprivate.h \
|
||||
gtktextlayout.h \
|
||||
gtktextmarkprivate.h \
|
||||
gtktextsegment.h \
|
||||
gtktexttagprivate.h \
|
||||
gtktexttypes.h \
|
||||
gtktextutil.h \
|
||||
gtktimeline.h \
|
||||
gtkthemes.h \
|
||||
gtktrashmonitor.h \
|
||||
gtktrayicon.h \
|
||||
gtktreedatalist.h \
|
||||
gtktreemenu.h \
|
||||
gtktreeprivate.h \
|
||||
gtktoolpaletteprivate.h \
|
||||
gtktypebuiltins.h \
|
||||
gtkxembed.h \
|
||||
gtkwin32embed.h \
|
||||
@@ -304,7 +172,6 @@ expand_content_files = \
|
||||
drawing-model.xml \
|
||||
getting_started.xml \
|
||||
glossary.xml \
|
||||
input-handling.xml \
|
||||
migrating-2to3.xml \
|
||||
migrating-checklist.sgml \
|
||||
migrating-unique-GtkApplication.xml \
|
||||
|
||||
@@ -202,7 +202,7 @@ How to compile GTK+ itself
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<ulink url="https://wiki.gnome.org/Projects/GObjectIntrospection">Gobject Introspection</ulink>
|
||||
<ulink url="http://live.gnome.org/GObjectIntrospection">Gobject Introspection</ulink>
|
||||
is a framework for making introspection data available to
|
||||
language bindings. It is available
|
||||
<ulink url="http://download.gnome.org/sources/gobject-introspection/">here</ulink>.
|
||||
|
||||
@@ -5,21 +5,6 @@
|
||||
<chapter id="gtk-getting-started" xmlns:xi="http://www.w3.org/2003/XInclude">
|
||||
<title>Getting Started with GTK+</title>
|
||||
|
||||
<para>GTK+ is a <ulink url="http://en.wikipedia.org/wiki/Widget_toolkit">
|
||||
widget toolkit</ulink>. Each user interface created by
|
||||
GTK+ consists of widgets. This is implemented in C using
|
||||
<link linkend="gobject">GObject</link>, an object-oriented framework for C.
|
||||
Widgets are organized in a hierachy. The window widget is the main container.
|
||||
The user interface is then built by adding buttons, drop-down menus, input
|
||||
fields, and other widgets to the window.
|
||||
If you are creating complex user interfaces it is recommended to
|
||||
use #GtkBuilder and its GTK-specific markup description language, instead of
|
||||
assembling the interface manually. You can also use a visual user interface
|
||||
editor, like <ulink url="https://glade.gnome.org/">Glade</ulink>.</para>
|
||||
|
||||
<para>GTK+ is event-driven. The toolkit listens for events such as
|
||||
a click on a button, and passes the event to your application.</para>
|
||||
|
||||
<para>This chapter 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
|
||||
@@ -30,8 +15,8 @@
|
||||
<section>
|
||||
<title>Basics</title>
|
||||
|
||||
<para>To begin our introduction to GTK, we'll start with a simple
|
||||
signal-based Gtk application. This program will create an empty 200 × 200 pixel
|
||||
<para>To begin our introduction to GTK, we'll start with the simplest
|
||||
program possible. This program will create an empty 200 × 200 pixel
|
||||
window.</para>
|
||||
|
||||
<informalfigure>
|
||||
@@ -43,7 +28,7 @@
|
||||
</informalfigure>
|
||||
|
||||
<informalexample>
|
||||
<para>Create a new file with the following content named <filename>example-0.c.</filename></para>
|
||||
<para>Create a new file with the following content named example-0.c.</para>
|
||||
<programlisting><xi:include href="../../../../examples/window-default.c" parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
|
||||
</informalexample>
|
||||
|
||||
@@ -67,66 +52,45 @@
|
||||
by third party code. The compiler will abort with an error if any other
|
||||
header is directly included.</para></warning>
|
||||
|
||||
<para>In a GTK+ application, the purpose of the main() function is to
|
||||
create a #GtkApplication object and run it. In this example a
|
||||
#GtkApplication pointer named <varname>app</varname> is called and then
|
||||
initialized using gtk_application_new().</para>
|
||||
<para>We then proceed into the <function>main</function>() function of the
|
||||
application, and we declare a <varname>window</varname> variable as a pointer
|
||||
of type #GtkWidget.</para>
|
||||
|
||||
<para>When creating a #GtkApplication
|
||||
you need to pick an application identifier (a name)
|
||||
and input to gtk_application_new() as parameter.
|
||||
For this example <varname>org.gtk.example</varname> is used
|
||||
but for choosing an identifier for your application see
|
||||
<ulink url="https://wiki.gnome.org/HowDoI/ChooseApplicationID">this guide</ulink>.
|
||||
Lastly gtk_application_new() takes a GApplicationFlags as input for your
|
||||
application, if your application would have special needs.
|
||||
</para>
|
||||
|
||||
<para>Next the
|
||||
<ulink url="https://wiki.gnome.org/HowDoI/GtkApplication">activate signal</ulink>
|
||||
is connected to the activate() function above the main() functions.
|
||||
The <varname>activate</varname> signal will be sent
|
||||
when your application is launched with
|
||||
g_application_run() on the line below.
|
||||
The gtk_application_run() also takes as arguments the pointers to the command line arguments
|
||||
<para>The following line will call gtk_init(), which
|
||||
is the initialization function for GTK+; this function will set up GTK+,
|
||||
the type system, the connection to the windowing environment, etc. The
|
||||
gtk_init() takes as arguments the pointers to the command line arguments
|
||||
counter and string array; this allows GTK+ to parse specific command line
|
||||
arguments that control the behavior of GTK+ itself. The parsed arguments
|
||||
will be removed from the array, leaving the unrecognized ones for your
|
||||
application to parse.
|
||||
</para>
|
||||
application to parse.</para>
|
||||
|
||||
<para>Within g_application_run the activate() signal is sent and
|
||||
we then proceed into the <function>activate</function>() function of the
|
||||
application. Inside the activate() function we want to construct
|
||||
our GTK window, so that a window is shown when the application
|
||||
is launched. The call to gtk_application_window_new() will
|
||||
create a new #GtkWindow and store it inside the
|
||||
<varname>window</varname> pointer. The window will have a frame,
|
||||
a title bar, and window controls depending on the platform.</para>
|
||||
<note><para>For more information on which command line arguments GTK+
|
||||
recognizes, please refer to the <link linkend="gtk-running">Running GTK+
|
||||
Applications</link> section in this reference.</para></note>
|
||||
|
||||
<para>A window title is set using gtk_window_set_title(). This function
|
||||
takes a GtkWindow* pointer and a string as input. As our
|
||||
<varname>window</varname> pointer is a GtkWidget pointer, we need to cast it
|
||||
to GtkWindow*.
|
||||
But instead of casting <varname>window</varname> via
|
||||
<varname>(GtkWindow*)</varname>,
|
||||
<varname>window</varname> can be cast using the macro
|
||||
<varname>GTK_WINDOW()</varname>.
|
||||
<varname>GTK_WINDOW()</varname> will check if the
|
||||
pointer is an instance of the GtkWindow class, before casting, and emit a
|
||||
warning if the check fails. More information about this convention
|
||||
can be found
|
||||
<ulink url="https://developer.gnome.org/gobject/stable/gtype-conventions.html">
|
||||
here</ulink>.</para>
|
||||
<para>The call to gtk_window_new() will create a new #GtkWindow and store
|
||||
it inside the <varname>window</varname> variable. The type of the window
|
||||
is %GTK_WINDOW_TOPLEVEL, which means that the #GtkWindow will be managed
|
||||
by the windowing system: it will have a frame, a title bar and window
|
||||
controls, depending on the platform.</para>
|
||||
|
||||
<para>Finally the window size is set using gtk_window_set_default_size and
|
||||
the window is then shown by GTK via gtk_widget_show_all().</para>
|
||||
<para>In order to terminate the application when the #GtkWindow is
|
||||
destroyed, we connect the #GtkWidget::destroy signal to the gtk_main_quit()
|
||||
function. This function will terminate the GTK+ main loop started by calling
|
||||
gtk_main() later. The #GtkWidget::destroy signal is emitted when a widget is
|
||||
destroyed, either by explicitly calling gtk_widget_destroy() or when the
|
||||
widget is unparented. Top-level #GtkWindow<!-- -->s are also destroyed when
|
||||
the Close window control button is clicked.</para>
|
||||
|
||||
<para>When you exit the window, by for example pressing the X,
|
||||
the g_application_run() in the main loop returns with a number
|
||||
which is saved inside an integer named "status". Afterwards, the
|
||||
#GtkApplication object is freed from memory with g_object_unref().
|
||||
Finally the status integer is returned and the GTK application exits.</para>
|
||||
<para>#GtkWidget<!-- -->s are hidden by default. By calling gtk_widget_show()
|
||||
on a #GtkWidget we are asking GTK+ to set the visibility attribute so that it
|
||||
can be displayed. All this work is done after the main loop has been
|
||||
started.</para>
|
||||
|
||||
<para>The last line of interest is the call to gtk_main(). This function will
|
||||
start the GTK+ main loop and will block the control flow of the
|
||||
main() until the gtk_main_quit() function is called.</para>
|
||||
|
||||
<para>While the program is running, GTK+ is receiving
|
||||
<firstterm>events</firstterm>. These are typically input events caused by
|
||||
@@ -165,53 +129,13 @@
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<para>As seen above, example-1.c builds further upon example-0.c by adding a
|
||||
button to our window, with the label "Hello World". Two new GtkWidget pointers
|
||||
are declared to accomplish this, <varname>button</varname> and
|
||||
<varname>button_box</varname>. The button_box variable is created to store a
|
||||
#GtkButtonBox which is GTK+'s way of controlling the size and layout of buttons.
|
||||
The #GtkButtonBox is created and assigned to gtk_button_box_new() which takes a
|
||||
#GtkOrientation enum as parameter. The buttons which this box will contain can
|
||||
either be stored horizontally or vertically but this does not matter in this
|
||||
particular case as we are dealing with only one button. After initializing
|
||||
button_box with horizontal orientation, the code adds the button_box widget to the
|
||||
window widget using gtk_container_add().</para>
|
||||
|
||||
<para>Next the <varname>button</varname> variable is initialized in similar manner.
|
||||
gtk_button_new_with_label() is called which returns a GtkButton to be stored inside
|
||||
<varname>button</varname>. Afterwards <varname>button</varname> is added to
|
||||
our <varname>button_box</varname>.
|
||||
Using g_signal_connect the button is connected to a function in our app called
|
||||
print_hello(), so that when the button is clicked, GTK will call this function.
|
||||
As the print_hello() function does not use any data as input, NULL is passed
|
||||
to it. print_hello() calls g_print() with the string "Hello World"
|
||||
which will print Hello World in a terminal if the GTK application was started
|
||||
from one.</para>
|
||||
|
||||
<para>After connecting print_hello(), another signal is connected to the "clicked" state
|
||||
of the button using g_signal_connect_swapped(). This functions is similar to
|
||||
a g_signal_connect() with the difference lying in how the callback function is
|
||||
treated. g_signal_connect_swapped() allow you to specify what the callback
|
||||
function should take as parameter by letting you pass it as data. In this case
|
||||
the function being called back is gtk_widget_destroy() and the <varname>window</varname>
|
||||
pointer is passed to it. This has the effect that when the button is clicked,
|
||||
the whole GTK window is destroyed. In contrast if a normal g_signal_connect() were used
|
||||
to connect the "clicked" signal with gtk_widget_destroy(), then the <varname>button</varname>
|
||||
itself would have been destroyed, not the window.
|
||||
More information about creating buttons can be found
|
||||
<ulink url="https://wiki.gnome.org/HowDoI/Buttons">here</ulink>.
|
||||
</para>
|
||||
|
||||
<para>The rest of the code in example-1.c is identical to example-0.c. Next
|
||||
section will elaborate further on how to add several GtkWidgets to your GTK
|
||||
application.</para>
|
||||
|
||||
<section>
|
||||
<title>Packing</title>
|
||||
|
||||
<para>When creating an application, you'll want to put more than one widget
|
||||
inside a window.
|
||||
When you want to put more than one widget into a window, it
|
||||
inside a window. Our first helloworld example only used one widget so we
|
||||
could simply use a gtk_container_add() call to "pack" the widget into the
|
||||
window. But when you want to put more than one widget into a window, it
|
||||
it becomes important to control how each widget is positioned and sized.
|
||||
This is where packing comes in.</para>
|
||||
|
||||
@@ -243,6 +167,51 @@
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Drawing</title>
|
||||
|
||||
<para>Many widgets, like buttons, do all their drawing themselves. You
|
||||
just tell them the label you want to see, and they figure out what font
|
||||
to use, draw the button outline and focus rectangle, etc. Sometimes, it
|
||||
is necessary to do some custom drawing. In that case, a #GtkDrawingArea
|
||||
might be the right widget to use. It offers a canvas on which you can
|
||||
draw by connecting to the #GtkWidget::draw signal.
|
||||
</para>
|
||||
|
||||
<para>The contents of a widget often need to be partially or fully redrawn,
|
||||
e.g. when another window is moved and uncovers part of the widget, or
|
||||
when tie window containing it is resized. It is also possible to explicitly
|
||||
cause part or all of the widget to be redrawn, by calling
|
||||
gtk_widget_queue_draw() or its variants. GTK+ takes care of most of the
|
||||
details by providing a ready-to-use cairo context to the ::draw signal
|
||||
handler.</para>
|
||||
|
||||
<para>The following example shows a ::draw signal handler. It is a bit
|
||||
more complicated than the previous examples, since it also demonstrates
|
||||
input event handling by means of ::button-press and ::motion-notify
|
||||
handlers.</para>
|
||||
|
||||
<informalfigure>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="drawing.png" format="PNG"/>
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</informalfigure>
|
||||
|
||||
<example id="gtk-getting-started-drawing">
|
||||
<title>Drawing in response to input</title>
|
||||
<para>Create a new file with the following content named example-3.c.</para>
|
||||
<programlisting><xi:include href="../../../../examples/drawing.c" parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
|
||||
</example>
|
||||
<para>
|
||||
You can compile the program above with GCC using:
|
||||
<literallayout>
|
||||
<literal>gcc `pkg-config --cflags gtk+-3.0` -o example-3 example-3.c `pkg-config --libs gtk+-3.0`</literal>
|
||||
</literallayout>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Building user interfaces</title>
|
||||
|
||||
@@ -1037,50 +1006,4 @@ example_app_window_init (ExampleAppWindow *win)
|
||||
here.</para>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Custom Drawing</title>
|
||||
|
||||
<para>Many widgets, like buttons, do all their drawing themselves. You
|
||||
just tell them the label you want to see, and they figure out what font
|
||||
to use, draw the button outline and focus rectangle, etc. Sometimes, it
|
||||
is necessary to do some custom drawing. In that case, a #GtkDrawingArea
|
||||
might be the right widget to use. It offers a canvas on which you can
|
||||
draw by connecting to the #GtkWidget::draw signal.
|
||||
</para>
|
||||
|
||||
<para>The contents of a widget often need to be partially or fully redrawn,
|
||||
e.g. when another window is moved and uncovers part of the widget, or
|
||||
when tie window containing it is resized. It is also possible to explicitly
|
||||
cause part or all of the widget to be redrawn, by calling
|
||||
gtk_widget_queue_draw() or its variants. GTK+ takes care of most of the
|
||||
details by providing a ready-to-use cairo context to the ::draw signal
|
||||
handler.</para>
|
||||
|
||||
<para>The following example shows a ::draw signal handler. It is a bit
|
||||
more complicated than the previous examples, since it also demonstrates
|
||||
input event handling by means of ::button-press and ::motion-notify
|
||||
handlers.</para>
|
||||
|
||||
<informalfigure>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="drawing.png" format="PNG"/>
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</informalfigure>
|
||||
|
||||
<example id="gtk-getting-started-drawing">
|
||||
<title>Drawing in response to input</title>
|
||||
<para>Create a new file with the following content named example-3.c.</para>
|
||||
<programlisting><xi:include href="../../../../examples/drawing.c" parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
|
||||
</example>
|
||||
<para>
|
||||
You can compile the program above with GCC using:
|
||||
<literallayout>
|
||||
<literal>gcc `pkg-config --cflags gtk+-3.0` -o example-3 example-3.c `pkg-config --libs gtk+-3.0`</literal>
|
||||
</literallayout>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
</chapter>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<xi:include href="resources.sgml" />
|
||||
<xi:include href="xml/question_index.sgml" />
|
||||
<xi:include href="drawing-model.xml" />
|
||||
<xi:include href="xml/input-handling.xml" />
|
||||
<xi:include href="input-handling.xml" />
|
||||
</part>
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
<xi:include href="xml/gtkflowbox.xml" />
|
||||
<xi:include href="xml/gtkstack.xml" />
|
||||
<xi:include href="xml/gtkstackswitcher.xml" />
|
||||
<xi:include href="xml/gtkstacksidebar.xml" />
|
||||
<xi:include href="xml/gtksidebar.xml" />
|
||||
<xi:include href="xml/gtkactionbar.xml" />
|
||||
<xi:include href="xml/gtkheaderbar.xml" />
|
||||
<xi:include href="xml/gtkoverlay.xml" />
|
||||
|
||||
@@ -329,7 +329,6 @@ GTK_ADJUSTMENT_CLASS
|
||||
GTK_IS_ADJUSTMENT_CLASS
|
||||
GTK_ADJUSTMENT_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkAdjustmentPrivate
|
||||
gtk_adjustment_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -551,13 +550,12 @@ gtk_list_box_set_header_func
|
||||
gtk_list_box_set_sort_func
|
||||
gtk_list_box_drag_highlight_row
|
||||
gtk_list_box_drag_unhighlight_row
|
||||
GtkListBoxCreateWidgetFunc
|
||||
gtk_list_box_bind_model
|
||||
|
||||
gtk_list_box_row_new
|
||||
gtk_list_box_row_changed
|
||||
gtk_list_box_row_is_selected
|
||||
gtk_list_box_row_get_header
|
||||
gtk_list_box_row_get_type
|
||||
gtk_list_box_row_set_header
|
||||
gtk_list_box_row_get_index
|
||||
gtk_list_box_row_set_activatable
|
||||
@@ -566,12 +564,6 @@ gtk_list_box_row_set_selectable
|
||||
gtk_list_box_row_get_selectable
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_LIST_BOX
|
||||
GTK_LIST_BOX_CLASS
|
||||
GTK_LIST_BOX_GET_CLASS
|
||||
GTK_LIST_BOX_ROW
|
||||
GTK_LIST_BOX_ROW_CLASS
|
||||
GTK_LIST_BOX_ROW_GET_CLASS
|
||||
GTK_IS_LIST_BOX
|
||||
GTK_IS_LIST_BOX_CLASS
|
||||
GTK_IS_LIST_BOX_ROW
|
||||
@@ -1126,7 +1118,6 @@ gtk_editable_get_type
|
||||
<FILE>gtkentry</FILE>
|
||||
<TITLE>GtkEntry</TITLE>
|
||||
GtkEntry
|
||||
GtkEntryClass
|
||||
gtk_entry_new
|
||||
gtk_entry_new_with_buffer
|
||||
gtk_entry_get_buffer
|
||||
@@ -1215,8 +1206,6 @@ GTK_ENTRY_CLASS
|
||||
GTK_IS_ENTRY_CLASS
|
||||
GTK_ENTRY_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GTK_TYPE_TEXT_HANDLE_POSITION
|
||||
GTK_TYPE_TEXT_HANDLE_MODE
|
||||
GtkEntryPrivate
|
||||
gtk_entry_get_type
|
||||
</SECTION>
|
||||
@@ -1313,7 +1302,6 @@ GTK_EVENT_BOX_CLASS
|
||||
GTK_IS_EVENT_BOX_CLASS
|
||||
GTK_EVENT_BOX_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkEventBoxPrivate
|
||||
gtk_event_box_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -1645,7 +1633,6 @@ GTK_IS_FONT_CHOOSER_IFACE
|
||||
GTK_FONT_CHOOSER_GET_IFACE
|
||||
|
||||
<SUBSECTION Private>
|
||||
GTK_FONT_CHOOSER_DELEGATE_QUARK
|
||||
gtk_font_chooser_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -2248,7 +2235,6 @@ GTK_MENU_CLASS
|
||||
GTK_IS_MENU_CLASS
|
||||
GTK_MENU_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkMenuPrivate
|
||||
gtk_menu_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -2301,7 +2287,7 @@ GTK_IS_MENU_BUTTON
|
||||
GTK_IS_MENU_BUTTON_CLASS
|
||||
GTK_MENU_BUTTON_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkMenuButtonPrivate
|
||||
GtkMenuButtonrPrivate
|
||||
gtk_menu_button_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -2338,7 +2324,6 @@ GTK_MENU_ITEM_CLASS
|
||||
GTK_IS_MENU_ITEM_CLASS
|
||||
GTK_MENU_ITEM_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkMenuItemPrivate
|
||||
gtk_menu_item_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -2405,7 +2390,6 @@ GTK_MENU_SHELL_CLASS
|
||||
GTK_IS_MENU_SHELL_CLASS
|
||||
GTK_MENU_SHELL_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkMenuShellPrivate
|
||||
gtk_menu_shell_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -2499,7 +2483,6 @@ gtk_notebook_prepend_page_menu
|
||||
gtk_notebook_insert_page
|
||||
gtk_notebook_insert_page_menu
|
||||
gtk_notebook_remove_page
|
||||
gtk_notebook_detach_tab
|
||||
gtk_notebook_page_num
|
||||
gtk_notebook_next_page
|
||||
gtk_notebook_prev_page
|
||||
@@ -2574,7 +2557,6 @@ GTK_IS_NUMERABLE_ICON_CLASS
|
||||
GTK_NUMERABLE_ICON_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkNumerableIconPrivate
|
||||
gtk_numerable_icon_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -3216,7 +3198,6 @@ gtk_search_bar_get_type
|
||||
<TITLE>GtkSearchEntry</TITLE>
|
||||
GtkSearchEntry
|
||||
gtk_search_entry_new
|
||||
gtk_search_entry_handle_event
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_SEARCH_ENTRY
|
||||
GTK_SEARCH_ENTRY
|
||||
@@ -3291,7 +3272,6 @@ GTK_SETTINGS_CLASS
|
||||
GTK_SETTINGS_GET_CLASS
|
||||
GTK_TYPE_SETTINGS
|
||||
<SUBSECTION Private>
|
||||
GtkSettingsPrivate
|
||||
gtk_settings_get_type
|
||||
GtkSettingsPropertyValue
|
||||
</SECTION>
|
||||
@@ -3337,7 +3317,6 @@ GTK_SOCKET_CLASS
|
||||
GTK_IS_SOCKET_CLASS
|
||||
GTK_SOCKET_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkSocketPrivate
|
||||
gtk_socket_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -4392,7 +4371,6 @@ gtk_tree_model_row_inserted
|
||||
gtk_tree_model_row_has_child_toggled
|
||||
gtk_tree_model_row_deleted
|
||||
gtk_tree_model_rows_reordered
|
||||
gtk_tree_model_rows_reordered_with_length
|
||||
<SUBSECTION Standard>
|
||||
GTK_TREE_MODEL
|
||||
GTK_IS_TREE_MODEL
|
||||
@@ -4429,7 +4407,6 @@ GTK_TREE_MODEL_SORT_CLASS
|
||||
GTK_IS_TREE_MODEL_SORT_CLASS
|
||||
GTK_TREE_MODEL_SORT_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkTreeModelSortPrivate
|
||||
gtk_tree_model_sort_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -4497,7 +4474,6 @@ GTK_TREE_SELECTION_CLASS
|
||||
GTK_TREE_SELECTION_GET_CLASS
|
||||
GTK_IS_TREE_SELECTION_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkTreeSelectionPrivate
|
||||
gtk_tree_selection_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -4588,7 +4564,6 @@ GTK_TREE_STORE_CLASS
|
||||
GTK_IS_TREE_STORE_CLASS
|
||||
GTK_TREE_STORE_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkTreeStorePrivate
|
||||
gtk_tree_store_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -4659,7 +4634,6 @@ GTK_TREE_VIEW_COLUMN_CLASS
|
||||
GTK_IS_TREE_VIEW_COLUMN_CLASS
|
||||
GTK_TREE_VIEW_COLUMN_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkTreeViewColumnPrivate
|
||||
gtk_tree_view_column_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -4875,7 +4849,6 @@ gtk_cell_area_get_current_path_string
|
||||
gtk_cell_area_apply_attributes
|
||||
gtk_cell_area_attribute_connect
|
||||
gtk_cell_area_attribute_disconnect
|
||||
gtk_cell_area_attribute_get_column
|
||||
gtk_cell_area_class_install_cell_property
|
||||
gtk_cell_area_class_find_cell_property
|
||||
gtk_cell_area_class_list_cell_properties
|
||||
@@ -5013,7 +4986,6 @@ GTK_IS_CELL_RENDERER_CLASS
|
||||
GTK_CELL_RENDERER_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkCellRendererPrivate
|
||||
GtkCellRendererClassPrivate
|
||||
gtk_cell_renderer_get_type
|
||||
gtk_cell_renderer_mode_get_type
|
||||
gtk_cell_renderer_state_get_type
|
||||
@@ -5652,7 +5624,6 @@ GTK_IS_WIDGET_CLASS
|
||||
GTK_WIDGET_GET_CLASS
|
||||
GTK_TYPE_REQUISITION
|
||||
<SUBSECTION Private>
|
||||
GtkWidgetClassPrivate
|
||||
GtkWidgetPrivate
|
||||
gtk_widget_get_type
|
||||
gtk_requisition_get_type
|
||||
@@ -5820,7 +5791,6 @@ GTK_WINDOW_GROUP
|
||||
GTK_WINDOW_GROUP_CLASS
|
||||
GTK_WINDOW_GROUP_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkWindowGroupPrivate
|
||||
gtk_window_group_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -5889,11 +5859,6 @@ gtk_get_micro_version
|
||||
gtk_get_binary_age
|
||||
gtk_get_interface_age
|
||||
gtk_check_version
|
||||
gtk_major_version
|
||||
gtk_minor_version
|
||||
gtk_micro_version
|
||||
gtk_binary_age
|
||||
gtk_interface_age
|
||||
|
||||
<SUBSECTION>
|
||||
GTK_MAJOR_VERSION
|
||||
@@ -6001,7 +5966,6 @@ GTK_STYLE_PROPERTIES
|
||||
GTK_STYLE_PROPERTIES_CLASS
|
||||
GTK_STYLE_PROPERTIES_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkStylePropertiesPrivate
|
||||
gtk_style_properties_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -6029,7 +5993,6 @@ GTK_STYLE_CLASS_BUTTON
|
||||
GTK_STYLE_CLASS_CALENDAR
|
||||
GTK_STYLE_CLASS_CELL
|
||||
GTK_STYLE_CLASS_COMBOBOX_ENTRY
|
||||
GTK_STYLE_CLASS_CONTEXT_MENU
|
||||
GTK_STYLE_CLASS_CHECK
|
||||
GTK_STYLE_CLASS_CSD
|
||||
GTK_STYLE_CLASS_CURSOR_HANDLE
|
||||
@@ -6070,14 +6033,12 @@ GTK_STYLE_CLASS_OVERSHOOT
|
||||
GTK_STYLE_CLASS_PANE_SEPARATOR
|
||||
GTK_STYLE_CLASS_PAPER
|
||||
GTK_STYLE_CLASS_POPUP
|
||||
GTK_STYLE_CLASS_POPOVER
|
||||
GTK_STYLE_CLASS_PRIMARY_TOOLBAR
|
||||
GTK_STYLE_CLASS_PROGRESSBAR
|
||||
GTK_STYLE_CLASS_PULSE
|
||||
GTK_STYLE_CLASS_QUESTION
|
||||
GTK_STYLE_CLASS_RADIO
|
||||
GTK_STYLE_CLASS_RAISED
|
||||
GTK_STYLE_CLASS_READ_ONLY
|
||||
GTK_STYLE_CLASS_RIGHT
|
||||
GTK_STYLE_CLASS_RUBBERBAND
|
||||
GTK_STYLE_CLASS_SCALE
|
||||
@@ -6097,7 +6058,6 @@ GTK_STYLE_CLASS_TITLE
|
||||
GTK_STYLE_CLASS_TITLEBAR
|
||||
GTK_STYLE_CLASS_TOOLBAR
|
||||
GTK_STYLE_CLASS_TOOLTIP
|
||||
GTK_STYLE_CLASS_TOUCH_SELECTION
|
||||
GTK_STYLE_CLASS_TOP
|
||||
GTK_STYLE_CLASS_TROUGH
|
||||
GTK_STYLE_CLASS_UNDERSHOOT
|
||||
@@ -6206,7 +6166,6 @@ GTK_IS_STYLE_CONTEXT_CLASS
|
||||
GTK_TYPE_BORDER
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkStyleContextPrivate
|
||||
gtk_style_context_get_type
|
||||
gtk_border_get_type
|
||||
</SECTION>
|
||||
@@ -6245,8 +6204,6 @@ GTK_CSS_PROVIDER_GET_CLASS
|
||||
GTK_IS_CSS_PROVIDER
|
||||
GTK_IS_CSS_PROVIDER_CLASS
|
||||
<SUBSECTION Private>
|
||||
GTK_TYPE_CSS_SECTION
|
||||
GtkCssProviderPrivate
|
||||
gtk_css_provider_get_type
|
||||
gtk_css_provider_error_quark
|
||||
gtk_css_section_get_type
|
||||
@@ -6518,7 +6475,6 @@ GtkClipboardClearFunc
|
||||
gtk_clipboard_get
|
||||
gtk_clipboard_get_for_display
|
||||
gtk_clipboard_get_display
|
||||
gtk_clipboard_get_default
|
||||
gtk_clipboard_set_with_data
|
||||
gtk_clipboard_set_with_owner
|
||||
gtk_clipboard_get_owner
|
||||
@@ -6578,7 +6534,6 @@ gtk_drag_unhighlight
|
||||
<SUBSECTION Source Side>
|
||||
gtk_drag_begin
|
||||
gtk_drag_begin_with_coordinates
|
||||
gtk_drag_cancel
|
||||
gtk_drag_set_icon_widget
|
||||
gtk_drag_set_icon_pixbuf
|
||||
gtk_drag_set_icon_stock
|
||||
@@ -6760,8 +6715,6 @@ GTK_STOCK_ZOOM_100
|
||||
GTK_STOCK_ZOOM_FIT
|
||||
GTK_STOCK_ZOOM_IN
|
||||
GTK_STOCK_ZOOM_OUT
|
||||
<SUBSECTION Private>
|
||||
GtkStock
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -6823,7 +6776,6 @@ gtk_icon_info_get_attach_points
|
||||
gtk_icon_info_get_display_name
|
||||
gtk_icon_info_is_symbolic
|
||||
<SUBSECTION Standard>
|
||||
GtkIconInfoClass
|
||||
GTK_ICON_THEME
|
||||
GTK_IS_ICON_THEME
|
||||
GTK_TYPE_ICON_THEME
|
||||
@@ -6833,11 +6785,6 @@ GTK_IS_ICON_THEME_CLASS
|
||||
GTK_ICON_THEME_GET_CLASS
|
||||
gtk_icon_info_get_type
|
||||
GTK_TYPE_ICON_INFO
|
||||
GTK_ICON_INFO
|
||||
GTK_ICON_INFO_CLASS
|
||||
GTK_ICON_INFO_GET_CLASS
|
||||
GTK_IS_ICON_INFO
|
||||
GTK_IS_ICON_INFO_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkIconThemePrivate
|
||||
gtk_icon_theme_error_quark
|
||||
@@ -7202,7 +7149,6 @@ gtk_print_settings_get_type
|
||||
<TITLE>GtkPaperSize</TITLE>
|
||||
GtkPaperSize
|
||||
GtkUnit
|
||||
GTK_UNIT_PIXEL
|
||||
GTK_PAPER_NAME_A3
|
||||
GTK_PAPER_NAME_A4
|
||||
GTK_PAPER_NAME_A5
|
||||
@@ -7857,7 +7803,6 @@ GTK_IS_ACTION_BAR_CLASS
|
||||
GTK_ACTION_BAR_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkActionBarPrivate
|
||||
gtk_action_bar_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -7890,7 +7835,6 @@ GTK_IS_HEADER_BAR_CLASS
|
||||
GTK_HEADER_BAR_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkHeaderBarPrivate
|
||||
gtk_header_bar_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -7919,14 +7863,6 @@ GtkStackTransitionType
|
||||
gtk_stack_set_transition_type
|
||||
gtk_stack_get_transition_type
|
||||
gtk_stack_get_transition_running
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_STACK
|
||||
GTK_IS_STACK
|
||||
GTK_IS_STACK_CLASS
|
||||
GTK_STACK
|
||||
GTK_STACK_CLASS
|
||||
GTK_STACK_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_stack_get_type
|
||||
</SECTION>
|
||||
@@ -7938,14 +7874,6 @@ GtkStackSwitcher
|
||||
gtk_stack_switcher_new
|
||||
gtk_stack_switcher_set_stack
|
||||
gtk_stack_switcher_get_stack
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_STACK_SWITCHER
|
||||
GTK_IS_STACK_SWITCHER
|
||||
GTK_IS_STACK_SWITCHER_CLASS
|
||||
GTK_STACK_SWITCHER
|
||||
GTK_STACK_SWITCHER_CLASS
|
||||
GTK_STACK_SWITCHER_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_stack_switcher_get_type
|
||||
</SECTION>
|
||||
@@ -7964,15 +7892,6 @@ gtk_revealer_set_transition_duration
|
||||
GtkRevealerTransitionType
|
||||
gtk_revealer_get_transition_type
|
||||
gtk_revealer_set_transition_type
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_REVEALER
|
||||
GTK_IS_REVEALER
|
||||
GTK_IS_REVEALER_CLASS
|
||||
GTK_REVEALER
|
||||
GTK_REVEALER_CLASS
|
||||
GTK_REVEALER_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_revealer_get_type
|
||||
</SECTION>
|
||||
@@ -8024,24 +7943,6 @@ gtk_flow_box_child_new
|
||||
gtk_flow_box_child_get_index
|
||||
gtk_flow_box_child_is_selected
|
||||
gtk_flow_box_child_changed
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GtkFlowBoxChildClass
|
||||
GTK_TYPE_FLOW_BOX
|
||||
GTK_TYPE_FLOW_BOX_CHILD
|
||||
GTK_FLOW_BOX
|
||||
GTK_FLOW_BOX_CLASS
|
||||
GTK_FLOW_BOX_GET_CLASS
|
||||
GTK_IS_FLOW_BOX
|
||||
GTK_IS_FLOW_BOX_CLASS
|
||||
GTK_FLOW_BOX_CHILD
|
||||
GTK_FLOW_BOX_CHILD_CLASS
|
||||
GTK_FLOW_BOX_CHILD_GET_CLASS
|
||||
GTK_IS_FLOW_BOX_CHILD
|
||||
GTK_IS_FLOW_BOX_CHILD_CLASS
|
||||
<SUBSECTION Private>
|
||||
gtk_flow_box_get_type
|
||||
gtk_flow_box_child_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -8059,20 +7960,7 @@ gtk_popover_set_position
|
||||
gtk_popover_get_position
|
||||
gtk_popover_set_modal
|
||||
gtk_popover_get_modal
|
||||
gtk_popover_set_transitions_enabled
|
||||
gtk_popover_get_transitions_enabled
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_POPOVER
|
||||
GTK_IS_POPOVER
|
||||
GTK_IS_POPOVER_CLASS
|
||||
GTK_IS_POPOVER_MENU
|
||||
GTK_IS_POPOVER_MENU_CLASS
|
||||
GTK_POPOVER
|
||||
GTK_POPOVER_CLASS
|
||||
GTK_POPOVER_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkPopoverPrivate
|
||||
gtk_popover_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -8082,15 +7970,6 @@ gtk_popover_get_type
|
||||
GtkPopoverMenu
|
||||
gtk_popover_menu_new
|
||||
gtk_popover_menu_open_submenu
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_POPOVER_MENU
|
||||
GTK_IS_POPOVER_MENU
|
||||
GTK_IS_POPOVER_MENU_CLASS
|
||||
GTK_POPOVER_MENU
|
||||
GTK_POPOVER_MENU_CLASS
|
||||
GTK_POPOVER_MENU_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_popover_menu_get_type
|
||||
</SECTION>
|
||||
@@ -8101,12 +7980,6 @@ gtk_popover_menu_get_type
|
||||
GtkModelButton
|
||||
GtkButtonRole
|
||||
gtk_model_button_new
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_MODEL_BUTTON
|
||||
GTK_MODEL_BUTTON
|
||||
GTK_IS_MODEL_BUTTON
|
||||
<SUBSECTION Private>
|
||||
gtk_model_button_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -8126,7 +7999,6 @@ GTK_EVENT_CONTROLLER
|
||||
GTK_EVENT_CONTROLLER_CLASS
|
||||
GTK_IS_EVENT_CONTROLLER
|
||||
GTK_EVENT_CONTROLLER_GET_CLASS
|
||||
GTK_IS_EVENT_CONTROLLER_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkEventControllerPriv
|
||||
@@ -8336,24 +8208,24 @@ gtk_gesture_zoom_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkstacksidebar</FILE>
|
||||
GtkStackSidebar
|
||||
GtkStackSidebarClass
|
||||
gtk_stack_sidebar_new
|
||||
gtk_stack_sidebar_set_stack
|
||||
gtk_stack_sidebar_get_stack
|
||||
<FILE>gtksidebar</FILE>
|
||||
GtkSidebar
|
||||
GtkSidebarClass
|
||||
gtk_sidebar_new
|
||||
gtk_sidebar_set_stack
|
||||
gtk_sidebar_get_stack
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_STACK_SIDEBAR
|
||||
GTK_STACK_SIDEBAR
|
||||
GTK_STACK_SIDEBAR_CLASS
|
||||
GTK_IS_STACK_SIDEBAR
|
||||
GTK_IS_STACK_SIDEBAR_CLASS
|
||||
GTK_STACK_SIDEBAR_GET_CLASS
|
||||
GTK_TYPE_SIDEBAR
|
||||
GTK_SIDEBAR
|
||||
GTK_SIDEBAR_CLASS
|
||||
GTK_IS_SIDEBAR
|
||||
GTK_IS_SIDEBAR_CLASS
|
||||
GTK_SIDEBAR_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkStackSidebarPrivate
|
||||
gtk_stack_sidebar_get_type
|
||||
GtkSidebarPrivate
|
||||
gtk_sidebar_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -8364,9 +8236,10 @@ gtk_gl_area_new
|
||||
gtk_gl_area_get_context
|
||||
gtk_gl_area_make_current
|
||||
gtk_gl_area_queue_render
|
||||
gtk_gl_area_attach_buffers
|
||||
gtk_gl_area_set_error
|
||||
gtk_gl_area_get_error
|
||||
gtk_gl_area_set_profile
|
||||
gtk_gl_area_get_profile
|
||||
<SUBSECTION>
|
||||
gtk_gl_area_set_has_alpha
|
||||
gtk_gl_area_get_has_alpha
|
||||
@@ -8376,13 +8249,10 @@ gtk_gl_area_set_has_stencil_buffer
|
||||
gtk_gl_area_get_has_stencil_buffer
|
||||
gtk_gl_area_set_auto_render
|
||||
gtk_gl_area_get_auto_render
|
||||
gtk_gl_area_get_required_version
|
||||
gtk_gl_area_set_required_version
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_GL_AREA
|
||||
GTK_GL_AREA
|
||||
GTK_GL_AREA_CLASS
|
||||
GTK_GL_AREA_GET_CLASS
|
||||
GTK_IS_GL_AREA
|
||||
GTK_IS_GL_AREA_CLASS
|
||||
<SUBSECTION Private>
|
||||
|
||||
@@ -173,7 +173,7 @@ gtk_separator_get_type
|
||||
gtk_separator_menu_item_get_type
|
||||
gtk_separator_tool_item_get_type
|
||||
gtk_settings_get_type
|
||||
gtk_stack_sidebar_get_type
|
||||
gtk_sidebar_get_type
|
||||
gtk_size_group_get_type
|
||||
@ENABLE_ON_X11@gtk_socket_get_type
|
||||
gtk_spin_button_get_type
|
||||
|
||||
@@ -4,21 +4,21 @@
|
||||
]>
|
||||
<refentry id="chap-input-handling">
|
||||
<refmeta>
|
||||
<refentrytitle>The GTK+ Input and Event Handling Model</refentrytitle>
|
||||
<refentrytitle>The GTK+ Input Handling Model</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>GTK Library</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>The GTK+ Input and Event Handling Model</refname>
|
||||
<refname>The GTK+ Input Handling Model</refname>
|
||||
<refpurpose>
|
||||
GTK+ input and event handling in detail
|
||||
GTK+ input handling in detail
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
|
||||
<refsect1 id="input-overview">
|
||||
<title>Overview of GTK+ input and event handling</title>
|
||||
<title>Overview of GTK+ input handling</title>
|
||||
|
||||
<para>
|
||||
This chapter describes in detail how GTK+ handles input. If you are interested
|
||||
@@ -64,20 +64,20 @@
|
||||
GDK translates these raw windowing system events into #GdkEvents.
|
||||
Typical input events are:
|
||||
<simplelist>
|
||||
<member>#GdkEventButton</member>
|
||||
<member>#GdkEventMotion</member>
|
||||
<member>#GdkEventCrossing</member>
|
||||
<member>#GdkEventKey</member>
|
||||
<member>#GdkEventFocus</member>
|
||||
<member>#GdkEventTouch</member>
|
||||
<member>GdkEventButton</member>
|
||||
<member>GdkEventMotion</member>
|
||||
<member>GdkEventCrossing</member>
|
||||
<member>GdkEventKey</member>
|
||||
<member>GdkEventFocus</member>
|
||||
<member>GdkEventTouch</member>
|
||||
</simplelist>
|
||||
</para>
|
||||
<para>
|
||||
Additionally, GDK/GTK synthesizes other signals to let know whether
|
||||
grabs (system-wide or in-app) are taking input away:
|
||||
<simplelist>
|
||||
<member>#GdkEventGrabBroken</member>
|
||||
<member>#GtkWidget::grab-notify</member>
|
||||
<member>GdkEventGrabBroken</member>
|
||||
<member>GtkWidget::grab-notify</member>
|
||||
</simplelist>
|
||||
</para>
|
||||
<para>
|
||||
@@ -87,167 +87,80 @@
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2 id="event-propagation">
|
||||
<refsect2>
|
||||
<title>Event propagation</title>
|
||||
|
||||
<para>
|
||||
For widgets which have a #GdkWindow set, events are received from the
|
||||
windowing system and passed to gtk_main_do_event(). See its documentation
|
||||
for details of what it does: compression of enter/leave events,
|
||||
identification of the widget receiving the event, pushing the event onto a
|
||||
stack for gtk_get_current_event(), and propagating the event to the
|
||||
widget.
|
||||
When GTK+ receives an event, it determines the target widget that
|
||||
it is directed to. Unless grabs are involved, this is done by finding
|
||||
the widget to which the window of the event belongs.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
When a GDK backend produces an input event, it is tied to a #GdkDevice and
|
||||
a #GdkWindow, which in turn represents a windowing system surface in the
|
||||
backend. If a widget has grabbed the current input device, or all input
|
||||
devices, the event is propagated to that #GtkWidget. Otherwise, it is
|
||||
propagated to the the #GtkWidget which called gtk_widget_register_window()
|
||||
on the #GdkWindow receiving the event.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Grabs are implemented for each input device, and globally. A grab for a
|
||||
specific input device (gtk_device_grab_add()), is sent events in
|
||||
preference to a global grab (gtk_grab_add()). Input grabs only have effect
|
||||
within the #GtkWindowGroup containing the #GtkWidget which registered the
|
||||
event’s #GdkWindow. If this #GtkWidget is a child of the grab widget, the
|
||||
event is propagated to the child — this is the basis for propagating
|
||||
events within modal dialogs.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
An event is propagated to a widget using gtk_propagate_event().
|
||||
Propagation differs between event types: key events (%GDK_KEY_PRESS,
|
||||
%GDK_KEY_RELEASE) are delivered to the top-level #GtkWindow; other events
|
||||
are propagated down and up the widget hierarchy in three phases (see
|
||||
#GtkPropagationPhase).
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For key events, the top-level window’s default #GtkWindow::key-press-event
|
||||
and #GtkWindow::key-release-event signal handlers handle mnemonics and
|
||||
accelerators first. Other key presses are then passed to
|
||||
gtk_window_propagate_key_event() which propagates the event upwards from
|
||||
the window’s current focus widget (gtk_window_get_focus()) to the
|
||||
top-level.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For other events, in the first phase (the “capture” phase) the event is
|
||||
delivered to each widget from the top-most (for example, the top-level
|
||||
#GtkWindow or grab widget) down to the target #GtkWidget.
|
||||
<link linkend="event-controllers-and-gestures">Gestures</link> that are
|
||||
attached with %GTK_PHASE_CAPTURE get a chance to react to the event.
|
||||
The event is then propagated from the toplevel window down to the
|
||||
target widget. In this phase, which is known as the “capture” phase,
|
||||
gestures that are attached with GTK_PHASE_CAPTURE get a chance
|
||||
to react to the event.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
After the “capture” phase, the widget that was intended to be the
|
||||
destination of the event will run gestures attached to it with
|
||||
%GTK_PHASE_TARGET. This is known as the “target” phase, and only
|
||||
happens on that widget.
|
||||
destination of the event will let run gestures attached to it with
|
||||
GTK_PHASE_TARGET. This is known as the “target” phase, and does only
|
||||
happen on that widget.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Next, the #GtkWidget::event signal is emitted, then the appropriate signal
|
||||
for the event in question, for example #GtkWidget::motion-notify-event.
|
||||
Handling these signals was the primary way to handle input in GTK+ widgets
|
||||
before gestures were introduced. If the widget is realized, the
|
||||
#GtkWidget::event-after signal is emitted. The signals are emitted from
|
||||
the target widget up to the top-level, as part of the “bubble” phase.
|
||||
Next, the appropriate event signal is emitted for the event in question,
|
||||
e.g. “motion-notify-event”. Handling these signals was the primary
|
||||
way to handle input in GTK+ widgets before gestures were introduced.
|
||||
The signals are emitted from the target widget up to the toplevel,
|
||||
until a signal handler indicates that it has handled the event, by
|
||||
returning GDK_EVENT_STOP.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The default handlers for the event signals send the event
|
||||
to gestures that are attached with %GTK_PHASE_BUBBLE. Therefore,
|
||||
to gestures that are attached with GTK_PHASE_BUBBLE. Therefore,
|
||||
gestures in the “bubble” phase are only used if the widget does
|
||||
not have its own event handlers, or takes care to chain up to the
|
||||
default #GtkWidget handlers.
|
||||
default GtkWidget handlers.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Events are not delivered to a widget which is insensitive or unmapped.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Any time during the propagation phase, a widget may indicate that a
|
||||
Anytime during the propagation phase, a widget may indicate that a
|
||||
received event was consumed and propagation should therefore be stopped.
|
||||
In traditional event handlers, this is hinted by returning %GDK_EVENT_STOP.
|
||||
If gestures are used, this may happen when the widget tells the gesture
|
||||
In traditional event handlers, this is hinted by returning GDK_EVENT_STOP,
|
||||
if gestures are used, this may happen when the widget tells the gesture
|
||||
to claim the event touch sequence (or the pointer events) for its own. See the
|
||||
"gesture states" section below to know more of the latter.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2 id="event-masks">
|
||||
<title>Event masks</title>
|
||||
|
||||
<para>
|
||||
Each widget instance has a basic event mask and another per input device,
|
||||
which determine the types of input event it receives. Each event mask set
|
||||
on a widget is added to the corresponding (basic or per-device) event mask
|
||||
for the widget’s #GdkWindow, and all child #GdkWindows.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If a widget is windowless (gtk_widget_get_has_window() returns %FALSE) and
|
||||
an application wants to receive custom events on it, it must be placed
|
||||
inside a #GtkEventBox to receive the events, and an appropriate event mask
|
||||
must be set on the box. When implementing a widget, use a %GDK_INPUT_ONLY
|
||||
#GdkWindow to receive the events instead.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Filtering events against event masks happens inside #GdkWindow, which
|
||||
exposes event masks to the windowing system to reduce the number of events
|
||||
GDK receives from it. On receiving an event, it is filtered against the
|
||||
#GdkWindow’s mask for the input device, if set. Otherwise, it is filtered
|
||||
against the #GdkWindow’s basic event mask.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
This means that widgets must add to the event mask for each event type
|
||||
they expect to receive, using gtk_widget_set_events() or
|
||||
gtk_widget_add_events() to preserve the existing mask. Widgets which are
|
||||
aware of floating devices should use gtk_widget_set_device_events() or
|
||||
gtk_widget_add_device_events(), and must explicitly enable the device
|
||||
using gtk_widget_set_device_enabled(). See the #GdkDeviceManager
|
||||
documentation for more information.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
All standard widgets set the event mask for all events they expect to
|
||||
receive, and it is not necessary to modify this. Masks should be set when
|
||||
implementing a new widget.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2>
|
||||
<title>Touch events</title>
|
||||
|
||||
<para>
|
||||
Touch events are emitted as events of type %GDK_TOUCH_BEGIN, %GDK_TOUCH_UPDATE or
|
||||
%GDK_TOUCH_END, those events contain an “event sequence” that univocally identifies
|
||||
Touch events are emitted as events of type GDK_TOUCH_BEGIN, GDK_TOUCH_UPDATE or
|
||||
GDK_TOUCH_END, those events contain an “event sequence” that univocally identifies
|
||||
the physical touch until it is lifted from the device.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
On some windowing platforms, multitouch devices perform pointer emulation, this works
|
||||
by granting a “pointer emulating” hint to one of the currently interacting touch
|
||||
sequences, which will be reported on every #GdkEventTouch event from that sequence. By
|
||||
default, if a widget didn't request touch events by setting %GDK_TOUCH_MASK on its
|
||||
event mask and didn't override #GtkWidget::touch-event, GTK+ will transform these
|
||||
“pointer emulating” events into semantically similar #GdkEventButton and #GdkEventMotion
|
||||
events. Depending on %GDK_TOUCH_MASK being in the event mask or not, non-pointer-emulating
|
||||
sequences, which will be reported on every GdkEventTouch event from that sequence. By
|
||||
default, if a widget didn't request touch events by setting GDK_TOUCH_MASK on its
|
||||
event mask and didn't override GtkWidget::touch-event, GTK+ will transform these
|
||||
“pointer emulating” events into semantically similar GdkEventButton and GdkEventMotion
|
||||
events. Depending on GDK_TOUCH_MASK being in the event mask or not, non-pointer-emulating
|
||||
sequences could still trigger gestures or just get filtered out, regardless of the widget
|
||||
not handling those directly.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If the widget sets %GDK_TOUCH_MASK on its event mask and doesn't chain up on
|
||||
#GtkWidget::touch-event, only touch events will be received, and no pointer emulation
|
||||
If the widget sets GDK_TOUCH_MASK on its event mask and doesn't chain up on
|
||||
GtkWidget::touch-event, only touch events will be received, and no pointer emulation
|
||||
will be performed.
|
||||
</para>
|
||||
</refsect2>
|
||||
@@ -258,11 +171,11 @@
|
||||
<para>
|
||||
Grabs are a method to claim all input events from a device, they happen
|
||||
either implicitly on pointer and touch devices, or explicitly. Implicit grabs
|
||||
happen on user interaction, when a #GdkEventButtonPress happens, all events from
|
||||
then on, until after the corresponding #GdkEventButtonRelease, will be reported
|
||||
happen on user interaction, when a GdkEventButtonPress happens, all events from
|
||||
then on, until after the corresponding GdkEventButtonRelease, will be reported
|
||||
to the widget that got the first event. Likewise, on touch events, every
|
||||
#GdkEventSequence will deliver only events to the widget that received its
|
||||
%GDK_TOUCH_BEGIN event.
|
||||
GdkEventSequence will deliver only events to the widget that received its
|
||||
GDK_TOUCH_BEGIN event.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -279,8 +192,8 @@
|
||||
point somewhere else, even while the pointer/touch device is already grabbed.
|
||||
This makes it necessary for widgets to handle the cancellation of any ongoing
|
||||
interaction. Depending on whether a GTK or GDK grab is causing this, the
|
||||
widget will respectively receive a #GtkWidget::grab-notify signal, or a
|
||||
#GdkEventGrabBroken event.
|
||||
widget will respectively receive a GtkWidget::grab-notify signal, or a
|
||||
GdkEventGrabBroken event.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -296,12 +209,12 @@
|
||||
<!-- mnemonics, accelerators, bindings -->
|
||||
</refsect2>
|
||||
|
||||
<refsect2 id="event-controllers-and-gestures">
|
||||
<refsect2>
|
||||
<title>Event controllers and gestures</title>
|
||||
|
||||
<para>
|
||||
Event controllers are standalone objects that can perform specific actions
|
||||
upon received #GdkEvents. These are tied to a #GtkWidget, and can be told of
|
||||
upon received GdkEvents. These are tied to a GtkWidget, and can be told of
|
||||
the event propagation phase at which they will manage the events.
|
||||
</para>
|
||||
|
||||
@@ -357,7 +270,7 @@
|
||||
Alternatively, or at a later point in time, the widget may choose to deny the touch
|
||||
sequences, thus letting those go through again in event propagation. When this happens
|
||||
in the capture phase, and if there are no other claiming gestures in the widget,
|
||||
a %GDK_TOUCH_BEGIN/%GDK_BUTTON_PRESS event will be emulated and
|
||||
a GDK_TOUCH_BEGIN/GDK_BUTTON_PRESS event will be emulated and
|
||||
propagated downwards, in order to preserve consistency.
|
||||
</para>
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
widgets have been deprecated. These deprecations are clearly spelled
|
||||
out in the API reference, with hints about the recommended replacements.
|
||||
The API reference for GTK+ 2 also includes an
|
||||
<ulink url="https://developer.gnome.org/gtk2/2.24/api-index-deprecated.html">index</ulink> of all deprecated symbols.
|
||||
<ulink url="http://developer.gnome.org/gtk/2.24/api-index-deprecated.html">index</ulink> of all deprecated symbols.
|
||||
</para>
|
||||
<para>
|
||||
To verify that your program does not use any deprecated symbols,
|
||||
|
||||
@@ -31,7 +31,7 @@ or environment variables.
|
||||
|
||||
<para>
|
||||
For up-to-date information about the current status of this port, see the
|
||||
<ulink url="https://wiki.gnome.org/Projects/GTK+/OSX">project page</ulink>.
|
||||
<ulink url="http://live.gnome.org/GTK+/OSX">project page</ulink>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
@@ -36,7 +36,7 @@ some additional commandline options.
|
||||
|
||||
<para>
|
||||
A list of modules to load in addition to those specified in the
|
||||
<envar>GTK3_MODULES</envar> environment variable and the
|
||||
<envar>GTK_MODULES</envar> environment variable and the
|
||||
<literal>gtk-modules</literal> setting.
|
||||
</para>
|
||||
</formalpara>
|
||||
@@ -223,24 +223,14 @@ additional environment variables.
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><envar>GTK3_MODULES</envar></title>
|
||||
<title><envar>GTK_MODULES</envar></title>
|
||||
|
||||
<para>
|
||||
A list of modules to load. Note that GTK+ also allows to specify modules to load via a commandline option (<option>--gtk-module</option>) and with the <literal>gtk-modules</literal> setting.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><envar>GTK_MODULES</envar></title>
|
||||
|
||||
<para>
|
||||
A list of modules to load in addition to the ones in the <envar>GTK3_MODULES</envar> variable.
|
||||
</para>
|
||||
<warning>
|
||||
Note that this environment variable is read by GTK+ 2.x too,
|
||||
which may not have the same set of modules available for loading.
|
||||
Use <envar>GTK3_MODULES</envar> for modules that are only compatible
|
||||
with GTK+ 3.
|
||||
</warning>
|
||||
</formalpara>
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
<link linkend="GtkStackSwitcher">
|
||||
<inlinegraphic fileref="stackswitcher.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
<link linkend="GtkStackSidebar">
|
||||
<link linkend="GtkSidebar">
|
||||
<inlinegraphic fileref="sidebar.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
<link linkend="GtkTreeView">
|
||||
|
||||
@@ -110,7 +110,7 @@ in 256 color mode.
|
||||
<para>
|
||||
More information about GTK+ on Windows, including detailed build
|
||||
instructions, binary downloads, etc, can be found
|
||||
<ulink url="https://wiki.gnome.org/Projects/GTK+/Win32">online</ulink>.
|
||||
<ulink url="http://live.gnome.org/GTK+/Win32">online</ulink>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
@@ -1407,8 +1407,8 @@ create_sidebar (void)
|
||||
gtk_widget_show (view);
|
||||
gtk_stack_add_titled (GTK_STACK (stack), view, "page2", "Page 2");
|
||||
|
||||
sidebar = gtk_stack_sidebar_new ();
|
||||
gtk_stack_sidebar_set_stack (GTK_STACK_SIDEBAR (sidebar), GTK_STACK (stack));
|
||||
sidebar = gtk_sidebar_new ();
|
||||
gtk_sidebar_set_stack (GTK_SIDEBAR (sidebar), GTK_STACK (stack));
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
|
||||
@@ -11,14 +11,12 @@
|
||||
<section>
|
||||
<item>
|
||||
<attribute name='label' translatable='yes'>_About Bloatpad</attribute>
|
||||
<attribute name='hidden-when'>macos-menubar</attribute>
|
||||
<attribute name='action'>app.about</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name='label' translatable='yes'>_Quit</attribute>
|
||||
<attribute name='hidden-when'>macos-menubar</attribute>
|
||||
<attribute name='action'>app.quit</attribute>
|
||||
</item>
|
||||
</section>
|
||||
|
||||
@@ -129,15 +129,17 @@ close_window (void)
|
||||
gtk_main_quit ();
|
||||
}
|
||||
|
||||
static void
|
||||
activate (GtkApplication *app,
|
||||
gpointer user_data)
|
||||
int
|
||||
main (int argc,
|
||||
char *argv[])
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *drawing_area;
|
||||
GtkWidget *da;
|
||||
|
||||
window = gtk_application_window_new (app);
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Drawing Area");
|
||||
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL);
|
||||
@@ -148,46 +150,35 @@ activate (GtkApplication *app,
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
||||
gtk_container_add (GTK_CONTAINER (window), frame);
|
||||
|
||||
drawing_area = gtk_drawing_area_new ();
|
||||
da = gtk_drawing_area_new ();
|
||||
/* set a minimum size */
|
||||
gtk_widget_set_size_request (drawing_area, 100, 100);
|
||||
gtk_widget_set_size_request (da, 100, 100);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (frame), drawing_area);
|
||||
gtk_container_add (GTK_CONTAINER (frame), da);
|
||||
|
||||
/* Signals used to handle the backing surface */
|
||||
g_signal_connect (drawing_area, "draw",
|
||||
g_signal_connect (da, "draw",
|
||||
G_CALLBACK (draw_cb), NULL);
|
||||
g_signal_connect (drawing_area,"configure-event",
|
||||
g_signal_connect (da,"configure-event",
|
||||
G_CALLBACK (configure_event_cb), NULL);
|
||||
|
||||
/* Event signals */
|
||||
g_signal_connect (drawing_area, "motion-notify-event",
|
||||
g_signal_connect (da, "motion-notify-event",
|
||||
G_CALLBACK (motion_notify_event_cb), NULL);
|
||||
g_signal_connect (drawing_area, "button-press-event",
|
||||
g_signal_connect (da, "button-press-event",
|
||||
G_CALLBACK (button_press_event_cb), NULL);
|
||||
|
||||
/* Ask to receive events the drawing area doesn't normally
|
||||
* subscribe to. In particular, we need to ask for the
|
||||
* button press and motion notify events that want to handle.
|
||||
*/
|
||||
gtk_widget_set_events (drawing_area, gtk_widget_get_events (drawing_area)
|
||||
| GDK_BUTTON_PRESS_MASK
|
||||
| GDK_POINTER_MOTION_MASK);
|
||||
gtk_widget_set_events (da, gtk_widget_get_events (da)
|
||||
| GDK_BUTTON_PRESS_MASK
|
||||
| GDK_POINTER_MOTION_MASK);
|
||||
|
||||
gtk_widget_show_all (window);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char **argv)
|
||||
{
|
||||
GtkApplication *app;
|
||||
int status;
|
||||
|
||||
app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
|
||||
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
|
||||
status = g_application_run (G_APPLICATION (app), argc, argv);
|
||||
g_object_unref (app);
|
||||
|
||||
return status;
|
||||
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -7,17 +7,23 @@ print_hello (GtkWidget *widget,
|
||||
g_print ("Hello World\n");
|
||||
}
|
||||
|
||||
static void
|
||||
activate (GtkApplication *app,
|
||||
gpointer user_data)
|
||||
int
|
||||
main (int argc,
|
||||
char *argv[])
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkWidget *grid;
|
||||
GtkWidget *button;
|
||||
|
||||
/* This is called in all GTK applications. Arguments are parsed
|
||||
* from the command line and are returned to the application.
|
||||
*/
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
/* create a new window, and set its title */
|
||||
window = gtk_application_window_new (app);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Window");
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Grid");
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
|
||||
|
||||
/* Here we construct the container that is going pack our buttons */
|
||||
@@ -43,7 +49,7 @@ activate (GtkApplication *app,
|
||||
gtk_grid_attach (GTK_GRID (grid), button, 1, 0, 1, 1);
|
||||
|
||||
button = gtk_button_new_with_label ("Quit");
|
||||
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (gtk_main_quit), NULL);
|
||||
|
||||
/* Place the Quit button in the grid cell (0, 1), and make it
|
||||
* span 2 columns.
|
||||
@@ -57,19 +63,11 @@ activate (GtkApplication *app,
|
||||
*/
|
||||
gtk_widget_show_all (window);
|
||||
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char **argv)
|
||||
{
|
||||
GtkApplication *app;
|
||||
int status;
|
||||
|
||||
app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
|
||||
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
|
||||
status = g_application_run (G_APPLICATION (app), argc, argv);
|
||||
g_object_unref (app);
|
||||
|
||||
return status;
|
||||
/* All GTK applications must have a gtk_main(). Control ends here
|
||||
* and waits for an event to occur (like a key press or a mouse event),
|
||||
* until gtk_main_quit() is called.
|
||||
*/
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
/* This is a callback function. The data arguments are ignored
|
||||
* in this example. More on callbacks below.
|
||||
*/
|
||||
static void
|
||||
print_hello (GtkWidget *widget,
|
||||
gpointer data)
|
||||
@@ -7,40 +10,95 @@ print_hello (GtkWidget *widget,
|
||||
g_print ("Hello World\n");
|
||||
}
|
||||
|
||||
static void
|
||||
activate (GtkApplication *app,
|
||||
gpointer user_data)
|
||||
static gboolean
|
||||
on_delete_event (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkWidget *button;
|
||||
GtkWidget *button_box;
|
||||
/* If you return FALSE in the "delete_event" signal handler,
|
||||
* GTK will emit the "destroy" signal. Returning TRUE means
|
||||
* you don't want the window to be destroyed.
|
||||
*
|
||||
* This is useful for popping up 'are you sure you want to quit?'
|
||||
* type dialogs.
|
||||
*/
|
||||
|
||||
window = gtk_application_window_new (app);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Window");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 200, 200);
|
||||
g_print ("delete event occurred\n");
|
||||
|
||||
button_box = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
|
||||
gtk_container_add (GTK_CONTAINER (window), button_box);
|
||||
|
||||
button = gtk_button_new_with_label ("Hello World");
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL);
|
||||
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
|
||||
gtk_container_add (GTK_CONTAINER (button_box), button);
|
||||
|
||||
gtk_widget_show_all (window);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char **argv)
|
||||
main (int argc,
|
||||
char *argv[])
|
||||
{
|
||||
GtkApplication *app;
|
||||
int status;
|
||||
/* GtkWidget is the storage type for widgets */
|
||||
GtkWidget *window;
|
||||
GtkWidget *button;
|
||||
|
||||
app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
|
||||
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
|
||||
status = g_application_run (G_APPLICATION (app), argc, argv);
|
||||
g_object_unref (app);
|
||||
/* This is called in all GTK applications. Arguments are parsed
|
||||
* from the command line and are returned to the application.
|
||||
*/
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
return status;
|
||||
/* create a new window, and set its title */
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Hello");
|
||||
|
||||
/* When the window emits the "delete-event" signal (which is emitted
|
||||
* by GTK+ in response to an event coming from the window manager,
|
||||
* usually as a result of clicking the "close" window control), we
|
||||
* ask it to call the on_delete_event() function as defined above.
|
||||
*
|
||||
* The data passed to the callback function is NULL and is ignored
|
||||
* in the callback function.
|
||||
*/
|
||||
g_signal_connect (window, "delete-event", G_CALLBACK (on_delete_event), NULL);
|
||||
|
||||
/* Here we connect the "destroy" event to the gtk_main_quit() function.
|
||||
*
|
||||
* This signal is emitted when we call gtk_widget_destroy() on the window,
|
||||
* or if we return FALSE in the "delete_event" callback.
|
||||
*/
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
|
||||
|
||||
/* Sets the border width of the window. */
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
|
||||
|
||||
/* Creates a new button with the label "Hello World". */
|
||||
button = gtk_button_new_with_label ("Hello World");
|
||||
|
||||
/* When the button receives the "clicked" signal, it will call the
|
||||
* function print_hello() passing it NULL as its argument.
|
||||
*
|
||||
* The print_hello() function is defined above.
|
||||
*/
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL);
|
||||
|
||||
/* The g_signal_connect_swapped() function will connect the "clicked" signal
|
||||
* of the button to the gtk_widget_destroy() function; instead of calling it
|
||||
* using the button as its argument, it will swap it with the user data
|
||||
* argument. This will cause the window to be destroyed by calling
|
||||
* gtk_widget_destroy() on the window.
|
||||
*/
|
||||
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
|
||||
|
||||
/* This packs the button into the window. A GtkWindow inherits from GtkBin,
|
||||
* which is a special container that can only have one child
|
||||
*/
|
||||
gtk_container_add (GTK_CONTAINER (window), button);
|
||||
|
||||
/* The final step is to display this newly created widget... */
|
||||
gtk_widget_show (button);
|
||||
|
||||
/* ... and the window */
|
||||
gtk_widget_show (window);
|
||||
|
||||
/* All GTK applications must have a gtk_main(). Control ends here
|
||||
* and waits for an event to occur (like a key press or a mouse event),
|
||||
* until gtk_main_quit() is called.
|
||||
*/
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -267,19 +267,16 @@ disable_plugin (const gchar *name)
|
||||
plugin_menu = find_plugin_menu ();
|
||||
if (plugin_menu)
|
||||
{
|
||||
const gchar *id;
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < g_menu_model_get_n_items (plugin_menu); i++)
|
||||
{
|
||||
gchar *id;
|
||||
if (g_menu_model_get_item_attribute (plugin_menu, i, "id", "s", &id))
|
||||
if (g_menu_model_get_item_attribute (plugin_menu, i, "id", "s", &id) &&
|
||||
g_strcmp0 (id, name) == 0)
|
||||
{
|
||||
if (g_strcmp0 (id, name) == 0)
|
||||
{
|
||||
g_menu_remove (G_MENU (plugin_menu), i);
|
||||
g_print ("Menus of '%s' plugin removed\n", name);
|
||||
}
|
||||
g_free (id);
|
||||
g_menu_remove (G_MENU (plugin_menu), i);
|
||||
g_print ("Menus of '%s' plugin removed\n", name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -359,7 +356,7 @@ configure_plugins (GSimpleAction *action,
|
||||
{
|
||||
g_warning ("%s", error->message);
|
||||
g_error_free (error);
|
||||
goto out;
|
||||
return;
|
||||
}
|
||||
|
||||
dialog = (GtkWidget *)gtk_builder_get_object (builder, "plugin-dialog");
|
||||
@@ -373,9 +370,6 @@ configure_plugins (GSimpleAction *action,
|
||||
g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
|
||||
|
||||
gtk_window_present (GTK_WINDOW (dialog));
|
||||
|
||||
out:
|
||||
g_object_unref (builder);
|
||||
}
|
||||
|
||||
static GActionEntry app_entries[] = {
|
||||
|
||||
@@ -1,28 +1,21 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static void
|
||||
activate (GtkApplication* app,
|
||||
gpointer user_data)
|
||||
int
|
||||
main (int argc,
|
||||
char *argv[])
|
||||
{
|
||||
GtkWidget *window;
|
||||
|
||||
window = gtk_application_window_new (app);
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Window");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 200, 200);
|
||||
gtk_widget_show_all (window);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char **argv)
|
||||
{
|
||||
GtkApplication *app;
|
||||
int status;
|
||||
|
||||
app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
|
||||
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
|
||||
status = g_application_run (G_APPLICATION (app), argc, argv);
|
||||
g_object_unref (app);
|
||||
|
||||
return status;
|
||||
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
|
||||
|
||||
gtk_widget_show (window);
|
||||
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,6 @@ LDADD = \
|
||||
#
|
||||
gdk_public_h_sources = \
|
||||
gdk.h \
|
||||
gdk-autocleanup.h \
|
||||
gdkapplaunchcontext.h \
|
||||
gdkcairo.h \
|
||||
gdkcursor.h \
|
||||
|
||||
@@ -456,11 +456,10 @@ main (int argc, char *argv[])
|
||||
if (display == NULL)
|
||||
{
|
||||
#ifdef G_OS_UNIX
|
||||
if (g_unix_socket_address_abstract_names_supported ())
|
||||
display = ":0";
|
||||
else
|
||||
display = ":0";
|
||||
#else
|
||||
display = ":tcp";
|
||||
#endif
|
||||
display = ":tcp";
|
||||
}
|
||||
|
||||
if (g_str_has_prefix (display, ":tcp"))
|
||||
|
||||
@@ -110,11 +110,10 @@ _gdk_broadway_server_new (const char *display, GError **error)
|
||||
if (display == NULL)
|
||||
{
|
||||
#ifdef G_OS_UNIX
|
||||
if (g_unix_socket_address_abstract_names_supported ())
|
||||
display = ":0";
|
||||
else
|
||||
display = ":0";
|
||||
#else
|
||||
display = ":tcp";
|
||||
#endif
|
||||
display = ":tcp";
|
||||
}
|
||||
|
||||
if (g_str_has_prefix (display, ":tcp"))
|
||||
@@ -545,13 +544,13 @@ map_named_shm (char *name, gsize size)
|
||||
|
||||
#ifdef HAVE_POSIX_FALLOCATE
|
||||
res = posix_fallocate (fd, 0, size);
|
||||
if (res != 0 && errno == ENOSPC)
|
||||
if (res != 0)
|
||||
{
|
||||
shm_unlink (name);
|
||||
g_error ("Not enough shared memory for window surface");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
ptr = mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
|
||||
|
||||
(void) close(fd);
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GI_SCANNER__
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkAppLaunchContext, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkCursor, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDevice, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDeviceManager, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDisplay, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDisplayManager, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDragContext, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkFrameClock, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkGLContext, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkKeymap, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkScreen, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkVisual, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkWindow, g_object_unref)
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkEvent, gdk_event_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkFrameTimings, gdk_frame_timings_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkRGBA, gdk_rgba_free)
|
||||
|
||||
#endif
|
||||
@@ -62,8 +62,6 @@
|
||||
#include <gdk/deprecated/gdkcolor.h>
|
||||
#endif
|
||||
|
||||
#include <gdk/gdk-autocleanup.h>
|
||||
|
||||
#undef __GDK_H_INSIDE__
|
||||
|
||||
#endif /* __GDK_H__ */
|
||||
|
||||
@@ -185,9 +185,6 @@ gdk_cairo_surface_paint_pixbuf (cairo_surface_t *surface,
|
||||
int n_channels;
|
||||
int j;
|
||||
|
||||
if (cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS)
|
||||
return;
|
||||
|
||||
/* This function can't just copy any pixbuf to any surface, be
|
||||
* sure to read the invariants here before calling it */
|
||||
|
||||
|
||||
114
gdk/gdkdevice.c
114
gdk/gdkdevice.c
@@ -86,9 +86,7 @@ enum {
|
||||
PROP_INPUT_SOURCE,
|
||||
PROP_INPUT_MODE,
|
||||
PROP_HAS_CURSOR,
|
||||
PROP_N_AXES,
|
||||
PROP_VENDOR_ID,
|
||||
PROP_PRODUCT_ID
|
||||
PROP_N_AXES
|
||||
};
|
||||
|
||||
|
||||
@@ -238,36 +236,6 @@ gdk_device_class_init (GdkDeviceClass *klass)
|
||||
P_("Number of axes in the device"),
|
||||
0, G_MAXUINT, 0,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
||||
/**
|
||||
* GdkDevice:vendor-id:
|
||||
*
|
||||
* Vendor ID of this device, see gdk_device_get_vendor_id().
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_VENDOR_ID,
|
||||
g_param_spec_string ("vendor-id",
|
||||
P_("Vendor ID"),
|
||||
P_("Vendor ID"),
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
/**
|
||||
* GdkDevice:product-id:
|
||||
*
|
||||
* Product ID of this device, see gdk_device_get_product_id().
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_PRODUCT_ID,
|
||||
g_param_spec_string ("product-id",
|
||||
P_("Product ID"),
|
||||
P_("Product ID"),
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
|
||||
/**
|
||||
* GdkDevice::changed:
|
||||
@@ -325,9 +293,6 @@ gdk_device_dispose (GObject *object)
|
||||
device->name = NULL;
|
||||
device->keys = NULL;
|
||||
|
||||
g_clear_pointer (&device->vendor_id, g_free);
|
||||
g_clear_pointer (&device->product_id, g_free);
|
||||
|
||||
G_OBJECT_CLASS (gdk_device_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
@@ -364,12 +329,6 @@ gdk_device_set_property (GObject *object,
|
||||
case PROP_HAS_CURSOR:
|
||||
device->has_cursor = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_VENDOR_ID:
|
||||
device->vendor_id = g_value_dup_string (value);
|
||||
break;
|
||||
case PROP_PRODUCT_ID:
|
||||
device->product_id = g_value_dup_string (value);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
@@ -413,12 +372,6 @@ gdk_device_get_property (GObject *object,
|
||||
case PROP_N_AXES:
|
||||
g_value_set_uint (value, device->axes->len);
|
||||
break;
|
||||
case PROP_VENDOR_ID:
|
||||
g_value_set_string (value, device->vendor_id);
|
||||
break;
|
||||
case PROP_PRODUCT_ID:
|
||||
g_value_set_string (value, device->product_id);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
@@ -1804,68 +1757,3 @@ gdk_device_get_last_event_window (GdkDevice *device)
|
||||
|
||||
return info->window_under_pointer;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_device_get_vendor_id:
|
||||
* @device: a slave #GdkDevice
|
||||
*
|
||||
* Returns the vendor ID of this device, or %NULL if this information couldn't
|
||||
* be obtained. This ID is retrieved from the device, and is thus constant for
|
||||
* it.
|
||||
*
|
||||
* This function, together with gdk_device_get_product_id(), can be used to eg.
|
||||
* compose #GSettings paths to store settings for this device.
|
||||
*
|
||||
* |[<!-- language="C" -->
|
||||
* static GSettings *
|
||||
* get_device_settings (GdkDevice *device)
|
||||
* {
|
||||
* const gchar *vendor, *product;
|
||||
* GSettings *settings;
|
||||
* GdkDevice *device;
|
||||
* gchar *path;
|
||||
*
|
||||
* vendor = gdk_device_get_vendor_id (device);
|
||||
* product = gdk_device_get_product_id (device);
|
||||
*
|
||||
* path = g_strdup_printf ("/org/example/app/devices/%s:%s/", vendor, product);
|
||||
* settings = g_settings_new_with_path (DEVICE_SCHEMA, path);
|
||||
* g_free (path);
|
||||
*
|
||||
* return settings;
|
||||
* }
|
||||
* ]|
|
||||
*
|
||||
* Returns: (nullable): the vendor ID, or %NULL
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
const gchar *
|
||||
gdk_device_get_vendor_id (GdkDevice *device)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
|
||||
g_return_val_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_MASTER, NULL);
|
||||
|
||||
return device->vendor_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_device_get_product_id:
|
||||
* @device: a slave #GdkDevice
|
||||
*
|
||||
* Returns the product ID of this device, or %NULL if this information couldn't
|
||||
* be obtained. This ID is retrieved from the device, and is thus constant for
|
||||
* it. See gdk_device_get_vendor_id() for more information.
|
||||
*
|
||||
* Returns: (nullable): the product ID, or %NULL
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
const gchar *
|
||||
gdk_device_get_product_id (GdkDevice *device)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
|
||||
g_return_val_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_MASTER, NULL);
|
||||
|
||||
return device->product_id;
|
||||
}
|
||||
|
||||
@@ -274,11 +274,6 @@ gboolean gdk_device_grab_info_libgtk_only (GdkDisplay *display,
|
||||
GDK_AVAILABLE_IN_3_12
|
||||
GdkWindow *gdk_device_get_last_event_window (GdkDevice *device);
|
||||
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
const gchar *gdk_device_get_vendor_id (GdkDevice *device);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
const gchar *gdk_device_get_product_id (GdkDevice *device);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_DEVICE_H__ */
|
||||
|
||||
@@ -56,9 +56,6 @@ struct _GdkDevice
|
||||
GList *slaves;
|
||||
GdkDeviceType type;
|
||||
GArray *axes;
|
||||
|
||||
gchar *vendor_id;
|
||||
gchar *product_id;
|
||||
};
|
||||
|
||||
struct _GdkDeviceClass
|
||||
|
||||
@@ -270,12 +270,12 @@ static GdkBackend gdk_backends[] = {
|
||||
#ifdef GDK_WINDOWING_WIN32
|
||||
{ "win32", _gdk_win32_display_open },
|
||||
#endif
|
||||
#ifdef GDK_WINDOWING_WAYLAND
|
||||
{ "wayland", _gdk_wayland_display_open },
|
||||
#endif
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
{ "x11", _gdk_x11_display_open },
|
||||
#endif
|
||||
#ifdef GDK_WINDOWING_WAYLAND
|
||||
{ "wayland", _gdk_wayland_display_open },
|
||||
#endif
|
||||
#ifdef GDK_WINDOWING_MIR
|
||||
{ "mir", _gdk_mir_display_open },
|
||||
#endif
|
||||
|
||||
37
gdk/gdkgl.c
37
gdk/gdkgl.c
@@ -146,8 +146,8 @@ bind_vao (GdkGLContextPaintData *paint_data)
|
||||
static void
|
||||
use_texture_2d_program (GdkGLContextPaintData *paint_data)
|
||||
{
|
||||
static const char *vertex_shader_code =
|
||||
"#version 150\n"
|
||||
const char *vertex_shader_code =
|
||||
"#version 120\n"
|
||||
"uniform sampler2D map;"
|
||||
"attribute vec2 position;\n"
|
||||
"attribute vec2 uv;\n"
|
||||
@@ -156,8 +156,8 @@ use_texture_2d_program (GdkGLContextPaintData *paint_data)
|
||||
" gl_Position = vec4(position, 0, 1);\n"
|
||||
" vUv = uv;\n"
|
||||
"}\n";
|
||||
static const char *fragment_shader_code =
|
||||
"#version 150\n"
|
||||
const char *fragment_shader_code =
|
||||
"#version 120\n"
|
||||
"varying vec2 vUv;\n"
|
||||
"uniform sampler2D map;\n"
|
||||
"void main() {\n"
|
||||
@@ -177,8 +177,8 @@ use_texture_2d_program (GdkGLContextPaintData *paint_data)
|
||||
static void
|
||||
use_texture_rect_program (GdkGLContextPaintData *paint_data)
|
||||
{
|
||||
static const char *vertex_shader_code =
|
||||
"#version 150\n"
|
||||
const char *vertex_shader_code =
|
||||
"#version 120\n"
|
||||
"uniform sampler2DRect map;"
|
||||
"attribute vec2 position;\n"
|
||||
"attribute vec2 uv;\n"
|
||||
@@ -187,8 +187,8 @@ use_texture_rect_program (GdkGLContextPaintData *paint_data)
|
||||
" gl_Position = vec4(position, 0, 1);\n"
|
||||
" vUv = uv;\n"
|
||||
"}\n";
|
||||
static const char *fragment_shader_code =
|
||||
"#version 150\n"
|
||||
const char *fragment_shader_code =
|
||||
"#version 120\n"
|
||||
"varying vec2 vUv;\n"
|
||||
"uniform sampler2DRect map;\n"
|
||||
"void main() {\n"
|
||||
@@ -235,8 +235,8 @@ gdk_gl_texture_quads (GdkGLContext *paint_context,
|
||||
glActiveTexture (GL_TEXTURE0);
|
||||
glUniform1i(program->map_location, 0); /* Use texture unit 0 */
|
||||
|
||||
glEnableVertexAttribArray (program->position_location);
|
||||
glEnableVertexAttribArray (program->uv_location);
|
||||
glEnableVertexAttribArray (0);
|
||||
glEnableVertexAttribArray (1);
|
||||
glBindBuffer (GL_ARRAY_BUFFER, paint_data->tmp_vertex_buffer);
|
||||
|
||||
glVertexAttribPointer (program->position_location, 2, GL_FLOAT, GL_FALSE, sizeof(float) * 4, NULL);
|
||||
@@ -272,8 +272,8 @@ gdk_gl_texture_quads (GdkGLContext *paint_context,
|
||||
|
||||
g_free (vertex_buffer_data);
|
||||
|
||||
glDisableVertexAttribArray (program->position_location);
|
||||
glDisableVertexAttribArray (program->uv_location);
|
||||
glDisableVertexAttribArray (0);
|
||||
glDisableVertexAttribArray (1);
|
||||
}
|
||||
|
||||
/* x,y,width,height describes a rectangle in the gl render buffer
|
||||
@@ -355,7 +355,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
|
||||
|
||||
if (source_type == GL_RENDERBUFFER)
|
||||
{
|
||||
glBindRenderbuffer (GL_RENDERBUFFER, source);
|
||||
glBindRenderbufferEXT (GL_RENDERBUFFER_EXT, source);
|
||||
glGetRenderbufferParameteriv (GL_RENDERBUFFER, GL_RENDERBUFFER_ALPHA_SIZE, &alpha_size);
|
||||
}
|
||||
else if (source_type == GL_TEXTURE)
|
||||
@@ -519,6 +519,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
|
||||
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
|
||||
glEnable (GL_SCISSOR_TEST);
|
||||
glEnable (GL_TEXTURE_2D);
|
||||
|
||||
gdk_window_get_unscaled_size (impl_window, NULL, &unscaled_window_height);
|
||||
|
||||
@@ -586,6 +587,8 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
|
||||
if (alpha_size != 0)
|
||||
glDisable (GL_BLEND);
|
||||
|
||||
glDisable (GL_TEXTURE_2D);
|
||||
|
||||
#undef FLIP_Y
|
||||
|
||||
}
|
||||
@@ -641,7 +644,6 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
|
||||
|
||||
if (clip_region)
|
||||
cairo_region_destroy (clip_region);
|
||||
|
||||
}
|
||||
|
||||
/* This is always called with the paint context current */
|
||||
@@ -662,6 +664,7 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
|
||||
float umax, vmax;
|
||||
gboolean use_texture_rectangle;
|
||||
guint target;
|
||||
|
||||
paint_context = gdk_gl_context_get_current ();
|
||||
if ((_gdk_gl_flags & GDK_GL_SOFTWARE_DRAW_SURFACE) == 0 &&
|
||||
paint_context &&
|
||||
@@ -689,6 +692,7 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
|
||||
target = GL_TEXTURE_2D;
|
||||
|
||||
glBindTexture (target, texture_id);
|
||||
glEnable (target);
|
||||
glEnable (GL_SCISSOR_TEST);
|
||||
|
||||
glTexParameteri (target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
@@ -716,7 +720,8 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
|
||||
e.height *= sy;
|
||||
image = cairo_surface_map_to_image (surface, &e);
|
||||
|
||||
gdk_gl_context_upload_texture (paint_context, image, e.width, e.height, target);
|
||||
/* We might have a different alignment, stride or format, so allow overriding here if needed */
|
||||
GDK_GL_CONTEXT_GET_CLASS (paint_context)->upload_texture (paint_context, image, e.width, e.height, target);
|
||||
|
||||
cairo_surface_unmap_image (surface, image);
|
||||
|
||||
@@ -745,8 +750,8 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
|
||||
}
|
||||
}
|
||||
|
||||
#undef FLIP_Y
|
||||
|
||||
glDisable (GL_SCISSOR_TEST);
|
||||
glDisable (target);
|
||||
glDeleteTextures (1, &texture_id);
|
||||
}
|
||||
|
||||
@@ -49,14 +49,6 @@
|
||||
* #GdkWindow, which you typically get during the realize call
|
||||
* of a widget.
|
||||
*
|
||||
* A #GdkGLContext is not realized until either gdk_gl_context_make_current(),
|
||||
* or until it is realized using gdk_gl_context_realize(). It is possible to
|
||||
* specify details of the GL context like the OpenGL version to be used, or
|
||||
* whether the GL context should have extra state validation enabled after
|
||||
* calling gdk_window_create_gl_context() by calling gdk_gl_context_realize().
|
||||
* If the realization fails you have the option to change the settings of the
|
||||
* #GdkGLContext and try again.
|
||||
*
|
||||
* ## Using a GdkGLContext ##
|
||||
*
|
||||
* You will need to make the #GdkGLContext the current context
|
||||
@@ -91,18 +83,12 @@ typedef struct {
|
||||
GdkDisplay *display;
|
||||
GdkWindow *window;
|
||||
GdkGLContext *shared_context;
|
||||
|
||||
int major;
|
||||
int minor;
|
||||
int gl_version;
|
||||
GdkGLProfile profile;
|
||||
|
||||
guint realized : 1;
|
||||
guint use_texture_rectangle : 1;
|
||||
guint has_gl_framebuffer_blit : 1;
|
||||
guint has_frame_terminator : 1;
|
||||
guint extensions_checked : 1;
|
||||
guint debug_enabled : 1;
|
||||
guint forward_compatible : 1;
|
||||
|
||||
GdkGLContextPaintData *paint_data;
|
||||
} GdkGLContextPrivate;
|
||||
@@ -112,6 +98,7 @@ enum {
|
||||
|
||||
PROP_DISPLAY,
|
||||
PROP_WINDOW,
|
||||
PROP_PROFILE,
|
||||
PROP_SHARED_CONTEXT,
|
||||
|
||||
LAST_PROP
|
||||
@@ -199,6 +186,10 @@ gdk_gl_context_set_property (GObject *gobject,
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_PROFILE:
|
||||
priv->profile = g_value_get_enum (value);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
||||
}
|
||||
@@ -226,12 +217,17 @@ gdk_gl_context_get_property (GObject *gobject,
|
||||
g_value_set_object (value, priv->shared_context);
|
||||
break;
|
||||
|
||||
case PROP_PROFILE:
|
||||
g_value_set_enum (value, priv->profile);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
/* Default implementation of upload_texture() for gdk_gl_texture_from_surface() */
|
||||
static void
|
||||
gdk_gl_context_upload_texture (GdkGLContext *context,
|
||||
cairo_surface_t *image_surface,
|
||||
int width,
|
||||
@@ -242,7 +238,7 @@ gdk_gl_context_upload_texture (GdkGLContext *context,
|
||||
|
||||
glPixelStorei (GL_UNPACK_ALIGNMENT, 4);
|
||||
glPixelStorei (GL_UNPACK_ROW_LENGTH, cairo_image_surface_get_stride (image_surface)/4);
|
||||
glTexImage2D (texture_target, 0, GL_RGBA, width, height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
|
||||
glTexImage2D (texture_target, 0, 4, width, height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
|
||||
cairo_image_surface_get_data (image_surface));
|
||||
glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
|
||||
}
|
||||
@@ -284,6 +280,23 @@ gdk_gl_context_class_init (GdkGLContextClass *klass)
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* GdkGLContext:profile:
|
||||
*
|
||||
* The #GdkGLProfile of the context
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
obj_pspecs[PROP_PROFILE] =
|
||||
g_param_spec_enum ("profile",
|
||||
P_("Profile"),
|
||||
P_("The GL profile the context was created for"),
|
||||
GDK_TYPE_GL_PROFILE,
|
||||
GDK_GL_PROFILE_DEFAULT,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* GdkGLContext:shared-context:
|
||||
*
|
||||
@@ -305,6 +318,9 @@ gdk_gl_context_class_init (GdkGLContextClass *klass)
|
||||
gobject_class->dispose = gdk_gl_context_dispose;
|
||||
gobject_class->finalize = gdk_gl_context_finalize;
|
||||
|
||||
/* Default Implementation of upload_texture() for gdk_gl_texture_from_surface() */
|
||||
klass->upload_texture = gdk_gl_context_upload_texture;
|
||||
|
||||
g_object_class_install_properties (gobject_class, LAST_PROP, obj_pspecs);
|
||||
}
|
||||
|
||||
@@ -373,237 +389,19 @@ gdk_gl_context_has_frame_terminator (GdkGLContext *context)
|
||||
return priv->has_frame_terminator;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_set_debug_enabled:
|
||||
* @context: a #GdkGLContext
|
||||
* @enabled: whether to enable debugging in the context
|
||||
*
|
||||
* Sets whether the #GdkGLContext should perform extra validations and
|
||||
* run time checking. This is useful during development, but has
|
||||
* additional overhead.
|
||||
*
|
||||
* The #GdkGLContext must not be realized or made current prior to
|
||||
* calling this function.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
void
|
||||
gdk_gl_context_set_debug_enabled (GdkGLContext *context,
|
||||
gboolean enabled)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
|
||||
g_return_if_fail (!priv->realized);
|
||||
|
||||
enabled = !!enabled;
|
||||
|
||||
priv->debug_enabled = enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_get_debug_enabled:
|
||||
* @context: a #GdkGLContext
|
||||
*
|
||||
* Retrieves the value set using gdk_gl_context_set_debug_enabled().
|
||||
*
|
||||
* Returns: %TRUE if debugging is enabled
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
gboolean
|
||||
gdk_gl_context_get_debug_enabled (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), FALSE);
|
||||
|
||||
return priv->debug_enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_set_forward_compatible:
|
||||
* @context: a #GdkGLContext
|
||||
* @compatible: whether the context should be forward compatible
|
||||
*
|
||||
* Sets whether the #GdkGLContext should be forward compatible.
|
||||
*
|
||||
* Forward compatibile contexts must not support OpenGL functionality that
|
||||
* has been marked as deprecated in the requested version; non-forward
|
||||
* compatible contexts, on the other hand, must support both deprecated and
|
||||
* non deprecated functionality.
|
||||
*
|
||||
* The #GdkGLContext must not be realized or made current prior to calling
|
||||
* this function.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
void
|
||||
gdk_gl_context_set_forward_compatible (GdkGLContext *context,
|
||||
gboolean compatible)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
|
||||
g_return_if_fail (!priv->realized);
|
||||
|
||||
compatible = !!compatible;
|
||||
|
||||
priv->forward_compatible = compatible;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_get_forward_compatible:
|
||||
* @context: a #GdkGLContext
|
||||
*
|
||||
* Retrieves the value set using gdk_gl_context_set_forward_compatible().
|
||||
*
|
||||
* Returns: %TRUE if the context should be forward compatible
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
gboolean
|
||||
gdk_gl_context_get_forward_compatible (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), FALSE);
|
||||
|
||||
return priv->forward_compatible;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_set_required_version:
|
||||
* @context: a #GdkGLContext
|
||||
* @major: the major version to request
|
||||
* @minor: the minor version to request
|
||||
*
|
||||
* Sets the major and minor version of OpenGL to request.
|
||||
*
|
||||
* Setting @major and @minor to zero will use the default values.
|
||||
*
|
||||
* The #GdkGLContext must not be realized or made current prior to calling
|
||||
* this function.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
void
|
||||
gdk_gl_context_set_required_version (GdkGLContext *context,
|
||||
int major,
|
||||
int minor)
|
||||
{
|
||||
int version;
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
|
||||
g_return_if_fail (!priv->realized);
|
||||
|
||||
/* this will take care of the default */
|
||||
if (major == 0 && minor == 0)
|
||||
{
|
||||
priv->major = 0;
|
||||
priv->minor = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Enforce a minimum context version number of 3.2 */
|
||||
version = (major * 100) + minor;
|
||||
if (version < 302)
|
||||
{
|
||||
g_warning ("gdk_gl_context_set_required_version - GL context versions less than 3.2 are not supported.");
|
||||
version = 302;
|
||||
}
|
||||
priv->major = version / 100;
|
||||
priv->minor = version % 100;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_get_required_version:
|
||||
* @context: a #GdkGLContext
|
||||
* @major: (out) (nullable): return location for the major version to request
|
||||
* @minor: (out) (nullable): return location for the minor version to request
|
||||
*
|
||||
* Retrieves the major and minor version requested by calling
|
||||
* gdk_gl_context_set_required_version().
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
void
|
||||
gdk_gl_context_get_required_version (GdkGLContext *context,
|
||||
int *major,
|
||||
int *minor)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
int maj, min;
|
||||
|
||||
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
|
||||
|
||||
if (priv->major > 0)
|
||||
maj = priv->major;
|
||||
else
|
||||
maj = 3;
|
||||
|
||||
if (priv->minor > 0)
|
||||
min = priv->minor;
|
||||
else
|
||||
min = 2;
|
||||
|
||||
if (major != NULL)
|
||||
*major = maj;
|
||||
if (minor != NULL)
|
||||
*minor = min;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_realize:
|
||||
* @context: a #GdkGLContext
|
||||
* @error: return location for a #GError
|
||||
*
|
||||
* Realizes the given #GdkGLContext.
|
||||
*
|
||||
* It is safe to call this function on a realized #GdkGLContext.
|
||||
*
|
||||
* Returns: %TRUE if the context is realized
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
gboolean
|
||||
gdk_gl_context_realize (GdkGLContext *context,
|
||||
GError **error)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), FALSE);
|
||||
|
||||
if (priv->realized)
|
||||
return TRUE;
|
||||
|
||||
priv->realized = GDK_GL_CONTEXT_GET_CLASS (context)->realize (context, error);
|
||||
|
||||
return priv->realized;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_gl_context_check_extensions (GdkGLContext *context)
|
||||
gdk_gl_context_realize (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
gboolean has_npot, has_texture_rectangle;
|
||||
|
||||
if (!priv->realized)
|
||||
return;
|
||||
|
||||
if (priv->extensions_checked)
|
||||
return;
|
||||
|
||||
priv->gl_version = epoxy_gl_version ();
|
||||
|
||||
has_npot = epoxy_has_gl_extension ("GL_ARB_texture_non_power_of_two");
|
||||
has_texture_rectangle = epoxy_has_gl_extension ("GL_ARB_texture_rectangle");
|
||||
|
||||
priv->has_gl_framebuffer_blit = epoxy_has_gl_extension ("GL_EXT_framebuffer_blit");
|
||||
priv->has_frame_terminator = epoxy_has_gl_extension ("GL_GREMEDY_frame_terminator");
|
||||
|
||||
if (G_UNLIKELY (_gdk_gl_flags & GDK_GL_TEXTURE_RECTANGLE))
|
||||
if (_gdk_gl_flags & GDK_GL_TEXTURE_RECTANGLE)
|
||||
priv->use_texture_rectangle = TRUE;
|
||||
else if (has_npot)
|
||||
priv->use_texture_rectangle = FALSE;
|
||||
@@ -612,22 +410,7 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
|
||||
else
|
||||
g_warning ("GL implementation doesn't support any form of non-power-of-two textures");
|
||||
|
||||
GDK_NOTE (OPENGL,
|
||||
g_print ("OpenGL version: %d.%d\n"
|
||||
"Extensions checked:\n"
|
||||
" - GL_ARB_texture_non_power_of_two: %s\n"
|
||||
" - GL_ARB_texture_rectangle: %s\n"
|
||||
" - GL_EXT_framebuffer_blit: %s\n"
|
||||
" - GL_GREMEDY_frame_terminator: %s\n"
|
||||
"Using texture rectangle: %s\n",
|
||||
priv->gl_version / 10, priv->gl_version % 10,
|
||||
has_npot ? "yes" : "no",
|
||||
has_texture_rectangle ? "yes" : "no",
|
||||
priv->has_gl_framebuffer_blit ? "yes" : "no",
|
||||
priv->has_frame_terminator ? "yes" : "no",
|
||||
priv->use_texture_rectangle ? "yes" : "no"));
|
||||
|
||||
priv->extensions_checked = TRUE;
|
||||
priv->realized = TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -650,24 +433,11 @@ gdk_gl_context_make_current (GdkGLContext *context)
|
||||
if (current == context)
|
||||
return;
|
||||
|
||||
/* we need to realize the GdkGLContext if it wasn't explicitly realized */
|
||||
if (!priv->realized)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
gdk_gl_context_realize (context, &error);
|
||||
if (error != NULL)
|
||||
{
|
||||
g_critical ("Could not realize the GL context: %s", error->message);
|
||||
g_error_free (error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (gdk_display_make_gl_context_current (priv->display, context))
|
||||
{
|
||||
g_private_replace (&thread_current_context, g_object_ref (context));
|
||||
gdk_gl_context_check_extensions (context);
|
||||
if (!priv->realized)
|
||||
gdk_gl_context_realize (context);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -711,6 +481,26 @@ gdk_gl_context_get_window (GdkGLContext *context)
|
||||
return priv->window;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_get_profile:
|
||||
* @context: a #GdkGLContext
|
||||
*
|
||||
* Retrieves the #GdkGLProfile that @context was created for.
|
||||
*
|
||||
* Returns: a #GdkGLProfile
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
GdkGLProfile
|
||||
gdk_gl_context_get_profile (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), GDK_GL_PROFILE_LEGACY);
|
||||
|
||||
return priv->profile;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_get_shared_context:
|
||||
* @context: a #GdkGLContext
|
||||
@@ -731,34 +521,6 @@ gdk_gl_context_get_shared_context (GdkGLContext *context)
|
||||
return priv->shared_context;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_get_version:
|
||||
* @context: a #GdkGLContext
|
||||
* @major: (out): return location for the major version
|
||||
* @minor: (out): return location for the minor version
|
||||
*
|
||||
* Retrieves the OpenGL version of the @context.
|
||||
*
|
||||
* The @context must be realized prior to calling this function.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
void
|
||||
gdk_gl_context_get_version (GdkGLContext *context,
|
||||
int *major,
|
||||
int *minor)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
|
||||
g_return_if_fail (priv->realized);
|
||||
|
||||
if (major != NULL)
|
||||
*major = priv->gl_version / 10;
|
||||
if (minor != NULL)
|
||||
*minor = priv->gl_version % 10;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_clear_current:
|
||||
*
|
||||
|
||||
@@ -43,44 +43,18 @@ GDK_AVAILABLE_IN_3_16
|
||||
GType gdk_gl_context_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GdkDisplay * gdk_gl_context_get_display (GdkGLContext *context);
|
||||
GdkDisplay * gdk_gl_context_get_display (GdkGLContext *context);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GdkWindow * gdk_gl_context_get_window (GdkGLContext *context);
|
||||
GdkWindow * gdk_gl_context_get_window (GdkGLContext *context);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GdkGLContext * gdk_gl_context_get_shared_context (GdkGLContext *context);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
void gdk_gl_context_get_version (GdkGLContext *context,
|
||||
int *major,
|
||||
int *minor);
|
||||
GdkGLProfile gdk_gl_context_get_profile (GdkGLContext *context);
|
||||
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
void gdk_gl_context_set_required_version (GdkGLContext *context,
|
||||
int major,
|
||||
int minor);
|
||||
void gdk_gl_context_make_current (GdkGLContext *context);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
void gdk_gl_context_get_required_version (GdkGLContext *context,
|
||||
int *major,
|
||||
int *minor);
|
||||
GdkGLContext * gdk_gl_context_get_current (void);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
void gdk_gl_context_set_debug_enabled (GdkGLContext *context,
|
||||
gboolean enabled);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
gboolean gdk_gl_context_get_debug_enabled (GdkGLContext *context);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
void gdk_gl_context_set_forward_compatible (GdkGLContext *context,
|
||||
gboolean compatible);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
gboolean gdk_gl_context_get_forward_compatible (GdkGLContext *context);
|
||||
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
gboolean gdk_gl_context_realize (GdkGLContext *context,
|
||||
GError **error);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
void gdk_gl_context_make_current (GdkGLContext *context);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GdkGLContext * gdk_gl_context_get_current (void);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
void gdk_gl_context_clear_current (void);
|
||||
void gdk_gl_context_clear_current (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -40,15 +40,17 @@ struct _GdkGLContextClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
gboolean (* realize) (GdkGLContext *context,
|
||||
GError **error);
|
||||
|
||||
void (* end_frame) (GdkGLContext *context,
|
||||
cairo_region_t *painted,
|
||||
cairo_region_t *damage);
|
||||
gboolean (* texture_from_surface) (GdkGLContext *context,
|
||||
cairo_surface_t *surface,
|
||||
cairo_region_t *region);
|
||||
void (* upload_texture) (GdkGLContext *context,
|
||||
cairo_surface_t *image_surface,
|
||||
int width,
|
||||
int height,
|
||||
guint texture_target);
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
@@ -69,18 +71,13 @@ typedef struct {
|
||||
GdkGLContextProgram *current_program;
|
||||
} GdkGLContextPaintData;
|
||||
|
||||
void gdk_gl_context_upload_texture (GdkGLContext *context,
|
||||
cairo_surface_t *image_surface,
|
||||
int width,
|
||||
int height,
|
||||
guint texture_target);
|
||||
GdkGLContextPaintData * gdk_gl_context_get_paint_data (GdkGLContext *context);
|
||||
gboolean gdk_gl_context_use_texture_rectangle (GdkGLContext *context);
|
||||
gboolean gdk_gl_context_has_framebuffer_blit (GdkGLContext *context);
|
||||
gboolean gdk_gl_context_has_frame_terminator (GdkGLContext *context);
|
||||
void gdk_gl_context_end_frame (GdkGLContext *context,
|
||||
cairo_region_t *painted,
|
||||
cairo_region_t *damage);
|
||||
GdkGLContextPaintData *gdk_gl_context_get_paint_data (GdkGLContext *context);
|
||||
gboolean gdk_gl_context_use_texture_rectangle (GdkGLContext *context);
|
||||
gboolean gdk_gl_context_has_framebuffer_blit (GdkGLContext *context);
|
||||
gboolean gdk_gl_context_has_frame_terminator (GdkGLContext *context);
|
||||
void gdk_gl_context_end_frame (GdkGLContext *context,
|
||||
cairo_region_t *painted,
|
||||
cairo_region_t *damage);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -333,7 +333,6 @@ struct _GdkWindow
|
||||
guint in_update : 1;
|
||||
guint geometry_dirty : 1;
|
||||
guint event_compression : 1;
|
||||
guint frame_clock_events_paused : 1;
|
||||
|
||||
/* The GdkWindow that has the impl, ref:ed if another window.
|
||||
* This ref is required to keep the wrapper of the impl window alive
|
||||
|
||||
@@ -372,9 +372,6 @@ typedef enum
|
||||
* Most of these masks map onto one or more of the #GdkEventType event types
|
||||
* above.
|
||||
*
|
||||
* See the [input handling overview][chap-input-handling] for details of
|
||||
* [event masks][event-masks] and [event propagation][event-propagation].
|
||||
*
|
||||
* %GDK_POINTER_MOTION_HINT_MASK is deprecated. It is a special mask
|
||||
* to reduce the number of %GDK_MOTION_NOTIFY events received. When using
|
||||
* %GDK_POINTER_MOTION_HINT_MASK, fewer %GDK_MOTION_NOTIFY events will
|
||||
@@ -437,15 +434,19 @@ struct _GdkPoint
|
||||
};
|
||||
|
||||
/**
|
||||
* GdkGLError:
|
||||
* @GDK_GL_ERROR_NOT_AVAILABLE: OpenGL support is not available
|
||||
* @GDK_GL_ERROR_UNSUPPORTED_FORMAT: The requested visual format is not supported
|
||||
* @GDK_GL_ERROR_UNSUPPORTED_PROFILE: The requested profile is not supported
|
||||
* GdkGLProfile:
|
||||
* @GDK_GL_PROFILE_DEFAULT: ...
|
||||
* @GDK_GL_PROFILE_LEGACY: ...
|
||||
* @GDK_GL_PROFILE_3_2_CORE: ...
|
||||
*
|
||||
* Error enumeration for #GdkGLContext.
|
||||
*
|
||||
* Since: 3.16
|
||||
* ...
|
||||
*/
|
||||
typedef enum {
|
||||
GDK_GL_PROFILE_DEFAULT,
|
||||
GDK_GL_PROFILE_LEGACY,
|
||||
GDK_GL_PROFILE_3_2_CORE
|
||||
} GdkGLProfile;
|
||||
|
||||
typedef enum {
|
||||
GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
GDK_GL_ERROR_UNSUPPORTED_FORMAT,
|
||||
|
||||
@@ -1110,9 +1110,6 @@ find_native_sibling_above (GdkWindow *parent,
|
||||
{
|
||||
GdkWindow *w;
|
||||
|
||||
if (!parent)
|
||||
return NULL;
|
||||
|
||||
w = find_native_sibling_above_helper (parent, child);
|
||||
if (w)
|
||||
return w;
|
||||
@@ -2727,11 +2724,8 @@ gdk_window_ref_impl_surface (GdkWindow *window)
|
||||
}
|
||||
|
||||
GdkGLContext *
|
||||
gdk_window_get_paint_gl_context (GdkWindow *window,
|
||||
GError **error)
|
||||
gdk_window_get_paint_gl_context (GdkWindow *window, GError **error)
|
||||
{
|
||||
GError *internal_error = NULL;
|
||||
|
||||
if (_gdk_gl_flags & GDK_GL_DISABLE)
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
@@ -2743,25 +2737,23 @@ gdk_window_get_paint_gl_context (GdkWindow *window,
|
||||
if (window->impl_window->gl_paint_context == NULL)
|
||||
{
|
||||
window->impl_window->gl_paint_context =
|
||||
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window->impl_window,
|
||||
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window,
|
||||
TRUE,
|
||||
GDK_GL_PROFILE_3_2_CORE,
|
||||
NULL,
|
||||
&internal_error);
|
||||
}
|
||||
|
||||
if (internal_error != NULL)
|
||||
{
|
||||
g_propagate_error (error, internal_error);
|
||||
g_clear_object (&(window->impl_window->gl_paint_context));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gdk_gl_context_realize (window->impl_window->gl_paint_context, &internal_error);
|
||||
if (internal_error != NULL)
|
||||
{
|
||||
g_propagate_error (error, internal_error);
|
||||
g_clear_object (&(window->impl_window->gl_paint_context));
|
||||
return NULL;
|
||||
error);
|
||||
if (window->impl_window->gl_paint_context == NULL &&
|
||||
g_error_matches (*error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_UNSUPPORTED_PROFILE))
|
||||
{
|
||||
g_clear_error (error);
|
||||
window->impl_window->gl_paint_context =
|
||||
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window,
|
||||
TRUE,
|
||||
GDK_GL_PROFILE_DEFAULT,
|
||||
NULL,
|
||||
error);
|
||||
}
|
||||
}
|
||||
|
||||
return window->impl_window->gl_paint_context;
|
||||
@@ -2770,6 +2762,7 @@ gdk_window_get_paint_gl_context (GdkWindow *window,
|
||||
/**
|
||||
* gdk_window_create_gl_context:
|
||||
* @window: a #GdkWindow
|
||||
* @profile: the GL profile the context should target
|
||||
* @error: return location for an error
|
||||
*
|
||||
* Creates a new #GdkGLContext matching the
|
||||
@@ -2778,9 +2771,6 @@ gdk_window_get_paint_gl_context (GdkWindow *window,
|
||||
*
|
||||
* If the creation of the #GdkGLContext failed, @error will be set.
|
||||
*
|
||||
* Before using the returned #GdkGLContext, you will need to
|
||||
* call gdk_gl_context_make_current() or gdk_gl_context_realize().
|
||||
*
|
||||
* Returns: (transfer full): the newly created #GdkGLContext, or
|
||||
* %NULL on error
|
||||
*
|
||||
@@ -2788,6 +2778,7 @@ gdk_window_get_paint_gl_context (GdkWindow *window,
|
||||
**/
|
||||
GdkGLContext *
|
||||
gdk_window_create_gl_context (GdkWindow *window,
|
||||
GdkGLProfile profile,
|
||||
GError **error)
|
||||
{
|
||||
GdkGLContext *paint_context;
|
||||
@@ -2799,8 +2790,9 @@ gdk_window_create_gl_context (GdkWindow *window,
|
||||
if (paint_context == NULL)
|
||||
return NULL;
|
||||
|
||||
return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window->impl_window,
|
||||
return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window,
|
||||
FALSE,
|
||||
profile,
|
||||
paint_context,
|
||||
error);
|
||||
}
|
||||
@@ -2940,6 +2932,7 @@ gdk_window_begin_paint_region (GdkWindow *window,
|
||||
glDisable (GL_DEPTH_TEST);
|
||||
glDisable(GL_BLEND);
|
||||
glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
|
||||
glViewport (0, 0, ww, wh);
|
||||
}
|
||||
@@ -3908,10 +3901,10 @@ gdk_window_process_updates (GdkWindow *window,
|
||||
{
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
gdk_window_process_updates_with_mode (window,
|
||||
update_children ?
|
||||
PROCESS_UPDATES_WITH_ALL_CHILDREN :
|
||||
PROCESS_UPDATES_NO_RECURSE);
|
||||
return gdk_window_process_updates_with_mode (window,
|
||||
update_children ?
|
||||
PROCESS_UPDATES_WITH_ALL_CHILDREN :
|
||||
PROCESS_UPDATES_NO_RECURSE);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -4668,8 +4661,6 @@ gdk_window_get_device_position_double (GdkWindow *window,
|
||||
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
|
||||
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
|
||||
|
||||
tmp_x = tmp_y = 0;
|
||||
tmp_mask = 0;
|
||||
normal_child = GDK_WINDOW_IMPL_GET_CLASS (window->impl)->get_device_state (window,
|
||||
device,
|
||||
&tmp_x, &tmp_y,
|
||||
@@ -5428,8 +5419,6 @@ gdk_window_withdraw (GdkWindow *window)
|
||||
* including #GDK_BUTTON_PRESS_MASK means the window should report button
|
||||
* press events. The event mask is the bitwise OR of values from the
|
||||
* #GdkEventMask enumeration.
|
||||
*
|
||||
* See the [input handling overview][event-masks] for details.
|
||||
**/
|
||||
void
|
||||
gdk_window_set_events (GdkWindow *window,
|
||||
@@ -5500,8 +5489,6 @@ gdk_window_get_events (GdkWindow *window)
|
||||
* press events. The event mask is the bitwise OR of values from the
|
||||
* #GdkEventMask enumeration.
|
||||
*
|
||||
* See the [input handling overview][event-masks] for details.
|
||||
*
|
||||
* Since: 3.0
|
||||
**/
|
||||
void
|
||||
@@ -5908,10 +5895,10 @@ gdk_window_scroll (GdkWindow *window,
|
||||
* Since: 2.8
|
||||
*/
|
||||
void
|
||||
gdk_window_move_region (GdkWindow *window,
|
||||
const cairo_region_t *region,
|
||||
gint dx,
|
||||
gint dy)
|
||||
gdk_window_move_region (GdkWindow *window,
|
||||
const cairo_region_t *region,
|
||||
gint dx,
|
||||
gint dy)
|
||||
{
|
||||
cairo_region_t *expose_area;
|
||||
|
||||
@@ -5937,12 +5924,10 @@ gdk_window_move_region (GdkWindow *window,
|
||||
* @window: a #GdkWindow
|
||||
* @color: a #GdkColor
|
||||
*
|
||||
* Sets the background color of @window.
|
||||
*
|
||||
* However, when using GTK+, influence the background of a widget
|
||||
* using a style class or CSS — if you’re an application — or with
|
||||
* gtk_style_context_set_background() — if you're implementing a
|
||||
* custom widget.
|
||||
* Sets the background color of @window. (However, when using GTK+,
|
||||
* set the background of a widget with gtk_widget_modify_bg() - if
|
||||
* you’re an application - or gtk_style_set_background() - if you're
|
||||
* implementing a custom widget.)
|
||||
*
|
||||
* See also gdk_window_set_background_pattern().
|
||||
*
|
||||
@@ -6006,7 +5991,7 @@ gdk_window_set_background_rgba (GdkWindow *window,
|
||||
* when the window is obscured then exposed.
|
||||
*/
|
||||
void
|
||||
gdk_window_set_background_pattern (GdkWindow *window,
|
||||
gdk_window_set_background_pattern (GdkWindow *window,
|
||||
cairo_pattern_t *pattern)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
@@ -6382,7 +6367,7 @@ gdk_window_get_origin (GdkWindow *window,
|
||||
*
|
||||
* Obtains the position of a window position in root
|
||||
* window coordinates. This is similar to
|
||||
* gdk_window_get_origin() but allows you to pass
|
||||
* gdk_window_get_origin() but allows you go pass
|
||||
* in any position in the window, not just the origin.
|
||||
*
|
||||
* Since: 2.18
|
||||
@@ -9959,7 +9944,7 @@ gdk_window_set_event_compression (GdkWindow *window,
|
||||
{
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
window->event_compression = !!event_compression;
|
||||
window->event_compression = event_compression;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -10925,8 +10910,6 @@ gdk_window_flush_events (GdkFrameClock *clock,
|
||||
_gdk_display_pause_events (display);
|
||||
|
||||
gdk_frame_clock_request_phase (clock, GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS);
|
||||
|
||||
window->frame_clock_events_paused = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -10953,8 +10936,6 @@ gdk_window_resume_events (GdkFrameClock *clock,
|
||||
|
||||
display = gdk_window_get_display (window);
|
||||
_gdk_display_unpause_events (display);
|
||||
|
||||
window->frame_clock_events_paused = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -10987,9 +10968,6 @@ gdk_window_set_frame_clock (GdkWindow *window,
|
||||
|
||||
if (window->frame_clock)
|
||||
{
|
||||
if (window->frame_clock_events_paused)
|
||||
gdk_window_resume_events (window->frame_clock, G_OBJECT (window));
|
||||
|
||||
g_signal_handlers_disconnect_by_func (G_OBJECT (window->frame_clock),
|
||||
G_CALLBACK (gdk_window_flush_events),
|
||||
window);
|
||||
@@ -11130,7 +11108,7 @@ gdk_window_set_opaque_region (GdkWindow *window,
|
||||
impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
|
||||
|
||||
if (impl_class->set_opaque_region)
|
||||
impl_class->set_opaque_region (window, region);
|
||||
return impl_class->set_opaque_region (window, region);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1113,8 +1113,10 @@ gboolean gdk_window_show_window_menu (GdkWindow *window,
|
||||
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GdkGLContext * gdk_window_create_gl_context (GdkWindow *window,
|
||||
GdkGLProfile profile,
|
||||
GError **error);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_WINDOW_H__ */
|
||||
|
||||
@@ -293,11 +293,9 @@ struct _GdkWindowImplClass
|
||||
GdkEvent *event);
|
||||
GdkGLContext *(*create_gl_context) (GdkWindow *window,
|
||||
gboolean attached,
|
||||
GdkGLProfile profile,
|
||||
GdkGLContext *share,
|
||||
GError **error);
|
||||
gboolean (* realize_gl_context) (GdkWindow *window,
|
||||
GdkGLContext *context,
|
||||
GError **error);
|
||||
void (*invalidate_for_new_frame)(GdkWindow *window,
|
||||
cairo_region_t *update_area);
|
||||
};
|
||||
@@ -305,6 +303,7 @@ struct _GdkWindowImplClass
|
||||
/* Interface Functions */
|
||||
GType gdk_window_impl_get_type (void) G_GNUC_CONST;
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_WINDOW_IMPL_H__ */
|
||||
|
||||
@@ -32,7 +32,6 @@ libgdk_mir_la_SOURCES = \
|
||||
gdkmirwindow.c \
|
||||
gdkmirwindowimpl.c \
|
||||
gdkmir-debug.c \
|
||||
gdkmir-private.h \
|
||||
gdkmir.h
|
||||
|
||||
libgdkinclude_HEADERS = \
|
||||
|
||||
@@ -269,13 +269,6 @@ _gdk_mir_print_resize_event (const MirResizeEvent *event)
|
||||
g_printerr (" Size (%i, %i)\n", event->width, event->height);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_mir_print_close_event (const MirCloseSurfaceEvent *event)
|
||||
{
|
||||
g_printerr ("CLOSED\n");
|
||||
g_printerr (" Surface %i\n", event->surface_id);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_mir_print_event (const MirEvent *event)
|
||||
{
|
||||
@@ -293,9 +286,6 @@ _gdk_mir_print_event (const MirEvent *event)
|
||||
case mir_event_type_resize:
|
||||
_gdk_mir_print_resize_event (&event->resize);
|
||||
break;
|
||||
case mir_event_type_close_surface:
|
||||
_gdk_mir_print_close_event (&event->close_surface);
|
||||
break;
|
||||
default:
|
||||
g_printerr ("EVENT %u\n", event->type);
|
||||
break;
|
||||
|
||||
@@ -69,8 +69,6 @@ GdkDevice *_gdk_mir_device_manager_get_keyboard (GdkDeviceManager *device_manage
|
||||
|
||||
GdkKeymap *_gdk_mir_keymap_new (void);
|
||||
|
||||
gboolean _gdk_mir_keymap_key_is_modifier (GdkKeymap *keymap, guint keycode);
|
||||
|
||||
GdkDevice *_gdk_mir_keyboard_new (GdkDeviceManager *device_manager, const gchar *name);
|
||||
|
||||
GdkDevice *_gdk_mir_pointer_new (GdkDeviceManager *device_manager, const gchar *name);
|
||||
@@ -133,16 +131,4 @@ void _gdk_mir_print_resize_event (const MirResizeEvent *event);
|
||||
|
||||
void _gdk_mir_print_event (const MirEvent *event);
|
||||
|
||||
/* TODO: Remove once we have proper transient window support. */
|
||||
GdkWindow * _gdk_mir_window_get_visible_transient_child (GdkWindow *window,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
gdouble *out_x,
|
||||
gdouble *out_y);
|
||||
|
||||
/* TODO: Remove once we have proper transient window support. */
|
||||
void _gdk_mir_window_transient_children_foreach (GdkWindow *window,
|
||||
void (*func) (GdkWindow *, gpointer),
|
||||
gpointer user_data);
|
||||
|
||||
#endif /* __GDK_PRIVATE_MIR_H__ */
|
||||
|
||||
@@ -416,20 +416,9 @@ gdk_mir_display_create_window_impl (GdkDisplay *display,
|
||||
g_printerr (" location=(%d, %d)", window->x, window->y);
|
||||
g_printerr (" size=(%d, %d)", window->width, window->height);
|
||||
g_printerr ("\n");
|
||||
|
||||
if (attributes->wclass == GDK_INPUT_OUTPUT)
|
||||
{
|
||||
window->impl = _gdk_mir_window_impl_new ();
|
||||
window->impl_window = window;
|
||||
}
|
||||
else /* attributes->wclass == GDK_INPUT_ONLY */
|
||||
{
|
||||
window->impl = g_object_ref (real_parent->impl);
|
||||
window->impl_window = real_parent;
|
||||
|
||||
/* FIXME: this is called in gdk_window_new, which sets window->impl_window
|
||||
* back to window after this function returns. */
|
||||
}
|
||||
if (attributes->wclass != GDK_INPUT_OUTPUT)
|
||||
return;
|
||||
window->impl = _gdk_mir_window_impl_new ();
|
||||
}
|
||||
|
||||
static GdkKeymap *
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
#include "gdkmir.h"
|
||||
#include "gdkmir-private.h"
|
||||
|
||||
#define NANO_TO_MILLI(x) ((x) / 1000000)
|
||||
|
||||
struct _GdkMirWindowReference {
|
||||
GdkMirEventSource *source;
|
||||
GdkWindow *window;
|
||||
@@ -41,7 +39,6 @@ struct _GdkMirEventSource
|
||||
|
||||
GMutex mir_event_lock;
|
||||
GQueue mir_events;
|
||||
gboolean log_events;
|
||||
|
||||
GdkDisplay *display;
|
||||
};
|
||||
@@ -53,7 +50,6 @@ send_event (GdkWindow *window, GdkDevice *device, GdkEvent *event)
|
||||
GList *node;
|
||||
|
||||
gdk_event_set_device (event, device);
|
||||
gdk_event_set_source_device (event, device);
|
||||
gdk_event_set_screen (event, gdk_display_get_screen (gdk_window_get_display (window), 0));
|
||||
event->any.window = g_object_ref (window);
|
||||
|
||||
@@ -122,7 +118,7 @@ set_key_event_string (GdkEventKey *event)
|
||||
}
|
||||
|
||||
static void
|
||||
generate_key_event (GdkWindow *window, GdkEventType type, guint state, guint keyval, guint16 keycode, gboolean is_modifier, guint32 event_time)
|
||||
generate_key_event (GdkWindow *window, GdkEventType type, guint state, guint keyval, guint16 keycode, gboolean is_modifier)
|
||||
{
|
||||
GdkEvent *event;
|
||||
|
||||
@@ -131,7 +127,6 @@ generate_key_event (GdkWindow *window, GdkEventType type, guint state, guint key
|
||||
event->key.keyval = keyval;
|
||||
event->key.hardware_keycode = keycode + 8;
|
||||
event->key.is_modifier = is_modifier;
|
||||
event->key.time = event_time;
|
||||
set_key_event_string (&event->key);
|
||||
|
||||
send_event (window, _gdk_mir_device_manager_get_keyboard (gdk_display_get_device_manager (gdk_window_get_display (window))), event);
|
||||
@@ -144,7 +139,7 @@ get_pointer (GdkWindow *window)
|
||||
}
|
||||
|
||||
static void
|
||||
generate_button_event (GdkWindow *window, GdkEventType type, gdouble x, gdouble y, guint button, guint state, guint32 event_time)
|
||||
generate_button_event (GdkWindow *window, GdkEventType type, gdouble x, gdouble y, guint button, guint state)
|
||||
{
|
||||
GdkEvent *event;
|
||||
|
||||
@@ -153,13 +148,12 @@ generate_button_event (GdkWindow *window, GdkEventType type, gdouble x, gdouble
|
||||
event->button.y = y;
|
||||
event->button.state = state;
|
||||
event->button.button = button;
|
||||
event->button.time = event_time;
|
||||
|
||||
send_event (window, get_pointer (window), event);
|
||||
}
|
||||
|
||||
static void
|
||||
generate_scroll_event (GdkWindow *window, gdouble x, gdouble y, gdouble delta_x, gdouble delta_y, guint state, guint32 event_time)
|
||||
generate_scroll_event (GdkWindow *window, gdouble x, gdouble y, gdouble delta_x, gdouble delta_y, guint state)
|
||||
{
|
||||
GdkEvent *event;
|
||||
|
||||
@@ -167,28 +161,15 @@ generate_scroll_event (GdkWindow *window, gdouble x, gdouble y, gdouble delta_x,
|
||||
event->scroll.x = x;
|
||||
event->scroll.y = y;
|
||||
event->scroll.state = state;
|
||||
event->scroll.time = event_time;
|
||||
|
||||
if (ABS (delta_x) == 1 && delta_y == 0)
|
||||
{
|
||||
event->scroll.direction = (delta_x < 0) ? GDK_SCROLL_LEFT : GDK_SCROLL_RIGHT;
|
||||
}
|
||||
else if (ABS (delta_y) == 1 && delta_x == 0)
|
||||
{
|
||||
event->scroll.direction = (delta_y < 0) ? GDK_SCROLL_DOWN : GDK_SCROLL_UP;
|
||||
}
|
||||
else
|
||||
{
|
||||
event->scroll.direction = GDK_SCROLL_SMOOTH;
|
||||
event->scroll.delta_x = -delta_x;
|
||||
event->scroll.delta_y = -delta_y;
|
||||
}
|
||||
event->scroll.direction = GDK_SCROLL_SMOOTH;
|
||||
event->scroll.delta_x = -delta_x;
|
||||
event->scroll.delta_y = -delta_y;
|
||||
|
||||
send_event (window, get_pointer (window), event);
|
||||
}
|
||||
|
||||
static void
|
||||
generate_motion_event (GdkWindow *window, gdouble x, gdouble y, guint state, guint32 event_time)
|
||||
generate_motion_event (GdkWindow *window, gdouble x, gdouble y, guint state)
|
||||
{
|
||||
GdkEvent *event;
|
||||
|
||||
@@ -197,13 +178,12 @@ generate_motion_event (GdkWindow *window, gdouble x, gdouble y, guint state, gui
|
||||
event->motion.y = y;
|
||||
event->motion.state = state;
|
||||
event->motion.is_hint = FALSE;
|
||||
event->motion.time = event_time;
|
||||
|
||||
send_event (window, get_pointer (window), event);
|
||||
}
|
||||
|
||||
static void
|
||||
generate_crossing_event (GdkWindow *window, GdkEventType type, gdouble x, gdouble y, guint32 event_time)
|
||||
generate_crossing_event (GdkWindow *window, GdkEventType type, gdouble x, gdouble y)
|
||||
{
|
||||
GdkEvent *event;
|
||||
|
||||
@@ -213,7 +193,6 @@ generate_crossing_event (GdkWindow *window, GdkEventType type, gdouble x, gdoubl
|
||||
event->crossing.mode = GDK_CROSSING_NORMAL;
|
||||
event->crossing.detail = GDK_NOTIFY_ANCESTOR;
|
||||
event->crossing.focus = TRUE;
|
||||
event->crossing.time = event_time;
|
||||
|
||||
send_event (window, get_pointer (window), event);
|
||||
}
|
||||
@@ -260,30 +239,35 @@ get_modifier_state (unsigned int modifiers, unsigned int button_state)
|
||||
return modifier_state;
|
||||
}
|
||||
|
||||
/*
|
||||
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (event_data->window->impl);
|
||||
MirMotionButton changed_button_state;
|
||||
GdkEventType event_type;
|
||||
gdouble x, y;
|
||||
guint modifier_state;
|
||||
gboolean is_modifier = FALSE;
|
||||
*/
|
||||
|
||||
static void
|
||||
handle_key_event (GdkWindow *window, const MirKeyEvent *event)
|
||||
{
|
||||
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
|
||||
GdkKeymap *keymap;
|
||||
guint modifier_state;
|
||||
MirMotionButton button_state;
|
||||
gboolean is_modifier = FALSE;
|
||||
|
||||
modifier_state = get_modifier_state (event->modifiers, 0); // FIXME: Need to track button state
|
||||
|
||||
switch (event->action)
|
||||
{
|
||||
case mir_key_action_down:
|
||||
case mir_key_action_up:
|
||||
// FIXME: Convert keycode
|
||||
_gdk_mir_window_impl_get_cursor_state (impl, NULL, NULL, NULL, &button_state);
|
||||
modifier_state = get_modifier_state (event->modifiers, button_state);
|
||||
keymap = gdk_keymap_get_for_display (gdk_window_get_display (window));
|
||||
|
||||
// FIXME: is_modifier
|
||||
generate_key_event (window,
|
||||
event->action == mir_key_action_down ? GDK_KEY_PRESS : GDK_KEY_RELEASE,
|
||||
modifier_state,
|
||||
event->key_code,
|
||||
event->scan_code,
|
||||
_gdk_mir_keymap_key_is_modifier (keymap, event->key_code),
|
||||
NANO_TO_MILLI (event->event_time));
|
||||
is_modifier);
|
||||
break;
|
||||
default:
|
||||
//case mir_key_action_multiple:
|
||||
@@ -292,47 +276,6 @@ handle_key_event (GdkWindow *window, const MirKeyEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: Remove once we have proper transient window support. */
|
||||
typedef struct
|
||||
{
|
||||
GdkWindow *except;
|
||||
gdouble x;
|
||||
gdouble y;
|
||||
guint32 time;
|
||||
} LeaveInfo;
|
||||
|
||||
/* TODO: Remove once we have proper transient window support. */
|
||||
/*
|
||||
* leave_windows_except:
|
||||
*
|
||||
* Generate a leave event for every window except the one the cursor is in.
|
||||
*/
|
||||
static void
|
||||
leave_windows_except (GdkWindow *window,
|
||||
gpointer user_data)
|
||||
{
|
||||
LeaveInfo info = *((LeaveInfo *) user_data);
|
||||
|
||||
info.x -= window->x;
|
||||
info.y -= window->y;
|
||||
|
||||
_gdk_mir_window_transient_children_foreach (window, leave_windows_except, &info);
|
||||
|
||||
if (window != info.except)
|
||||
{
|
||||
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
|
||||
gboolean cursor_inside;
|
||||
MirMotionButton button_state;
|
||||
|
||||
_gdk_mir_window_impl_get_cursor_state (impl, NULL, NULL, &cursor_inside, &button_state);
|
||||
|
||||
if (cursor_inside)
|
||||
generate_crossing_event (window, GDK_LEAVE_NOTIFY, info.x, info.y, info.time);
|
||||
|
||||
_gdk_mir_window_impl_set_cursor_state (impl, info.x, info.y, FALSE, button_state);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
handle_motion_event (GdkWindow *window, const MirMotionEvent *event)
|
||||
{
|
||||
@@ -341,7 +284,6 @@ handle_motion_event (GdkWindow *window, const MirMotionEvent *event)
|
||||
gboolean cursor_inside;
|
||||
MirMotionButton button_state;
|
||||
guint modifier_state;
|
||||
guint32 event_time;
|
||||
GdkEventType event_type;
|
||||
MirMotionButton changed_button_state;
|
||||
|
||||
@@ -352,87 +294,45 @@ handle_motion_event (GdkWindow *window, const MirMotionEvent *event)
|
||||
y = event->pointer_coordinates[0].y;
|
||||
}
|
||||
modifier_state = get_modifier_state (event->modifiers, event->button_state);
|
||||
event_time = NANO_TO_MILLI (event->event_time);
|
||||
|
||||
/* TODO: Remove once we have proper transient window support. */
|
||||
if (event->action == mir_motion_action_hover_exit)
|
||||
/* The Mir events generate hover-exits even while inside the window so
|
||||
counteract this by always generating an enter notify on all other events */
|
||||
if (!cursor_inside && event->action != mir_motion_action_hover_exit)
|
||||
{
|
||||
LeaveInfo info;
|
||||
|
||||
info.x = x;
|
||||
info.y = y;
|
||||
info.time = event_time;
|
||||
info.except = window;
|
||||
|
||||
/* Leave all transient children from leaf to root, except the root since we do it later. */
|
||||
_gdk_mir_window_transient_children_foreach (window, leave_windows_except, &info);
|
||||
}
|
||||
else
|
||||
{
|
||||
LeaveInfo info;
|
||||
|
||||
info.x = x;
|
||||
info.y = y;
|
||||
info.time = event_time;
|
||||
info.except = _gdk_mir_window_get_visible_transient_child (window, x, y, &x, &y);
|
||||
|
||||
/* Leave all transient children from leaf to root, except the pointer window since we enter it. */
|
||||
_gdk_mir_window_transient_children_foreach (window, leave_windows_except, &info);
|
||||
|
||||
window = info.except;
|
||||
|
||||
if (window)
|
||||
{
|
||||
/* Enter the pointer window. */
|
||||
gboolean cursor_inside_pointer_window;
|
||||
|
||||
impl = GDK_MIR_WINDOW_IMPL (window->impl);
|
||||
_gdk_mir_window_impl_get_cursor_state (impl, NULL, NULL, &cursor_inside_pointer_window, NULL);
|
||||
|
||||
if (!cursor_inside_pointer_window)
|
||||
{
|
||||
generate_crossing_event (window, GDK_ENTER_NOTIFY, x, y, event_time);
|
||||
_gdk_mir_window_impl_set_cursor_state (impl, x, y, TRUE, event->button_state);
|
||||
}
|
||||
}
|
||||
cursor_inside = TRUE;
|
||||
generate_crossing_event (window, GDK_ENTER_NOTIFY, x, y);
|
||||
}
|
||||
|
||||
if (window)
|
||||
/* Update which window has focus */
|
||||
_gdk_mir_pointer_set_location (get_pointer (window), x, y, window, modifier_state);
|
||||
switch (event->action)
|
||||
{
|
||||
/* Update which window has focus */
|
||||
_gdk_mir_pointer_set_location (get_pointer (window), x, y, window, modifier_state);
|
||||
switch (event->action)
|
||||
{
|
||||
case mir_motion_action_down:
|
||||
case mir_motion_action_up:
|
||||
event_type = event->action == mir_motion_action_down ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE;
|
||||
changed_button_state = button_state ^ event->button_state;
|
||||
if (changed_button_state == 0 || (changed_button_state & mir_motion_button_primary) != 0)
|
||||
generate_button_event (window, event_type, x, y, GDK_BUTTON_PRIMARY, modifier_state, event_time);
|
||||
if ((changed_button_state & mir_motion_button_secondary) != 0)
|
||||
generate_button_event (window, event_type, x, y, GDK_BUTTON_SECONDARY, modifier_state, event_time);
|
||||
if ((changed_button_state & mir_motion_button_tertiary) != 0)
|
||||
generate_button_event (window, event_type, x, y, GDK_BUTTON_MIDDLE, modifier_state, event_time);
|
||||
button_state = event->button_state;
|
||||
break;
|
||||
case mir_motion_action_scroll:
|
||||
generate_scroll_event (window, x, y, event->pointer_coordinates[0].hscroll, event->pointer_coordinates[0].vscroll, modifier_state, event_time);
|
||||
break;
|
||||
case mir_motion_action_move: // move with button
|
||||
case mir_motion_action_hover_move: // move without button
|
||||
generate_motion_event (window, x, y, modifier_state, event_time);
|
||||
break;
|
||||
case mir_motion_action_hover_exit:
|
||||
if (cursor_inside)
|
||||
{
|
||||
cursor_inside = FALSE;
|
||||
generate_crossing_event (window, GDK_LEAVE_NOTIFY, x, y, event_time);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
_gdk_mir_window_impl_set_cursor_state (impl, x, y, cursor_inside, button_state);
|
||||
case mir_motion_action_down:
|
||||
case mir_motion_action_up:
|
||||
event_type = event->action == mir_motion_action_down ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE;
|
||||
changed_button_state = button_state ^ event->button_state;
|
||||
if (changed_button_state == 0 || (changed_button_state & mir_motion_button_primary) != 0)
|
||||
generate_button_event (window, event_type, x, y, GDK_BUTTON_PRIMARY, modifier_state);
|
||||
if ((changed_button_state & mir_motion_button_secondary) != 0)
|
||||
generate_button_event (window, event_type, x, y, GDK_BUTTON_SECONDARY, modifier_state);
|
||||
if ((changed_button_state & mir_motion_button_tertiary) != 0)
|
||||
generate_button_event (window, event_type, x, y, GDK_BUTTON_MIDDLE, modifier_state);
|
||||
button_state = event->button_state;
|
||||
break;
|
||||
case mir_motion_action_scroll:
|
||||
generate_scroll_event (window, x, y, event->pointer_coordinates[0].hscroll, event->pointer_coordinates[0].vscroll, modifier_state);
|
||||
break;
|
||||
case mir_motion_action_move: // move with button
|
||||
case mir_motion_action_hover_move: // move without button
|
||||
generate_motion_event (window, x, y, modifier_state);
|
||||
break;
|
||||
case mir_motion_action_hover_exit:
|
||||
cursor_inside = FALSE;
|
||||
generate_crossing_event (window, GDK_LEAVE_NOTIFY, x, y);
|
||||
break;
|
||||
}
|
||||
|
||||
_gdk_mir_window_impl_set_cursor_state (impl, x, y, cursor_inside, button_state);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -485,14 +385,6 @@ handle_resize_event (GdkWindow *window,
|
||||
generate_configure_event (window, event->width, event->height);
|
||||
}
|
||||
|
||||
static void
|
||||
handle_close_event (GdkWindow *window,
|
||||
const MirCloseSurfaceEvent *event)
|
||||
{
|
||||
send_event (window, get_pointer (window), gdk_event_new (GDK_DESTROY));
|
||||
gdk_window_destroy_notify (window);
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GdkWindow *window;
|
||||
@@ -504,6 +396,9 @@ gdk_mir_event_source_queue_event (GdkDisplay *display,
|
||||
GdkWindow *window,
|
||||
const MirEvent *event)
|
||||
{
|
||||
if (g_getenv ("GDK_MIR_LOG_EVENTS"))
|
||||
_gdk_mir_print_event (event);
|
||||
|
||||
// FIXME: Only generate events if the window wanted them?
|
||||
switch (event->type)
|
||||
{
|
||||
@@ -525,9 +420,6 @@ gdk_mir_event_source_queue_event (GdkDisplay *display,
|
||||
case mir_event_type_orientation:
|
||||
// FIXME?
|
||||
break;
|
||||
case mir_event_type_close_surface:
|
||||
handle_close_event (window, &event->close_surface);
|
||||
break;
|
||||
default:
|
||||
g_warning ("Ignoring unknown Mir event %d", event->type);
|
||||
// FIXME?
|
||||
@@ -567,12 +459,7 @@ gdk_mir_event_source_convert_events (GdkMirEventSource *source)
|
||||
* event was being dispatched...
|
||||
*/
|
||||
if (window != NULL)
|
||||
{
|
||||
if (source->log_events)
|
||||
_gdk_mir_print_event (&event->event);
|
||||
|
||||
gdk_mir_event_source_queue_event (source->display, window, &event->event);
|
||||
}
|
||||
gdk_mir_event_source_queue_event (source->display, window, &event->event);
|
||||
else
|
||||
g_warning ("window was destroyed before event arrived...");
|
||||
|
||||
@@ -667,7 +554,6 @@ _gdk_mir_event_source_new (GdkDisplay *display)
|
||||
source = (GdkMirEventSource *) g_source;
|
||||
g_mutex_init (&source->mir_event_lock);
|
||||
source->display = display;
|
||||
source->log_events = (g_getenv ("GDK_MIR_LOG_EVENTS") != NULL);
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
@@ -26,77 +26,6 @@
|
||||
|
||||
G_DEFINE_TYPE (GdkMirGLContext, gdk_mir_gl_context, GDK_TYPE_GL_CONTEXT)
|
||||
|
||||
#define N_EGL_ATTRS 16
|
||||
|
||||
static gboolean
|
||||
gdk_mir_gl_context_realize (GdkGLContext *context,
|
||||
GError **error)
|
||||
{
|
||||
GdkMirGLContext *context_mir = GDK_MIR_GL_CONTEXT (context);
|
||||
GdkDisplay *display = gdk_gl_context_get_display (context);
|
||||
GdkGLContext *share = gdk_gl_context_get_shared_context (context);
|
||||
EGLContext ctx;
|
||||
EGLint context_attribs[N_EGL_ATTRS];
|
||||
int major, minor, flags;
|
||||
gboolean debug_bit, forward_bit;
|
||||
int i = 0;
|
||||
|
||||
if (!_gdk_mir_display_init_egl_display (display))
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
_("No GL implementation is available"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gdk_gl_context_get_required_version (context, &major, &minor);
|
||||
debug_bit = gdk_gl_context_get_debug_enabled (context);
|
||||
forward_bit = gdk_gl_context_get_forward_compatible (context);
|
||||
|
||||
flags = 0;
|
||||
|
||||
if (debug_bit)
|
||||
flags |= EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR;
|
||||
if (forward_bit)
|
||||
flags |= EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
|
||||
|
||||
/* We want a core profile */
|
||||
context_attribs[i++] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR;
|
||||
context_attribs[i++] = EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR;
|
||||
|
||||
/* Specify the version */
|
||||
context_attribs[i++] = EGL_CONTEXT_MAJOR_VERSION_KHR;
|
||||
context_attribs[i++] = major;
|
||||
context_attribs[i++] = EGL_CONTEXT_MINOR_VERSION_KHR;
|
||||
context_attribs[i++] = minor;
|
||||
|
||||
/* Specify the flags */
|
||||
context_attribs[i++] = EGL_CONTEXT_FLAGS_KHR;
|
||||
context_attribs[i++] = flags;
|
||||
|
||||
context_attribs[i++] = EGL_NONE;
|
||||
g_assert (i < N_EGL_ATTRS);
|
||||
|
||||
ctx = eglCreateContext (_gdk_mir_display_get_egl_display (display),
|
||||
context_mir->egl_config,
|
||||
share != NULL ? GDK_MIR_GL_CONTEXT (share)->egl_context
|
||||
: EGL_NO_CONTEXT,
|
||||
context_attribs);
|
||||
if (ctx == NULL)
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
_("Unable to create a GL context"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
GDK_NOTE (OPENGL, g_print ("Created EGL context[%p]\n", ctx));
|
||||
|
||||
context_mir->egl_context = ctx;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_gl_context_end_frame (GdkGLContext *context,
|
||||
cairo_region_t *painted,
|
||||
@@ -167,7 +96,6 @@ gdk_mir_gl_context_class_init (GdkMirGLContextClass *klass)
|
||||
GdkGLContextClass *context_class = GDK_GL_CONTEXT_CLASS (klass);
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
context_class->realize = gdk_mir_gl_context_realize;
|
||||
context_class->end_frame = gdk_mir_gl_context_end_frame;
|
||||
gobject_class->dispose = gdk_mir_gl_context_dispose;
|
||||
}
|
||||
|
||||
@@ -31,12 +31,6 @@ typedef struct GdkMirKeymapClass GdkMirKeymapClass;
|
||||
#define GDK_IS_MIR_KEYMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_MIR_KEYMAP))
|
||||
#define GDK_MIR_KEYMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_MIR_KEYMAP, GdkMirKeymapClass))
|
||||
|
||||
#define IsModifierKey(keysym) \
|
||||
(((keysym) >= XKB_KEY_Shift_L && (keysym) <= XKB_KEY_Hyper_R) || \
|
||||
((keysym) >= XKB_KEY_ISO_Lock && (keysym) <= XKB_KEY_ISO_Last_Group_Lock) || \
|
||||
((keysym) == XKB_KEY_Mode_switch) || \
|
||||
((keysym) == XKB_KEY_Num_Lock))
|
||||
|
||||
struct GdkMirKeymap
|
||||
{
|
||||
GdkKeymap parent_instance;
|
||||
@@ -348,14 +342,6 @@ gdk_mir_keymap_get_modifier_state (GdkKeymap *keymap)
|
||||
return get_gdk_modifiers (mir_keymap->xkb_keymap, mods);
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_mir_keymap_key_is_modifier (GdkKeymap *keymap,
|
||||
guint keycode)
|
||||
{
|
||||
// FIXME: use xkb_state
|
||||
return IsModifierKey (keycode);
|
||||
}
|
||||
|
||||
static void
|
||||
update_direction (GdkMirKeymap *keymap)
|
||||
{
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkdisplayprivate.h"
|
||||
#include "gdkdeviceprivate.h"
|
||||
#include "gdkscreen.h"
|
||||
#include "gdkwindow.h"
|
||||
@@ -184,11 +183,6 @@ gdk_mir_pointer_ungrab (GdkDevice *device,
|
||||
{
|
||||
//g_printerr ("gdk_mir_pointer_ungrab\n");
|
||||
/* Mir doesn't do grabs */
|
||||
|
||||
GdkDeviceGrabInfo *grab = _gdk_display_get_last_device_grab (gdk_device_get_display (device), device);
|
||||
|
||||
if (grab)
|
||||
grab->serial_end = grab->serial_start;
|
||||
}
|
||||
|
||||
static GdkWindow *
|
||||
|
||||
@@ -327,31 +327,35 @@ gdk_mir_screen_get_monitor_plug_name (GdkScreen *screen,
|
||||
switch (output->type)
|
||||
{
|
||||
case mir_display_output_type_unknown:
|
||||
return g_strdup_printf ("None-%u", output->output_id);
|
||||
return g_strdup_printf ("UNKNOWN-%u", output->output_id);
|
||||
case mir_display_output_type_vga:
|
||||
return g_strdup_printf ("VGA-%u", output->output_id);
|
||||
case mir_display_output_type_dvii:
|
||||
return g_strdup_printf ("DVII-%u", output->output_id);
|
||||
case mir_display_output_type_dvid:
|
||||
return g_strdup_printf ("DVID-%u", output->output_id);
|
||||
case mir_display_output_type_dvia:
|
||||
return g_strdup_printf ("DVI-%u", output->output_id);
|
||||
return g_strdup_printf ("DVIA-%u", output->output_id);
|
||||
case mir_display_output_type_composite:
|
||||
return g_strdup_printf ("Composite-%u", output->output_id);
|
||||
return g_strdup_printf ("COMPOSITE-%u", output->output_id);
|
||||
case mir_display_output_type_svideo:
|
||||
return g_strdup_printf ("SVIDEO-%u", output->output_id);
|
||||
case mir_display_output_type_lvds:
|
||||
return g_strdup_printf ("LVDS-%u", output->output_id);
|
||||
case mir_display_output_type_component:
|
||||
return g_strdup_printf ("CTV-%u", output->output_id);
|
||||
return g_strdup_printf ("COMPONENT-%u", output->output_id);
|
||||
case mir_display_output_type_ninepindin:
|
||||
return g_strdup_printf ("DIN-%u", output->output_id);
|
||||
return g_strdup_printf ("NINEPINDIN-%u", output->output_id);
|
||||
case mir_display_output_type_displayport:
|
||||
return g_strdup_printf ("DP-%u", output->output_id);
|
||||
return g_strdup_printf ("DISPLAYPORT-%u", output->output_id);
|
||||
case mir_display_output_type_hdmia:
|
||||
return g_strdup_printf ("HDMIA-%u", output->output_id);
|
||||
case mir_display_output_type_hdmib:
|
||||
return g_strdup_printf ("HDMI-%u", output->output_id);
|
||||
case mir_display_output_type_svideo:
|
||||
return g_strdup_printf ("HDMIB-%u", output->output_id);
|
||||
case mir_display_output_type_tv:
|
||||
return g_strdup_printf ("TV-%u", output->output_id);
|
||||
case mir_display_output_type_edp:
|
||||
return g_strdup_printf ("eDP-%u", output->output_id);
|
||||
return g_strdup_printf ("EDP-%u", output->output_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -183,29 +183,19 @@ create_mir_surface (GdkDisplay *display,
|
||||
gint height,
|
||||
MirBufferUsage buffer_usage)
|
||||
{
|
||||
MirSurfaceSpec *spec;
|
||||
MirSurfaceParameters parameters;
|
||||
MirConnection *connection;
|
||||
MirPixelFormat format;
|
||||
MirSurface *surface;
|
||||
|
||||
parameters.name = g_get_prgname ();
|
||||
parameters.width = width;
|
||||
parameters.height = height;
|
||||
parameters.pixel_format = _gdk_mir_display_get_pixel_format (display, buffer_usage);
|
||||
parameters.buffer_usage = buffer_usage;
|
||||
parameters.output_id = mir_display_output_id_invalid;
|
||||
|
||||
connection = gdk_mir_display_get_mir_connection (display);
|
||||
format = _gdk_mir_display_get_pixel_format (display, buffer_usage);
|
||||
spec = mir_connection_create_spec_for_normal_surface (connection, width, height, format);
|
||||
mir_surface_spec_set_name (spec, g_get_prgname ());
|
||||
mir_surface_spec_set_buffer_usage (spec, buffer_usage);
|
||||
surface = mir_surface_create_sync (spec);
|
||||
mir_surface_spec_release (spec);
|
||||
|
||||
return surface;
|
||||
}
|
||||
|
||||
/* TODO: Remove once we have proper transient window support. */
|
||||
static gboolean
|
||||
should_render_in_parent (GdkWindow *window)
|
||||
{
|
||||
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
|
||||
|
||||
return impl->transient_for && gdk_window_get_window_type (window) != GDK_WINDOW_TOPLEVEL;
|
||||
return mir_connection_create_surface_sync (connection, ¶meters);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -216,7 +206,7 @@ ensure_surface_full (GdkWindow *window,
|
||||
MirEventDelegate event_delegate = { event_cb, NULL };
|
||||
GdkMirWindowReference *window_ref;
|
||||
|
||||
if (impl->surface || should_render_in_parent (window))
|
||||
if (impl->surface)
|
||||
return;
|
||||
|
||||
/* no destroy notify -- we must leak for now
|
||||
@@ -304,7 +294,7 @@ send_buffer (GdkWindow *window)
|
||||
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
|
||||
|
||||
/* Transient windows draw onto parent instead */
|
||||
if (should_render_in_parent (window))
|
||||
if (impl->transient_for)
|
||||
{
|
||||
redraw_transient (window);
|
||||
return;
|
||||
@@ -362,7 +352,7 @@ gdk_mir_window_impl_ref_cairo_surface (GdkWindow *window)
|
||||
}
|
||||
|
||||
/* Transient windows get rendered into a buffer and copied onto their parent */
|
||||
if (should_render_in_parent (window) || window->gl_paint_context)
|
||||
if (impl->transient_for || window->gl_paint_context)
|
||||
{
|
||||
cairo_surface = cairo_image_surface_create (pixel_format, window->width, window->height);
|
||||
}
|
||||
@@ -383,13 +373,13 @@ gdk_mir_window_impl_ref_cairo_surface (GdkWindow *window)
|
||||
impl->cairo_surface = cairo_surface_reference (cairo_surface);
|
||||
|
||||
/* Draw background */
|
||||
c = cairo_create (impl->cairo_surface);
|
||||
if (impl->background)
|
||||
{
|
||||
c = cairo_create (impl->cairo_surface);
|
||||
cairo_set_source (c, impl->background);
|
||||
cairo_paint (c);
|
||||
cairo_destroy (c);
|
||||
}
|
||||
cairo_set_source (c, impl->background);
|
||||
else
|
||||
cairo_set_source_rgb (c, 1.0, 0.0, 0.0);
|
||||
cairo_paint (c);
|
||||
cairo_destroy (c);
|
||||
|
||||
return cairo_surface;
|
||||
}
|
||||
@@ -456,11 +446,10 @@ gdk_mir_window_impl_hide (GdkWindow *window)
|
||||
//g_printerr ("gdk_mir_window_impl_hide window=%p\n", window);
|
||||
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
|
||||
|
||||
impl->cursor_inside = FALSE;
|
||||
impl->visible = FALSE;
|
||||
ensure_no_surface (window);
|
||||
|
||||
if (should_render_in_parent (window))
|
||||
if (impl->transient_for)
|
||||
redraw_transient (window);
|
||||
}
|
||||
|
||||
@@ -470,11 +459,10 @@ gdk_mir_window_impl_withdraw (GdkWindow *window)
|
||||
//g_printerr ("gdk_mir_window_impl_withdraw window=%p\n", window);
|
||||
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
|
||||
|
||||
impl->cursor_inside = FALSE;
|
||||
impl->visible = FALSE;
|
||||
ensure_no_surface (window);
|
||||
|
||||
if (should_render_in_parent (window))
|
||||
if (impl->transient_for)
|
||||
redraw_transient (window);
|
||||
}
|
||||
|
||||
@@ -517,7 +505,6 @@ gdk_mir_window_impl_move_resize (GdkWindow *window,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
/*
|
||||
g_printerr ("gdk_mir_window_impl_move_resize");
|
||||
g_printerr (" window=%p", window);
|
||||
if (with_move)
|
||||
@@ -525,27 +512,24 @@ gdk_mir_window_impl_move_resize (GdkWindow *window,
|
||||
if (width > 0)
|
||||
g_printerr (" size=%dx%dpx", width, height);
|
||||
g_printerr ("\n");
|
||||
*/
|
||||
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
|
||||
gboolean recreate_surface = FALSE;
|
||||
|
||||
/* Redraw parent where we moved from */
|
||||
if (should_render_in_parent (window))
|
||||
if (impl->transient_for)
|
||||
redraw_transient (window);
|
||||
|
||||
/* Transient windows can move wherever they want */
|
||||
if (with_move)
|
||||
{
|
||||
if (should_render_in_parent (window))
|
||||
if (impl->transient_for)
|
||||
{
|
||||
window->x = x;
|
||||
window->y = y;
|
||||
}
|
||||
else if (x != impl->transient_x || y != impl->transient_y)
|
||||
else
|
||||
{
|
||||
impl->transient_x = x;
|
||||
impl->transient_y = y;
|
||||
recreate_surface = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -555,17 +539,16 @@ gdk_mir_window_impl_move_resize (GdkWindow *window,
|
||||
/* We accept any resize */
|
||||
window->width = width;
|
||||
window->height = height;
|
||||
recreate_surface = TRUE;
|
||||
|
||||
if (impl->surface)
|
||||
{
|
||||
ensure_no_surface (window);
|
||||
ensure_surface (window);
|
||||
}
|
||||
}
|
||||
|
||||
if (recreate_surface && impl->surface)
|
||||
{
|
||||
ensure_no_surface (window);
|
||||
ensure_surface (window);
|
||||
}
|
||||
|
||||
/* Redraw parent where we moved to */
|
||||
if (should_render_in_parent (window))
|
||||
if (impl->transient_for)
|
||||
redraw_transient (window);
|
||||
}
|
||||
|
||||
@@ -728,7 +711,7 @@ gdk_mir_window_impl_input_shape_combine_region (GdkWindow *window,
|
||||
gint offset_x,
|
||||
gint offset_y)
|
||||
{
|
||||
// g_printerr ("gdk_mir_window_impl_input_shape_combine_region window=%p\n", window);
|
||||
g_printerr ("gdk_mir_window_impl_input_shape_combine_region window=%p\n", window);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -742,7 +725,7 @@ gdk_mir_window_impl_destroy (GdkWindow *window,
|
||||
impl->visible = FALSE;
|
||||
ensure_no_surface (window);
|
||||
|
||||
if (should_render_in_parent (window))
|
||||
if (impl->transient_for)
|
||||
{
|
||||
/* Redraw parent */
|
||||
redraw_transient (window);
|
||||
@@ -879,7 +862,7 @@ static void
|
||||
gdk_mir_window_impl_set_title (GdkWindow *window,
|
||||
const gchar *title)
|
||||
{
|
||||
// g_printerr ("gdk_mir_window_impl_set_title window=%p\n", window);
|
||||
g_printerr ("gdk_mir_window_impl_set_title window=%p\n", window);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -910,7 +893,7 @@ gdk_mir_window_impl_set_transient_for (GdkWindow *window,
|
||||
|
||||
/* Link this window to the parent */
|
||||
impl->transient_for = parent;
|
||||
if (should_render_in_parent (window))
|
||||
if (parent)
|
||||
{
|
||||
GdkMirWindowImpl *parent_impl = GDK_MIR_WINDOW_IMPL (parent->impl);
|
||||
parent_impl->transient_children = g_list_append (parent_impl->transient_children, window);
|
||||
@@ -919,55 +902,12 @@ gdk_mir_window_impl_set_transient_for (GdkWindow *window,
|
||||
window->x = impl->transient_x;
|
||||
window->y = impl->transient_y;
|
||||
|
||||
/* Remove surface if we had made one before this was set */
|
||||
ensure_no_surface (window);
|
||||
|
||||
/* Redraw onto parent */
|
||||
redraw_transient (window);
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: Remove once we have proper transient window support. */
|
||||
GdkWindow *
|
||||
_gdk_mir_window_get_visible_transient_child (GdkWindow *window,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
gdouble *out_x,
|
||||
gdouble *out_y)
|
||||
{
|
||||
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
|
||||
GdkWindow *child = NULL;
|
||||
GList *i;
|
||||
|
||||
x -= window->x;
|
||||
y -= window->y;
|
||||
|
||||
if (x < 0 || x >= window->width || y < 0 || y >= window->height)
|
||||
return NULL;
|
||||
|
||||
for (i = impl->transient_children; i && !child; i = i->next)
|
||||
{
|
||||
if (GDK_MIR_WINDOW_IMPL (GDK_WINDOW (i->data)->impl)->visible)
|
||||
child = _gdk_mir_window_get_visible_transient_child (i->data, x, y, out_x, out_y);
|
||||
}
|
||||
|
||||
if (child)
|
||||
return child;
|
||||
|
||||
*out_x = x;
|
||||
*out_y = y;
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
/* TODO: Remove once we have proper transient window support. */
|
||||
void
|
||||
_gdk_mir_window_transient_children_foreach (GdkWindow *window,
|
||||
void (*func) (GdkWindow *, gpointer),
|
||||
gpointer user_data)
|
||||
{
|
||||
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
|
||||
g_list_foreach (impl->transient_children, (GFunc) func, user_data);
|
||||
/* Remove surface if we had made one before this was set */
|
||||
ensure_no_surface (window);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1314,7 +1254,7 @@ gdk_mir_window_impl_set_shadow_width (GdkWindow *window,
|
||||
gint top,
|
||||
gint bottom)
|
||||
{
|
||||
// g_printerr ("gdk_mir_window_impl_set_shadow_width window=%p\n", window);
|
||||
g_printerr ("gdk_mir_window_impl_set_shadow_width window=%p\n", window);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -1392,12 +1332,16 @@ find_eglconfig_for_window (GdkWindow *window,
|
||||
static GdkGLContext *
|
||||
gdk_mir_window_impl_create_gl_context (GdkWindow *window,
|
||||
gboolean attached,
|
||||
GdkGLProfile profile,
|
||||
GdkGLContext *share,
|
||||
GError **error)
|
||||
{
|
||||
GdkDisplay *display = gdk_window_get_display (window);
|
||||
GdkMirGLContext *context;
|
||||
EGLContext ctx;
|
||||
EGLConfig config;
|
||||
int i;
|
||||
EGLint context_attribs[3];
|
||||
|
||||
if (!_gdk_mir_display_init_egl_display (display))
|
||||
{
|
||||
@@ -1407,7 +1351,11 @@ gdk_mir_window_impl_create_gl_context (GdkWindow *window,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!_gdk_mir_display_have_egl_khr_create_context (display))
|
||||
if (profile == GDK_GL_PROFILE_DEFAULT)
|
||||
profile = GDK_GL_PROFILE_LEGACY;
|
||||
|
||||
if (profile == GDK_GL_PROFILE_3_2_CORE &&
|
||||
!_gdk_mir_display_have_egl_khr_create_context (display))
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_UNSUPPORTED_PROFILE,
|
||||
@@ -1418,13 +1366,38 @@ gdk_mir_window_impl_create_gl_context (GdkWindow *window,
|
||||
if (!find_eglconfig_for_window (window, &config, error))
|
||||
return NULL;
|
||||
|
||||
i = 0;
|
||||
if (profile == GDK_GL_PROFILE_3_2_CORE)
|
||||
{
|
||||
context_attribs[i++] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR;
|
||||
context_attribs[i++] = EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR;
|
||||
}
|
||||
context_attribs[i++] = EGL_NONE;
|
||||
|
||||
ctx = eglCreateContext (_gdk_mir_display_get_egl_display (display),
|
||||
config,
|
||||
share ? GDK_MIR_GL_CONTEXT (share)->egl_context : EGL_NO_CONTEXT,
|
||||
context_attribs);
|
||||
if (ctx == NULL)
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
_("Unable to create a GL context"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GDK_NOTE (OPENGL,
|
||||
g_print ("Created EGL context[%p]\n", ctx));
|
||||
|
||||
context = g_object_new (GDK_TYPE_MIR_GL_CONTEXT,
|
||||
"display", display,
|
||||
"window", window,
|
||||
"profile", profile,
|
||||
"shared-context", share,
|
||||
NULL);
|
||||
|
||||
context->egl_config = config;
|
||||
context->egl_context = ctx;
|
||||
context->is_attached = attached;
|
||||
|
||||
return GDK_GL_CONTEXT (context);
|
||||
|
||||
@@ -818,7 +818,7 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
|
||||
|
||||
impl->view = NULL;
|
||||
|
||||
switch (window->window_type)
|
||||
switch (attributes->window_type)
|
||||
{
|
||||
case GDK_WINDOW_TOPLEVEL:
|
||||
case GDK_WINDOW_TEMP:
|
||||
@@ -846,9 +846,8 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
|
||||
window->width,
|
||||
window->height);
|
||||
|
||||
if (window->window_type == GDK_WINDOW_TEMP ||
|
||||
((attributes_mask & GDK_WA_TYPE_HINT) &&
|
||||
attributes->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN))
|
||||
if (attributes->window_type == GDK_WINDOW_TEMP ||
|
||||
attributes->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN)
|
||||
{
|
||||
style_mask = NSBorderlessWindowMask;
|
||||
}
|
||||
@@ -2853,7 +2852,7 @@ gdk_quartz_window_get_scale_factor (GdkWindow *window)
|
||||
|
||||
impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
|
||||
|
||||
if (impl->toplevel != NULL && gdk_quartz_osx_version() >= GDK_OSX_LION)
|
||||
if (gdk_quartz_osx_version() >= GDK_OSX_LION)
|
||||
return [(id <ScaleFactor>) impl->toplevel backingScaleFactor];
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -32,15 +32,15 @@
|
||||
|
||||
static char *
|
||||
gdk_wayland_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
|
||||
GAppInfo *info,
|
||||
GList *files)
|
||||
GAppInfo *info,
|
||||
GList *files)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_app_launch_context_launch_failed (GAppLaunchContext *context,
|
||||
const char *startup_notify_id)
|
||||
gdk_wayland_app_launch_context_launch_failed (GAppLaunchContext *context,
|
||||
const char *startup_notify_id)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
||||
* files for a list of changes. These files are distributed with
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
@@ -59,7 +59,6 @@ struct _GdkWaylandCursor
|
||||
} surface;
|
||||
|
||||
struct wl_cursor *wl_cursor;
|
||||
int scale;
|
||||
};
|
||||
|
||||
struct _GdkWaylandCursorClass
|
||||
@@ -84,18 +83,10 @@ _gdk_wayland_display_finalize_cursors (GdkWaylandDisplay *display)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_gdk_wayland_cursor_update (GdkWaylandDisplay *wayland_display,
|
||||
GdkWaylandCursor *cursor)
|
||||
set_cursor_from_theme (GdkWaylandCursor *cursor, struct wl_cursor_theme *theme)
|
||||
{
|
||||
struct wl_cursor *c;
|
||||
struct wl_cursor_theme *theme;
|
||||
|
||||
/* Do nothing if this is not a wl_cursor cursor. */
|
||||
if (cursor->name == NULL)
|
||||
return FALSE;
|
||||
|
||||
theme = _gdk_wayland_display_get_scaled_cursor_theme (wayland_display,
|
||||
cursor->scale);
|
||||
c = wl_cursor_theme_get_cursor (theme, cursor->name);
|
||||
if (!c)
|
||||
{
|
||||
@@ -114,7 +105,8 @@ _gdk_wayland_cursor_update (GdkWaylandDisplay *wayland_display,
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_wayland_display_update_cursors (GdkWaylandDisplay *display)
|
||||
_gdk_wayland_display_update_cursors (GdkWaylandDisplay *display,
|
||||
struct wl_cursor_theme *theme)
|
||||
{
|
||||
GHashTableIter iter;
|
||||
const char *name;
|
||||
@@ -123,7 +115,7 @@ _gdk_wayland_display_update_cursors (GdkWaylandDisplay *display)
|
||||
g_hash_table_iter_init (&iter, display->cursor_cache);
|
||||
|
||||
while (g_hash_table_iter_next (&iter, (gpointer *) &name, (gpointer *) &cursor))
|
||||
_gdk_wayland_cursor_update (display, cursor);
|
||||
set_cursor_from_theme (cursor, theme);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -176,11 +168,11 @@ _gdk_wayland_cursor_get_buffer (GdkCursor *cursor,
|
||||
|
||||
*w = image->width;
|
||||
*h = image->height;
|
||||
*scale = wayland_cursor->scale;
|
||||
*scale = 1;
|
||||
|
||||
return wl_cursor_image_get_buffer (image);
|
||||
}
|
||||
else if (wayland_cursor->name == NULL) /* From surface */
|
||||
else /* From surface */
|
||||
{
|
||||
*hotspot_x = wayland_cursor->surface.hotspot_x;
|
||||
*hotspot_y = wayland_cursor->surface.hotspot_y;
|
||||
@@ -193,9 +185,9 @@ _gdk_wayland_cursor_get_buffer (GdkCursor *cursor,
|
||||
|
||||
if (wayland_cursor->surface.cairo_surface)
|
||||
return _gdk_wayland_shm_surface_get_wl_buffer (wayland_cursor->surface.cairo_surface);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
guint
|
||||
@@ -224,28 +216,6 @@ _gdk_wayland_cursor_get_next_image_index (GdkCursor *cursor,
|
||||
return current_image_index;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_wayland_cursor_set_scale (GdkCursor *cursor,
|
||||
guint scale)
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display =
|
||||
GDK_WAYLAND_DISPLAY (gdk_cursor_get_display (cursor));
|
||||
GdkWaylandCursor *wayland_cursor = GDK_WAYLAND_CURSOR (cursor);
|
||||
|
||||
if (scale > GDK_WAYLAND_MAX_THEME_SCALE)
|
||||
{
|
||||
g_warning (G_STRLOC ": cursor theme size %u too large", scale);
|
||||
scale = GDK_WAYLAND_MAX_THEME_SCALE;
|
||||
}
|
||||
|
||||
if (wayland_cursor->scale == scale)
|
||||
return;
|
||||
|
||||
wayland_cursor->scale = scale;
|
||||
|
||||
_gdk_wayland_cursor_update (wayland_display, wayland_cursor);
|
||||
}
|
||||
|
||||
static void
|
||||
_gdk_wayland_cursor_class_init (GdkWaylandCursorClass *wayland_cursor_class)
|
||||
{
|
||||
@@ -262,15 +232,9 @@ _gdk_wayland_cursor_init (GdkWaylandCursor *cursor)
|
||||
{
|
||||
}
|
||||
|
||||
static GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_name_with_scale (GdkDisplay *display,
|
||||
const gchar *name,
|
||||
guint scale);
|
||||
|
||||
GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_type_with_scale (GdkDisplay *display,
|
||||
GdkCursorType cursor_type,
|
||||
guint scale)
|
||||
_gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
|
||||
GdkCursorType cursor_type)
|
||||
{
|
||||
GEnumClass *enum_class;
|
||||
GEnumValue *enum_value;
|
||||
@@ -283,9 +247,7 @@ _gdk_wayland_display_get_cursor_for_type_with_scale (GdkDisplay *display,
|
||||
g_strdelimit (cursor_name, "-", '_');
|
||||
g_type_class_unref (enum_class);
|
||||
|
||||
result = _gdk_wayland_display_get_cursor_for_name_with_scale (display,
|
||||
cursor_name,
|
||||
scale);
|
||||
result = _gdk_wayland_display_get_cursor_for_name (display, cursor_name);
|
||||
|
||||
g_free (cursor_name);
|
||||
|
||||
@@ -293,18 +255,8 @@ _gdk_wayland_display_get_cursor_for_type_with_scale (GdkDisplay *display,
|
||||
}
|
||||
|
||||
GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
|
||||
GdkCursorType cursor_type)
|
||||
{
|
||||
return _gdk_wayland_display_get_cursor_for_type_with_scale (display,
|
||||
cursor_type,
|
||||
1);
|
||||
}
|
||||
|
||||
static GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_name_with_scale (GdkDisplay *display,
|
||||
const gchar *name,
|
||||
guint scale)
|
||||
_gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
|
||||
const gchar *name)
|
||||
{
|
||||
GdkWaylandCursor *private;
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (display);
|
||||
@@ -320,13 +272,13 @@ _gdk_wayland_display_get_cursor_for_name_with_scale (GdkDisplay *display,
|
||||
"display", display,
|
||||
NULL);
|
||||
private->name = g_strdup (name);
|
||||
private->scale = scale;
|
||||
private->surface.scale = 1;
|
||||
|
||||
/* Blank cursor case */
|
||||
if (!name || g_str_equal (name, "blank_cursor"))
|
||||
return GDK_CURSOR (private);
|
||||
|
||||
if (!_gdk_wayland_cursor_update (wayland_display, private))
|
||||
if (!set_cursor_from_theme (private, wayland_display->cursor_theme))
|
||||
return GDK_CURSOR (private);
|
||||
|
||||
/* Insert into cache. */
|
||||
@@ -334,13 +286,6 @@ _gdk_wayland_display_get_cursor_for_name_with_scale (GdkDisplay *display,
|
||||
return GDK_CURSOR (private);
|
||||
}
|
||||
|
||||
GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
|
||||
const gchar *name)
|
||||
{
|
||||
return _gdk_wayland_display_get_cursor_for_name_with_scale (display, name, 1);
|
||||
}
|
||||
|
||||
GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_surface (GdkDisplay *display,
|
||||
cairo_surface_t *surface,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user