Compare commits

..

69 Commits

Author SHA1 Message Date
Carlos Garnacho d94d6e560b gtk,range: Have slider jump to the pointer coordinates on touch devices
This widget is too narrow to make touch interaction tricky enough, so
don't add the penalty of having the slider run farther from the touch
coordinates if it happens to miss the slider.
2012-01-05 02:03:26 +01:00
Carlos Garnacho 33b160569f gtk,scrolledwindow: Ensure the view snaps back when overshooting
Instead of just stopping the acceleration source ID, check whether
it's overshooting, and let it snap back if needed after ::grab-notify
and ::button-release-event
2012-01-05 01:38:16 +01:00
Carlos Garnacho fd941bd764 gtk,scrolledwindow: set slower inverse acceleration on the overshoot area
This is so snapping back is more fluid and noticeable.
2012-01-05 01:37:13 +01:00
Carlos Garnacho 18e451da6e gtk,scrolledwindow: Improve initial velocity calculation
Velocity calculation has been refactored out of the captured motion events
handler, and also has more tolerance defore determining that a drag is actually
still.
2012-01-05 01:37:13 +01:00
Carlos Garnacho 0e05d33eee gtk,menu: Don't popdown submenus on button release for touch devices
This is so submenus stay open as the parent menu item is pressed/released,
as the user would typically lift the finger in order to select a submenu
item.
2012-01-05 01:37:12 +01:00
Carlos Garnacho e5b2e528ca gtk,settings: Deprecate gtk-touchscreen-mode
It's not used anywhere in GTK+ anymore.
2012-01-05 01:37:12 +01:00
Carlos Garnacho 355a4cdc14 gtk,range: Remove gtk-touchscreen-mode usage
Emulated crossing events with mode GDK_CROSSING_TOUCH_PRESS/RELEASE
already catter dinamically for the "don't prelight on touch devices"
usecase.
2012-01-05 01:37:12 +01:00
Carlos Garnacho d45dc8f3c3 gtk,togglebutton: Remove gtk-touchcreen-mode usage
Emulated crossing events with mode GDK_CROSSING_TOUCH_PRESS/RELEASE
already catter dinamically for the "don't prelight on touch devices"
usecase.
2012-01-05 01:37:12 +01:00
Carlos Garnacho dd8cf478b0 gtk,menushell: Remove gtk-touchscreen-mode usage
This usage in a keybinding signal is hardly related to touchscreens,
so just remove it.
2012-01-05 01:37:12 +01:00
Carlos Garnacho c33786446c gtk,menu: Remove gtk-touchscreen-mode from scrolling code
scrolling is handled via ::captured-event dynamically, so remove
this now unused code.
2012-01-05 01:37:12 +01:00
Carlos Garnacho c4b7848aeb gtk,menu: Select the first item for touch devices
This was done through gtk-touchscreen-mode, now is handled
dynamically on the current event source device.
2012-01-05 01:37:12 +01:00
Carlos Garnacho 2d88021014 gtk,menu: Implement scrolling through ::captured-event for touch devices
This makes overflown menus scrollable via direct manipulation. Once past
the threshold, the item below the pointer is unselected and scrolling
starts.
2012-01-05 01:37:12 +01:00
Carlos Garnacho 5cf832da40 gtk,menu: handle item selection for touch devices dynamically
Instead of using gtk-touchscreen-mode, the behavior changes depending
on the source device in use.
2012-01-05 01:37:12 +01:00
Carlos Garnacho bbbc5198a3 gtk,textview: Pop up context menu on press-and-hold 2012-01-05 01:37:12 +01:00
Carlos Garnacho 2e4eaa7cfd gtk,textview: Also cancel DnD on ::grab-notify
If is about to start when the drag device is grabbed
somewhere else, unset drag start x/y so DnD doesn't
happen anyway.
2012-01-05 01:37:12 +01:00
Carlos Garnacho 07a4c8174f gtk,entry: Pop up menu on press-and-hold 2012-01-05 01:37:12 +01:00
Carlos Garnacho 5f20868ec8 gtk,label: Pop up menu on press-and-hold 2012-01-05 01:37:12 +01:00
Carlos Garnacho 5d2c04b9d1 xi2: Get the effective group state by ORing the XIGroupState values 2012-01-05 01:37:12 +01:00
Carlos Garnacho 62c32d742e gdk: Ensure that GdkPointerWindowInfo is only generated for pointers 2012-01-05 01:37:11 +01:00
Carlos Garnacho 736438ecfb gtk: Only set widget under device on non-virtual crossing events
_gtk_widget_set_device_window() is suppose to make accounting of
the topmost widget under the device at each time, so avoid setting
it on virtual crossing events as the device is already in another
window.
2012-01-05 01:37:11 +01:00
Carlos Garnacho b02c3cf4a9 gtk,scrolledwindow: remove scrollbars auto-hide
This is in a really sorry state, and scrollbars need to be
thought out for the new design anyway.
2012-01-05 01:37:11 +01:00
Carlos Garnacho cf4b293b75 gtk,scrolledwindow: capture crossing events when dragging
Also, instead of connecting 2 more times to ::captured-event,
have it all go through a single handler.
2012-01-05 01:37:11 +01:00
Carlos Garnacho 64534d1fc2 gtk,scrolledwindow: Add GtkKineticScrollingFlags
gtk_scrolled_window_set_kinetic_scrolling() now takes a set of flags,
GTK_KINETIC_SCROLLING_CAPTURE_BUTTON_PRESS makes the "capture button
press and maybe replay later" vs "let button press go through, but
trust in ::grab-broken to undo things" an opt-in, by default that
flag is set, which is the most conservative approach.
2012-01-05 01:37:11 +01:00
Carlos Garnacho 380299681a gtk,scrolledwindow: Grab only after starting drag
This is so the grab doesn't break the implicit grab on the
child widget's window, which avoids that the button press and
release are possibly sent to different windows, and after the
grab was actually broken.
2012-01-05 01:37:11 +01:00
Carlos Garnacho bbe6075408 gdk: Generate crossing events around touch devices' press/release
Anytime a touch device interacts, the crossing events generation
will change to a touch mode where only events with mode
GDK_CROSSING_TOUCH_PRESS/RELEASE are handled, and those are sent
around button press/release. Those are virtual as the master
device may still stay on the window.

Whenever there is a switch of slave device (the user starts
using another non-touch device), a crossing event with mode
GDK_CROSSING_DEVICE_SWITCH may generated if needed, and the normal
crossing event handling is resumed.
2012-01-05 01:37:11 +01:00
Carlos Garnacho 9615fa61a0 gdk: Keep track of the last slave device used
This last slave device (stored per master) is used to fill
in the missing slave device in synthesized crossing events
not directly caused by a device event (ie. due to configure
events or grabs)
2012-01-05 01:37:11 +01:00
Carlos Garnacho 5a0ec9859e gtk,tooltips: Use the source device instead of gtk-touchscreen-mode
This makes tooltips behavior dynamic based on the interacting device.
2012-01-05 01:37:11 +01:00
Carlos Garnacho 03d89b557a gtk,scrolledwindow: Clamp early overshooting when snapping back
Fixes the situation where overshooting in scrolled windows with a
small viewport could end up overshooting right to the opposite
side, and then back again indefinitely.
2012-01-05 01:37:11 +01:00
Carlos Garnacho d12924f241 gtk: Handle motion hints for ::captured-event
Request automatically more motion events in behalf of
the original widget if it listens to motion hints. So
the capturing widget doesn't need to handle such
implementation details.
2012-01-05 01:37:11 +01:00
Carlos Garnacho e349e46abd gtk,scrolledwindow: capture motions until the kinetic scrolling cancellation
If the widget which events are captured listens to motion hints, there
are situations where neither the scrolled window or the child widget
request more motions.
2012-01-05 01:37:11 +01:00
Carlos Garnacho 888be799d9 gtk,pah: Show a bigger press-and-hold indicator on touchscreens
On touch devices it uses a 2.5cm diameter via gdk_screen_get_width_mm()
in the hope that it'll pop out of the finger area.
2012-01-05 01:37:11 +01:00
Carlos Garnacho 365a4f7535 gtk,scrolledwindow: Unset dragging device on ::grab-notify
The child widget may still call gtk_(device_)grab_add, which left
the scrolled window in an inconsistent state.
2012-01-05 01:37:10 +01:00
Carlos Garnacho 6468ae821f gtk,scrolledwindow: Rework physics behind kinetic scrolling
The maths being used didn't resemble much about velocities or
friction/deceleration, so reimplement it in terms of velocity
vectors and decelerations, measured in pixels/ms^2.

Overshooting is also handled within the deceleration effect,
turning into a constant acceleration vector in the opposite
direction so it returns elastically within the boundaries.
2012-01-05 01:37:10 +01:00
Carlos Garnacho 4f04075a8f gtk,scrolledwindow: Implement overshooting
An extra GdkWindow has been added, this window is the parent
of the child widget, and is the one getting resized/moved when
overshooting.

The unclamped adjustments' values are also stored in
GtkScrolledWindowPrivate as a separate value, overshooting is
pretty specific to GtkScrolledWindow and it isn't worth to
expose API in GtkAlignment for this single purpose.

This method allows GtkScrollable children to be blissfully
unaware of overshooting, as otherwise they'd have to handle
rather odd adjustment values themselves.
2012-01-05 01:37:10 +01:00
Carlos Garnacho ae058ae7ef gtk,scrolledwindow: Add window for overshooting
This window is the child widget's parent window, and will
be the one that's moved when overshooting.
2012-01-05 01:37:10 +01:00
Carlos Garnacho 7f0fe69b6e scrolledwindow: Handle nested scrolled windows in kinetic scrolling
The innermost scrolled window always gets to capture the events, all
scrolled windows above it just let the event go through. Ideally
reaching a limit on the innermost scrolled window would propagate
the dragging up the hierarchy in order to keep following the touch
coords, although that'd involve rather evil hacks just to cater
for broken UIs.
2012-01-05 01:37:10 +01:00
Carlos Garnacho ce879ae739 gtk: Add event storing/replaying to GtkWidget::captured-event
It now returns a GtkCapturedEventFlags which tells whether the
widget captured the event, and additionally whether the event
should be stored for later replay.

gtk_widget_release_captured_events() has been added too so
all stored events are released onto the widget that was initially
to receive the events.
2012-01-05 01:37:10 +01:00
Carlos Garnacho df2bb4a92d scrolledwindow: Use event times when calculating deceleration
Using g_get_current_time() isn't going to be realistic on lagging
events.
2012-01-05 01:37:10 +01:00
Carlos Garnacho e45d9994a4 scrolledwindow: bypass kinetic scrolling if no scrollbars are shown 2012-01-05 01:37:10 +01:00
Carlos Garnacho 447ddb08fc scrolledwindow: Remove priv->event_window
It looks like a leftover from pre-captured-event iterations of
the patch, it is completely unnecessary now.
2012-01-05 01:37:10 +01:00
Carlos Garnacho 0df96ac738 scrolledwindow: Don't use p-a-h for the "let event go through" timeout
Just use a timeout there, the press-and-hold feedback is undesirable
here.
2012-01-05 01:37:10 +01:00
Carlos Garnacho 688d8c0796 gtk,pah: Hook directly into gtk_main_do_event()
Press and hold couldn't reasonably work if nested widgets
handle ::captured-event, once the widget inits press-and-hold,
it'd better also handle possible cancellation on motion and
button release, which isn't guaranteed with ::capture-event.

Also, tentatively start press-and-hold by default on the
grab_widget, and before event capturing happens, this avoids
awkward situations like the scrolled window preventing/delaying
press-and-hold to happen on the child textview for example.
2012-01-05 01:37:10 +01:00
Carlos Garnacho fb7047d212 scrolledwindow: Enable kinetic scrolling by default 2012-01-05 01:37:10 +01:00
Carlos Garnacho 1bb03e26a4 scrolledwindow: add another shortcut to bypass event capture
When clicked again close to the previous button press location
(assuming it had ~0 movement), the scrolled window wil allow
the child to handle the events immediately.

This is so the user doesn't have to wait to the p-a-h timeout
in order to operate on the scrolledwindow child.
2012-01-05 01:37:10 +01:00
Carlos Garnacho 7df706715c scrolledwindow: Only do kinetic scrolling on touch devices
This is sort of meaningless on pointer devices, besides it implies
a different input event handling on child widgets that's unnecessary
there.
2012-01-05 01:37:09 +01:00
Carlos Garnacho 40455db2f5 scrolledwindow: Don't crash on 0-sized motion buffer 2012-01-05 01:37:09 +01:00
Carlos Garnacho 64ec631874 scrolledwindow: Set also a GTK+ grab on p-a-h scrolling
This is so the widget is ensured to receive the events
regardless of the pointer position.
2012-01-05 01:37:09 +01:00
Carlos Garnacho de593da052 scrolledwindow: Add GdkDevice parameter to ::press-and-hold handler 2012-01-05 01:37:09 +01:00
Carlos Garnacho a308c35112 gtk: Handle press-and-hold for touch devices
Also, only react to the first button
2012-01-05 01:37:09 +01:00
Carlos Garnacho 412ba5cc2d gtk: Add a GdkDevice parameter to ::press-and-hold
This would be useful when popping up menus, just so we
know what device to trigger it for.
2012-01-05 01:37:09 +01:00
Carlos Garnacho e4e11aa4a2 gtk: Clean up press-and-hold code
The press and hold animation now fully relies on style context
transitions, finishing the p-a-h operation right after it
finishes. There's also no need to connect to ::drag-begin as
::grab-notify will also tell when a grab begins.
2012-01-05 01:37:09 +01:00
Carlos Garnacho e48285f759 tests: Add an entry to testpressandhold
Useful for checking behavior while selecting,
starting drags, subwindows...
2012-01-05 01:37:09 +01:00
Carlos Garnacho dcd2dba384 entry: Handle ::grab-notify
Store the device, and unset private fields whenever the device
is shadowed by another GTK+ grab, so popping up menus while
selecting (i.e. press-and-hold) doesn't leave it in a confused
state.
2012-01-05 01:37:09 +01:00
Carlos Garnacho 1a6a1118a4 gtk: Do not use deprecated APIs on press-and-hold 2012-01-05 01:37:09 +01:00
Carlos Garnacho d6476eb99a tests: Update testkineticscrolling to use GtkGrid 2012-01-05 01:37:09 +01:00
Carlos Garnacho cdd97bbff7 gtk: connect to grab-notify for press and hold
This is so press and hold is cancelled if a click actually
causes an inner widget to do a GTK+ grab.
2012-01-05 01:37:09 +01:00
Carlos Garnacho a447b2fee2 gtk: Propagate ::captured-event up the hierarchy for crossing events 2012-01-05 01:37:09 +01:00
Carlos Garnacho 4af317307f gtk: emit ::captured-event starting from the GTK grab widget 2012-01-05 01:37:09 +01:00
Carlos Garcia Campos aa0c220f7d scrolledwindow: Allow selections and drag-and-drop when kinetic scrolling is enabled
If the scrolling doesn't start after a long press, the scrolling is
cancelled and events are handled by child widget normally.
2012-01-05 01:37:08 +01:00
Carlos Garcia Campos 39966dbaf8 Add GtkWidget::press-and-hold signal
Press-and-hold signal is emitted when the mouse button is pressed for a
given amount of time, specified in the new "press-and-hold-timeout"
GtkSetting. It's commonly used in mobile platforms to emulate a right
click to show a context menu. This patch is based on previous patches by
Kristian Rietveld and Danielle Madeley.

https://bugzilla.gnome.org/show_bug.cgi?id=315645
2012-01-05 01:37:08 +01:00
Carlos Garnacho fbb70becef gtksettings: Set animation for press-and-hold through GtkStyleProvider
The "gtk-press-and-hold-timeout" setting has also been added, to control
its duration.
2012-01-05 01:37:08 +01:00
Carlos Garnacho 388dcb4234 themingengine: Implement press-and-hold notification renderer
gtk_render_activity() uses it for the GTK_STYLE_CLASS_PRESS_AND_HOLD
style class.
2012-01-05 01:25:39 +01:00
Carlos Garcia Campos e8a9fad467 scrolledwindow: Add auto-hide-scrollbars style property
To hide the scrollbars in kinetic mode when not scrolling.
2012-01-05 01:25:38 +01:00
Carlos Garcia Campos ccb7da408e tests: Add new test for kinetic scrolling 2012-01-05 01:25:38 +01:00
Carlos Garcia Campos 1764558d8c test: Add checkbox to enable/disable kinetic scrolling in scrolled window test 2012-01-05 01:25:38 +01:00
Carlos Garcia Campos 90ee273c66 scrolledwindow: Initial kinetic scrolling support 2012-01-05 01:25:38 +01:00
Carlos Garcia Campos b0b26cc2e0 timeline: Add _gtk_timeline_get_elapsed_time()
To get the time in milliseconds since the last frame
2012-01-05 01:25:38 +01:00
Carlos Garcia Campos 990e049510 Add GtkWidget::captured-event signal
https://bugzilla.gnome.org/show_bug.cgi?id=641836
2012-01-05 01:25:38 +01:00
Carlos Garnacho 8f013f4055 gdk: Add GDK_SOURCE_TOUCH
This device source applies to touch capable devices, most
notably touchscreens.
2012-01-05 01:25:38 +01:00
535 changed files with 51968 additions and 78915 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ TEST_PROGS =
### testing rules
# Xvfb based test rules
XVFB = Xvfb -ac -noreset -screen 0 1024x768x16
XVFB = Xvfb -ac -noreset -screen 0 800x600x16
XIDS = 101 102 103 104 105 106 107 197 199 211 223 227 293 307 308 309 310 311 \
491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 \
991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 \
@@ -29,7 +29,7 @@ endif
XVFB_START = \
${XVFB} -help 2>/dev/null 1>&2 \
&& XID=`for id in $(XIDS) ; do test -e /tmp/.X$$id-lock || { echo $$id; exit 0; }; done; exit 1` \
&& { ${XVFB} :$$XID -nolisten tcp -auth /dev/null >/dev/null 2>&1 & \
&& { ${XVFB} :$$XID -screen 0 800x600x16 -nolisten tcp -auth /dev/null >/dev/null 2>&1 & \
trap "kill -15 $$! " 0 HUP INT QUIT TRAP USR1 PIPE TERM ; } \
|| { echo "Gtk+Tests:ERROR: Failed to start Xvfb environment for X11 target tests."; exit 1; } \
&& DISPLAY=:$$XID && export DISPLAY
-189
View File
@@ -1,192 +1,3 @@
Overview of Changes in GTK+ 3.3.16
==================================
* The widget-factory theme test is now installed
as a demo named gtk3-widget-factory
* The Raleigh theme is now a pure fallback theme
that doesn't share any CSS with other themes
anymore
* GtkColorSelectionDialog has been deprecated in
favor of a new color chooser widget named
GtkColorChooserDialog
* The GtkApplication session support has been simplified
* Bug fixes:
612283 Clarification for GtkListStore::gtk_list_store_insert_with_values
668114 odd spacing in about dialog credits
669116 GtkNotebook's child-notify::position not always emitted...
669208 x11: Cancel _NET_WM_MOVERESIZE if we get a matching ButtonRelease
669511 gtkcsstypes.c: variable is declared at middle of block
669636 gtkactiongroup: clarify set_translation_domain docs
669638 gtkbuilder-menus: translation-domain can be NULL
669794 Orca + Trees/Tables == incorrect cells presented, crashes...
669947 gtkuimanager: clarify @pos of insert_action_group
670077 license text has poor alignment with close button
670078 no stroke around credits scrollable area
670400 First shortcut capture is broken
* Translation updates:
Belarusian
Bulgarian
Danish
Estonian
Galician
Hebrew
Italian
Japanese
Kazakh
Lithuanian
Norwegian bokmål
Spanish
Traditional Chinese
Overview of Changes in GTK+ 3.3.14
==================================
* Theming
- Fixes for border handling in GtkEntry,
GtkCellRendererText, GtkComboBox
- Parse values more carefully, supporting
percentages, angles
- Implement CSS linear-gradient syntax
- Support background-size
- Support a gtk.gresource file in themes
* Bugs fixed
543520 Cups custom options are not sent properly
649121 Crash in GtkAppChooserDialog packagekit button
669176 Regression: atk-add-key-event-listener doesn't work
* Updated translations
Galician
Norwegian bokmål
Spanish
Overview of Changes in GTK+ 3.3.10
==================================
* GtkApplication:
- Move application menu handling over from GIO
- Fix resize grip positioning in GtkApplicationWindow
* Wayland:
- Make combo boxes work
- Make key modifiers work like on X11
- Make mouse buttons work correctly
* Quartz:
- Make key modifiers work more like they do on X11
* Printing:
- Fix handling of custom cups options
* Accessibility:
- Bring key snooping support back for now
* Translation updates:
Spanish
Overview of Changes in GTK+ 3.3.8
=================================
* GtkApplication:
- Supports logout notification and inhibiting
- Buttons, toolbuttons and switches can now be connected
to GActions
* GtkSpinButton no longer allows to change the value
when not editable
* GtkLabel link support has been rewritten to be be
more robust
* GtkBuilder:
- Supports the 'id' in GtkComboBoxText
- Can parse GVariant-valued properties
- Support loading from a GResource
* GtkImage:
- Support loading from a GResource
* GtkUIManager:
- Support loading from a GResource
* Accessibility:
- key snooping support has been removed
* Wayland backend:
- Cursor handling updates
- Look for cursors in the 'weston' directory
- Make resize grips work
- Implement device grabs
- Implement window geometry hints
- Set surface type based on window type hint
- Add basic clipboard and selection implementations
- Implement client-side keyboard repeat
- Update GdkWindow focus state to match reality
* Theming:
- Improved CSS compliance for selector matching
- Improved CSS compliance for value resolution,
including full support for 'inherit', 'initial',
'currentColor', 'none'
- Support border-style properties
- 'window-unfocused' has been renamed to 'backdrop'
* New deprecations:
- GdkColor
- GtkButton::inner-border
* Miscellaneous:
- Turn default theme css files and dnd cursors into
GResources
* Bugs fixed:
543520 Cups custom options are not sent properly
612396 ...default of entry-text-column for GtkComboBoxText
613728 Rationalize GtkTreeView focus
620240 GNOME Drag & Drop broken for remote X sessions
629878 Missing "Back" and "Forward" icons for Firefox
631414 Add symbolic constants for event emission control
639875 crashes when unparenting a tab from a window...
657367 GtkAction: Hold a reference to proxy widgets
659516 gtk_css_provider_to_string lacks "since" tag
660139 GtkGrid gives Gtk-Warnings about negative sizes when empty
660309 check x11 backend when create xim module
663479 "Finishing" ("Completion") and "Advanced" tabs are empty
665015 "Widget (%s) has more than one label" unwanted warnings
666103 Should be able to match the parent where a dropdown menu...
666600 allocate the CSS border and deprecate GtkButton-inner-border
666685 SIGSEGV in _gtk_tree_selection_internal_select_node
666710 Fix compose sequences disabling other sequences
666842 [patch] "sticky" window state reported wrongly on X11
667018 Fix compilation on Windows
667229 gtkspinbutton: Respect value of inherited 'editable' property
667394 Gtk(Tool)Button: add an 'action-name' property
667473 gdk_rgba_free (NULL)
667485 gdk_rgba_parse error checking
667534 Non-XInput2 build fix
667546 GApplication doc mentions g_application_set_app_menu
667628 GtkWindow:application property should have G_PARAM_CONSTRUCT
667695 GAction leaked in examples/plugman.c
667705 fix up GtkApplication on OS X
666921 Fix the _NET_SUPPORTING_WM_CHECK window fetch to be spec...
* Translation updates:
Arabic
Bulgarian
Finnish
Hebrew
Norwegian bokmål
Spanish
Overview of Changes in GTK+ 3.3.6
=================================
+1 -3
View File
@@ -565,9 +565,7 @@ mkdir $(CopyDir)\share\glib-2.0\schemas
copy ..\..\..\gtk\org.gtk.Settings.FileChooser.gschema.xml $(CopyDir)\share\glib-2.0\schemas
copy ..\..\..\gtk\org.gtk.WindowState.gschema.xml $(CopyDir)\share\glib-2.0\schemas
echo "Compiling gsettings XML Files..."
echo "Compiling gsettings XML File(s)..."
$(CopyDir)\bin\glib-compile-schemas.exe $(CopyDir)\share\glib-2.0\schemas
-1
View File
@@ -164,7 +164,6 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\demos\gtk-demo\application.c" />
<ClCompile Include="..\..\..\demos\gtk-demo\appwindow.c" />
<ClCompile Include="..\..\..\demos\gtk-demo\assistant.c" />
<ClCompile Include="..\..\..\demos\gtk-demo\builder.c" />
@@ -11,9 +11,6 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\demos\gtk-demo\application.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\demos\gtk-demo\appwindow.c">
<Filter>Source Files</Filter>
</ClCompile>
+1 -2
View File
@@ -339,8 +339,7 @@ copy $(ConfigurationName)\$(PlatformName)\bin\gailutil.lib $(OutDir)\lib&#x0D;&#
mkdir $(OutDir)\share\glib-2.0\schemas&#x0D;&#x0A;
copy ..\..\..\gtk\org.gtk.Settings.FileChooser.gschema.xml $(OutDir)\share\glib-2.0\schemas&#x0D;&#x0A;
copy ..\..\..\gtk\org.gtk.WindowState.gschema.xml $(OutDir)\share\glib-2.0\schemas&#x0D;&#x0A;
echo &quot;Compiling gsettings XML Files...&quot;&#x0D;&#x0A;
echo &quot;Compiling gsettings XML File(s)...&quot;&#x0D;&#x0A;
$(OutDir)\bin\glib-compile-schemas.exe $(OutDir)\share\glib-2.0\schemas&#x0D;&#x0A;
"
/>
-1
View File
@@ -160,7 +160,6 @@
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File RelativePath="..\..\..\demos\gtk-demo\application.c" />
<File RelativePath="..\..\..\demos\gtk-demo\appwindow.c" />
<File RelativePath="..\..\..\demos\gtk-demo\assistant.c" />
<File RelativePath="..\..\..\demos\gtk-demo\builder.c" />
+40 -24
View File
@@ -5,8 +5,8 @@
/* always defined to indicate that i18n is enabled */
#define ENABLE_NLS 1
/* define to enable packagekit */
/* #undef ENABLE_PACKAGEKIT */
/* Define if gio can sniff image data */
/* #undef GDK_PIXBUF_USE_GIO_MIME */
/* The prefix for our gettext translation domains. */
#define GETTEXT_PACKAGE "@GETTEXT_PACKAGE@"
@@ -20,8 +20,8 @@
/* Define to 1 if you have the `bind_textdomain_codeset' function. */
#define HAVE_BIND_TEXTDOMAIN_CODESET 1
/* define if we have colord */
/* #undef HAVE_COLORD */
/* Is the wctype implementation broken */
/* #undef HAVE_BROKEN_WCTYPE */
/* Define to 1 if you have the <crt_externs.h> header file. */
/* #undef HAVE_CRT_EXTERNS_H */
@@ -73,8 +73,8 @@
/* #undef HAVE_INTTYPES_H */
#endif
/* Define to 1 if the system has the type `IPrintDialogCallback'. */
#define HAVE_IPRINTDIALOGCALLBACK 1
/* Define to 1 if ipc.h is available */
/* #undef HAVE_IPC_H */
/* Define if your <locale.h> file defines LC_MESSAGES. */
/* #undef HAVE_LC_MESSAGES */
@@ -100,14 +100,12 @@
/* Define to 1 if you have a working `mmap' system call. */
/* #undef HAVE_MMAP */
/* Define to 1 if nearbyint() is available */
#ifndef _MSC_VER
#define HAVE_NEARBYINT 1
#endif
/* Define to 1 if libpapi available */
/* #undef HAVE_PAPI */
/* Define to 1 is libjpeg supports progressive JPEG */
/* #undef HAVE_PROGRESSIVE_JPEG */
/* Define to 1 if you have the <pwd.h> header file. */
/* #undef HAVE_PWD_H */
@@ -151,8 +149,8 @@
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/param.h> header file. */
/* #undef HAVE_SYS_PARAM_H */
/* Define to 1 if sys/select.h is available */
/* #undef HAVE_SYS_SELECT_H */
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
@@ -173,6 +171,9 @@
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
/* #undef HAVE_SYS_WAIT_H */
/* Define to 1 if you have the <unistd.h> header file. */
#ifndef _MSC_VER
#define HAVE_UNISTD_H 1
@@ -183,6 +184,12 @@
/* Have uxtheme.h include file */
#define HAVE_UXTHEME_H 1
/* Have wchar.h include file */
#define HAVE_WCHAR_H 1
/* Have wctype.h include file */
#define HAVE_WCTYPE_H 1
/* Define if we have X11R6 */
/* #undef HAVE_X11R6 */
@@ -204,9 +211,6 @@
/* Define to 1 if XFree Xinerama is available */
/* #undef HAVE_XFREE_XINERAMA */
/* Have XGenericEvent */
/* #undef HAVE_XGENERICEVENTS */
/* Define to 1 if xinerama is available */
/* #undef HAVE_XINERAMA */
@@ -216,6 +220,9 @@
/* Define to use XKB extension */
/* #undef HAVE_XKB */
/* Define to 1 if xshm.h is available */
/* #undef HAVE_XSHM_H */
/* Have the SYNC extension library */
/* #undef HAVE_XSYNC */
@@ -241,6 +248,9 @@
/* Define if <X11/extensions/XIproto.h> needed for xReply */
/* #undef NEED_XIPROTO_H_FOR_XREPLY */
/* Define to 1 if fd_set is not available */
#define NO_FD_SET 1
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
#ifndef _MSC_VER
/* #undef NO_MINUS_C_MINUS_O */
@@ -260,15 +270,11 @@
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "gtk+"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "@GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@.@GTK_MICRO_VERSION@"
/* Use NSBundle functions to determine load paths for libraries, translations,
etc. */
/* #undef QUARTZ_RELOCATION */
/* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
@@ -276,8 +282,15 @@
/* Define to 1 if gmodule works and should be used */
#define USE_GMODULE 1
/* Define to 1 if XInput 2.0 is available */
/* #undef XINPUT_2 */
/* Whether to load modules via .la files rather than directly */
/* #undef USE_LA_MODULES */
/* Define to 1 if XXM is available and should be used */
#ifndef _MSC_VER
# define USE_MMX 1
#else
# undef USE_MMX
#endif
/* Define to 1 if no XInput should be used */
/* #undef XINPUT_NONE */
@@ -294,6 +307,9 @@
/* Define for large files, on AIX-style hosts. */
/* #undef _LARGE_FILES */
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `int' if <sys/types.h> doesn't define. */
#define gid_t int
+3 -12
View File
@@ -10,7 +10,7 @@
m4_define([gtk_major_version], [3])
m4_define([gtk_minor_version], [3])
m4_define([gtk_micro_version], [16])
m4_define([gtk_micro_version], [7])
m4_define([gtk_interface_age], [0])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
@@ -39,11 +39,11 @@ AC_CONFIG_AUX_DIR([build-aux])
m4_define([gtk_binary_version], [3.0.0])
# required versions of other packages
m4_define([glib_required_version], [2.31.18])
m4_define([glib_required_version], [2.31.6])
m4_define([pango_required_version], [1.29.0])
m4_define([atk_required_version], [2.1.5])
m4_define([cairo_required_version], [1.10.0])
m4_define([gdk_pixbuf_required_version], [2.25.2])
m4_define([gdk_pixbuf_required_version], [2.23.5])
m4_define([introspection_required_version], [0.10.1])
GLIB_REQUIRED_VERSION=glib_required_version
PANGO_REQUIRED_VERSION=pango_required_version
@@ -1529,13 +1529,6 @@ fi
GLIB_GSETTINGS
#############
# Resources #
#############
GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable glib_compile_resources gio-2.0`
AC_SUBST(GLIB_COMPILE_RESOURCES)
##################################################
# GObject introspection
##################################################
@@ -1748,14 +1741,12 @@ demos/Makefile
demos/gtk-demo/Makefile
demos/gtk-demo/geninclude.pl
demos/pixbuf-demo/Makefile
demos/widget-factory/Makefile
examples/Makefile
tests/Makefile
tests/a11y/Makefile
tests/css/Makefile
tests/css/parser/Makefile
tests/reftests/Makefile
tests/visuals/Makefile
docs/Makefile
docs/reference/Makefile
docs/reference/gdk/Makefile
+18
View File
@@ -0,0 +1,18 @@
libgtk1 for Debian
----------------------
The GIMP Tool Kit (gtk) is a set of widgets to help you program
programs for the X Windowing System easily and powerfully.
gtk is the moving force behind The GNU Image Manipulation Program (The
GIMP) -- the number one freely-available image editing and creation
program available.
gtk is rapidly under development, and the source tree has officially
been separated from The GIMP now, as other teams of programmers
are beginning to write software using its great widget set -- like
GNOME, a desktop interface for X, and gzilla, a freely available
web browser for X.
Ben Gertzfield <che@debian.org>, Mon, 29 Sep 1997 13:11:45 -0700
Vendored Executable
+62
View File
@@ -0,0 +1,62 @@
#!/usr/bin/perl -w
# Adjust debian/changelog and build a new
# Debian package of a CVS archive.
# Written 17 November 1998 by Ben Gertzfield
# <che@debian.org>
# This work is released under the GNU
# General Public License, version 2 or
# later.
use strict;
use diagnostics;
use File::Copy;
my $maintainer = 'Ben Gertzfield <che@debian.org>';
my @date = localtime;
my $datestr = sprintf("%d%.2d%.2d", $date[5] + 1900, $date[4] + 1, $date[3]);
my $revision = '01';
open (CHANGELOG, 'debian/changelog') or die "Couldn't open debian/changelog: $!\n";
$_ = <CHANGELOG>;
chomp;
close CHANGELOG;
my ($package, $last_date, $last_revision) = /^(.*?) \((.*?)\.(.*)?\)/;
if ($last_date eq $datestr) {
$revision = sprintf("%.2d", $last_revision + 1);
}
my $new_version = "$datestr.$revision";
copy('debian/changelog', 'debian/changelog.old') or die "Couldn't copy debian/changelog to debian/changelog.old: $!\n";
open(NEWCHANGELOG, ">debian/changelog") or die "Couldn't open debian/changelog for writing: $!\n";
print NEWCHANGELOG "$package ($new_version) unstable; urgency=low\n\n * CVS snapshot build at " . scalar localtime() . "\n\n -- $maintainer " . `date -R` . "\n";
open(OLDCHANGELOG, "debian/changelog.old") or die "Couldn't open debian/changelog.old: $!\n";
while (<OLDCHANGELOG>) {
print NEWCHANGELOG;
}
close OLDCHANGELOG;
close NEWCHANGELOG;
unlink('debian/changelog.old') or die "Couldn't unlink debian/changelog.old: $!\n";
open(NEWVERSION, '>debian/version') or die "Couldn't open debian/version for writing: $!\n";
print NEWVERSION "$new_version\n";
close NEWVERSION;
system('dpkg-buildpackage -b -rfakeroot -us -uc');
unlink 'debian/version' or die "Couldn't unlink debian/version: $!\n";
+10
View File
@@ -0,0 +1,10 @@
gtk+-cvs (19981116.01) unstable; urgency=low
* First test build from CVS
-- Ben Gertzfield <che@debian.org> Tue, 17 Nov 1998 12:02:13 -0800
Local variables:
mode: debian-changelog
add-log-mailing-address: "che@debian.org"
End:
+81
View File
@@ -0,0 +1,81 @@
Source: gtk+-cvs
Priority: extra
Section: libs
Maintainer: Ben Gertzfield <che@debian.org>
Standards-Version: 2.4.0.0
Package: libgtk-cvs-1.1
Architecture: any
Section: libs
Depends: ${shlibs:Depends}
Conflicts: libgtk-dev (<< 1:1.0.2), libgtk1.1
Description: CVS build of the GIMP Toolkit set of widgets for X
**THIS IS NOT AN OFFICIAL DEBIAN PACKAGE! THIS IS AN AUTOMATED CVS
BUILD OF THE GTK+ LIBRARIES! BEWARE! IT MAY NOT WORK!**
.
The GIMP Toolkit is a freely available set of widgets for X.
GTK is easy to use, and has been implemented in such projects as
The GNU Image Manipulation Program (The GIMP), GNOME, a GNU
desktop set of utilities for X, and gzilla, a GNU web-browser.
.
This is the unstable 1.1 branch of GTK. It is not intended for use
with stable projects!
Package: libgtk-cvs-dev
Architecture: any
Section: devel
Depends: libgtk-cvs-1.1 (=${Source-Version}), libglib-cvs-dev
Suggests: libgtk-cvs-doc
Provides: libgtk1.1-dev
Replaces: libgtk1.1-dev
Conflicts: libgtk-dev, libgtk1 (<< 1:1.0.4), libgtk1.1-dev
Description: CVS build of development files for the GIMP Toolkit
**THIS IS NOT AN OFFICIAL DEBIAN PACKAGE! THIS IS AN AUTOMATED CVS
BUILD OF THE GTK+ LIBRARIES! BEWARE! IT MAY NOT WORK!**
.
This package contains the header files and static libraries for the
GIMP Toolkit set of widgets for X.
.
This is the unstable, 1.1 branch of GTK+. This is not intended for
use with stable releases of programs!
.
Install this package if you wish to develop your own X programs using
the GIMP Toolkit 1.1, or if you wish to compile your own plug-ins for
The GIMP.
Package: libgtk-cvs-doc
Architecture: all
Section: doc
Conflicts: libgtk-dev (<< 1:0.99.4), libgtk-doc, libgtk1.1-doc
Description: CVS build of documentation for the GIMP Toolkit
**THIS IS NOT AN OFFICIAL DEBIAN PACKAGE! THIS IS AN AUTOMATED CVS
BUILD OF THE GTK+ LIBRARIES! BEWARE! IT MAY NOT WORK!**
.
This package contains lots of info-files, HTML docs, FAQs, and
other handy documentation about the GIMP Toolkit set of widgets
for X.
.
This package documents the unstable 1.1 release of the GIMP Toolkit.
.
Install this package if you want to have lots of info about the
GIMP toolkit when you're programming.
Package: libgtk-cvs-dbg
Architecture: any
Section: devel
Depends: libgtk-cvs-1.1 (= ${Source-Version}), libgtk-cvs-dev (= ${Source-Version})
Suggests: libgtk-cvs-doc
Conflicts: libgtk1.1-dbg
Description: CVS build of debugging files for the GIMP Toolkit
**THIS IS NOT AN OFFICIAL DEBIAN PACKAGE! THIS IS AN AUTOMATED CVS
BUILD OF THE GTK+ LIBRARIES! BEWARE! IT MAY NOT WORK!**
.
This package contains the debugging static libraries for the
GIMP Toolkit set of widgets for X.
.
This is the unstable, 1.1 branch of GTK+. This is not intended for
use with stable releases of programs!
.
Install this package if you wish to debug your own X programs using
the GIMP Toolkit 1.1, or if you wish to debug your own plug-ins for
The GIMP.
+8
View File
@@ -0,0 +1,8 @@
This package was debianized by Ben Gertzfield <che@debian.org> on
Tue, 17 Nov 1998 12:07:17 -0800
It was produced from the CVS repository at cvs.gimp.org.
It may be redistributed under the terms of the GNU LGPL, Version 2 or
later, found on Debian systems in the file /usr/doc/copyright/LGPL.
+9
View File
@@ -0,0 +1,9 @@
usr/lib/libgdk.so
usr/lib/libgdk.a
usr/lib/libgtk.so
usr/lib/libgtk.a
usr/include/gdk/
usr/include/gtk/
usr/bin/gtk-config
usr/man/man1/gtk-config.1
usr/share/aclocal/gtk.m4
+5
View File
@@ -0,0 +1,5 @@
#!/bin/sh
set -e
#DEBHELPER#
+6
View File
@@ -0,0 +1,6 @@
#!/bin/sh
set -e
install-info --quiet --remove gtk
#DEBHELPER#
+8
View File
@@ -0,0 +1,8 @@
usr/info/gdk.info
usr/info/gtk.info
usr/info/gtk.info-1
usr/info/gtk.info-2
usr/info/gtk.info-3
usr/info/gtk.info-4
usr/info/gtk.info-5
+11
View File
@@ -0,0 +1,11 @@
#!/bin/sh
set -e
install-info --quiet --description="The GIMP Toolkit." \
--section "The GIMP" "The GIMP" /usr/info/gtk.info.gz
install-info --quiet --description="The GIMP Drawing Kit." \
--section "The GIMP" "The GIMP" /usr/info/gdk.info.gz
#DEBHELPER#
+7
View File
@@ -0,0 +1,7 @@
#!/bin/sh
set -e
install-info --quiet --remove gtk
install-info --quiet --remove gdk
#DEBHELPER#
+7
View File
@@ -0,0 +1,7 @@
#!/bin/sh
set -e
ldconfig
#DEBHELPER#
Vendored Executable
+160
View File
@@ -0,0 +1,160 @@
#!/usr/bin/make -f
# debian/rules file for gtk+ Debian package
# written April 1998 by Ben Gertzfield <che@debian.org
build: build-stamp
build-stamp:
dh_testdir
./autogen.sh --prefix=/usr --with-xinput=xfree
$(MAKE)
cd docs && make distdocs
cd ..
touch build-stamp
build-dbg: build-dbg-stamp
build-dbg-stamp:
dh_testdir
./configure --prefix=/usr --with-xinput=xfree --enable-debug=yes
$(MAKE)
touch build-dbg-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp build-dbg-stamp install-stamp install-dbg-stamp
# Add here commands to clean up after the build process.
-$(MAKE) clean
cd docs
-$(MAKE) maintainer-clean
cd ..
-$(MAKE) distclean
find . -name '*.o' -o -name '_libs' -o -name '*.lo' -o -name '*.a' -o -name '.deps' | xargs rm -rf
dh_clean
clean-dbg:
dh_testdir
dh_testroot
rm -f build-stamp build-dbg-stamp install-stamp install-dbg-stamp
# Add here commands to clean up after the build process.
-$(MAKE) clean
cd docs
-$(MAKE) maintainer-clean
cd ..
-$(MAKE) distclean
find . -name '*.o' -o -name '_libs' -o -name '*.lo' -o -name '*.a' -o -name '.deps' | xargs rm -rf
dh_clean -k
install: install-stamp
install-stamp: build
dh_testdir
dh_testroot
dh_clean
$(MAKE) prefix=`pwd`/debian/tmp/usr install
touch install-stamp
install-dbg: install-dbg-stamp
install-dbg-stamp: build-dbg
dh_testdir
dh_testroot
dh_clean -k
$(MAKE) prefix=`pwd`/debian/libgtk-cvs-dbg/usr install
touch install-dbg-stamp
# Build architecture-independent files here.
binary-indep: build install libgtk-cvs-doc
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install libgtk-cvs-dev libgtk-cvs-1.1 libgtk-cvs-dbg
libgtk-cvs-1.1: build
dh_testdir -plibgtk-cvs-1.1
dh_testroot -plibgtk-cvs-1.1
dh_installdirs -plibgtk-cvs-1.1
# Add here commands to install the files into debian/tmp
rm -rf debian/tmp/usr/bin debian/tmp/usr/include debian/tmp/usr/info debian/tmp/usr/lib/glib debian/tmp/usr/share/aclocal debian/tmp/usr/man debian/tmp/usr/lib/*.la
dh_installdocs -plibgtk-cvs-1.1
dh_installchangelogs -plibgtk-cvs-1.1
dh_strip -plibgtk-cvs-1.1
dh_compress -plibgtk-cvs-1.1
dh_fixperms -plibgtk-cvs-1.1
dh_installdeb -plibgtk-cvs-1.1
dh_shlibdeps -plibgtk-cvs-1.1
dh_gencontrol -plibgtk-cvs-1.1
dh_makeshlibs -plibgtk-cvs-1.1 -V 'libgtk-cvs-1.1 (='`cat debian/version`')'
dh_md5sums -plibgtk-cvs-1.1
dh_builddeb -plibgtk-cvs-1.1
libgtk-cvs-dev: build
dh_testdir -plibgtk-cvs-dev
dh_testroot -plibgtk-cvs-dev
dh_clean -plibgtk-cvs-dev -k
dh_installdirs -plibgtk-cvs-dev
# Add here commands to install the files into debian/tmp
dh_movefiles -plibgtk-cvs-dev
cp gtk-config debian/tmp/usr/bin
dh_installdocs -plibgtk-cvs-dev
dh_installchangelogs -plibgtk-cvs-dev
dh_strip -plibgtk-cvs-dev
dh_compress -plibgtk-cvs-dev
dh_fixperms -plibgtk-cvs-dev
dh_installdeb -plibgtk-cvs-dev
dh_shlibdeps -plibgtk-cvs-dev
dh_gencontrol -plibgtk-cvs-dev
dh_md5sums -plibgtk-cvs-dev
dh_builddeb -plibgtk-cvs-dev
libgtk-cvs-doc:
dh_testdir -plibgtk-cvs-doc
dh_testroot -plibgtk-cvs-doc
dh_clean -plibgtk-cvs-doc -k
dh_installdirs -plibgtk-cvs-doc usr/doc/libgtk-cvs-doc/faq-html \
usr/doc/libgtk-cvs-doc/tutorial-html usr/doc/libgtk-cvs-doc/italian-tutorial-html usr/doc/libgtk-cvs-doc/french-tutorial-html usr/doc/libgtk-cvs-doc/gdk-html
dh_movefiles -plibgtk-cvs-doc
cp docs/html/gtkfaq*.html debian/libgtk-cvs-doc/usr/doc/libgtk-cvs-doc/faq-html
cp docs/html/gtk_tut-*.html debian/libgtk-cvs-doc/usr/doc/libgtk-cvs-doc/tutorial-html
cp docs/html/*.gif debian/libgtk-cvs-doc/usr/doc/libgtk-cvs-doc/tutorial-html
cp docs/html/gtk_tut.html debian/libgtk-cvs-doc/usr/doc/libgtk-cvs-doc/tutorial-html
cp docs/html/gtk_tut_it*.html debian/libgtk-cvs-doc/usr/doc/libgtk-cvs-doc/italian-tutorial-html
cp docs/html/*.gif debian/libgtk-cvs-doc/usr/doc/libgtk-cvs-doc/italian-tutorial-html
cp docs/html/gtk_tut_fr*.html debian/libgtk-cvs-doc/usr/doc/libgtk-cvs-doc/french-tutorial-html
cp docs/html/*.gif debian/libgtk-cvs-doc/usr/doc/libgtk-cvs-doc/french-tutorial-html
cp docs/html/gdk* debian/libgtk-cvs-doc/usr/doc/libgtk-cvs-doc/gdk-html
cp docs/text/*.txt debian/libgtk-cvs-doc/usr/doc/libgtk-cvs-doc/
dh_installdocs -plibgtk-cvs-doc docs/{debugging,developers,styles,text_widget,widget_system,gtk-config,refcounting}.txt TODO NEWS
dh_installchangelogs -plibgtk-cvs-doc
dh_strip -plibgtk-cvs-doc
dh_compress -plibgtk-cvs-doc
dh_fixperms -plibgtk-cvs-doc
dh_installdeb -plibgtk-cvs-doc
dh_shlibdeps -plibgtk-cvs-doc
dh_gencontrol -plibgtk-cvs-doc
dh_md5sums -plibgtk-cvs-doc
dh_builddeb -plibgtk-cvs-doc
libgtk-cvs-dbg: clean-dbg install-dbg
dh_testdir -plibgtk-cvs-dbg
dh_testroot -plibgtk-cvs-dbg
dh_installdirs -plibgtk-cvs-dbg
# Add here commands to install the files into debian/libgtk-cvs-dbg
rm -rf debian/libgtk-cvs-dbg/usr/bin debian/libgtk-cvs-dbg/usr/include debian/libgtk-cvs-dbg/usr/info debian/libgtk-cvs-dbg/usr/lib/glib debian/libgtk-cvs-dbg/usr/man debian/libgtk-cvs-dbg/usr/share debian/libgtk-cvs-dbg/usr/lib/*.{la,so*}
for file in `find debian/libgtk-cvs-dbg/usr/lib -name '*.a'` ; do \
mv $$file debian/libgtk-cvs-dbg/usr/lib/`basename $$file .a`_g.a; \
done
dh_installdocs -plibgtk-cvs-dbg
dh_installchangelogs -plibgtk-cvs-dbg
dh_compress -plibgtk-cvs-dbg
dh_fixperms -plibgtk-cvs-dbg
dh_installdeb -plibgtk-cvs-dbg
dh_shlibdeps -plibgtk-cvs-dbg
dh_gencontrol -plibgtk-cvs-dbg
dh_md5sums -plibgtk-cvs-dbg
dh_builddeb -plibgtk-cvs-dbg
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary
+1 -1
View File
@@ -1,6 +1,6 @@
## Makefile.am for gtk+/demos
include $(top_srcdir)/Makefile.decl
SUBDIRS = gtk-demo widget-factory pixbuf-demo
SUBDIRS = gtk-demo pixbuf-demo
-include $(top_srcdir)/git.mk
+6 -27
View File
@@ -6,7 +6,6 @@ democodedir=$(datadir)/gtk-$(GTK_API_VERSION)/demo
## These should be in the order you want them to appear in the
## demo app, which means alphabetized by demo title, not filename
demos = \
application.c \
appwindow.c \
assistant.c \
builder.c \
@@ -66,24 +65,13 @@ LDADDS = \
$(GTK_DEP_LIBS) \
-lm
bin_PROGRAMS = gtk3-demo gtk3-demo-application
bin_PROGRAMS = gtk3-demo
BUILT_SOURCES = demos.h application_resources.c
BUILT_SOURCES = demos.h
EXTRA_DIST += \
$(IMAGEFILES) \
demo.ui \
application.gresource.xml \
application.ui \
menus.ui \
gtk-logo-24.png \
gtk-logo-48.png \
org.gtk.Demo.gschema.xml
gsettings_SCHEMAS = \
org.gtk.Demo.gschema.xml
@GSETTINGS_RULES@
EXTRA_DIST += \
$(IMAGEFILES) \
demo.ui
demos.h: @REBUILD@ $(demos) geninclude.pl
$(AM_V_GEN) (here=`pwd` ; cd $(srcdir) && $(PERL) $$here/geninclude.pl $(demos)) > demos.h
@@ -98,17 +86,8 @@ gtk3_demo_DEPENDENCIES = $(DEPS)
gtk3_demo_LDADD = $(LDADDS)
gtk3_demo_LDFLAGS = -export-dynamic
gtk3_demo_application_SOURCES = \
application-standalone.c \
application_resources.c
gtk3_demo_application_LDADD = $(LDADDS)
application_resources.c: application.gresource.xml gtk-logo-24.png gtk-logo-48.png application.ui menus.ui
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $(srcdir)/application.gresource.xml
IMAGEFILES= alphatest.png \
apple-red.png \
apple-red.png \
background.jpg \
floppybuddy.gif \
gnome-applets.png \
-3
View File
@@ -1,3 +0,0 @@
#define STANDALONE
#include "application.c"
-479
View File
@@ -1,479 +0,0 @@
/* Application class
*
* Demonstrates a simple application.
*
* This examples uses GtkApplication, GtkApplicationWindow, GtkBuilder
* as well as GMenu and GResource. Due to the way GtkApplication is structured,
* it is run as a separate process.
*/
#include "config.h"
#include <gtk/gtk.h>
#ifdef STANDALONE
static void
show_action_dialog (GSimpleAction *action)
{
const gchar *name;
GtkWidget *dialog;
name = g_action_get_name (G_ACTION (action));
dialog = gtk_message_dialog_new (NULL,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_INFO,
GTK_BUTTONS_CLOSE,
"You activated action: \"%s\"",
name);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
gtk_widget_show (dialog);
}
static void
show_action_infobar (GSimpleAction *action,
GVariant *parameter,
gpointer window)
{
GtkWidget *infobar;
GtkWidget *message;
gchar *text;
const gchar *name;
const gchar *value;
name = g_action_get_name (G_ACTION (action));
value = g_variant_get_string (parameter, NULL);
message = g_object_get_data (G_OBJECT (window), "message");
infobar = g_object_get_data (G_OBJECT (window), "infobar");
text = g_strdup_printf ("You activated radio action: \"%s\".\n"
"Current value: %s", name, value);
gtk_label_set_text (GTK_LABEL (message), text);
gtk_widget_show (infobar);
g_free (text);
}
static void
activate_action (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
show_action_dialog (action);
}
static void
activate_toggle (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GVariant *state;
show_action_dialog (action);
state = g_action_get_state (G_ACTION (action));
g_action_change_state (G_ACTION (action), g_variant_new_boolean (!g_variant_get_boolean (state)));
g_variant_unref (state);
}
static void
activate_radio (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
show_action_infobar (action, parameter, user_data);
g_action_change_state (G_ACTION (action), parameter);
}
static void
activate_about (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GtkWidget *window = user_data;
GdkPixbuf *pixbuf;
const gchar *authors[] = {
"Peter Mattis",
"Spencer Kimball",
"Josh MacDonald",
"and many more...",
NULL
};
const gchar *documentors[] = {
"Owen Taylor",
"Tony Gale",
"Matthias Clasen <mclasen@redhat.com>",
"and many more...",
NULL
};
pixbuf = gdk_pixbuf_new_from_resource ("/logos/gtk-logo-48.png", NULL);
gtk_show_about_dialog (GTK_WINDOW (window),
"program-name", "GTK+ Code Demos",
"version", g_strdup_printf ("%s,\nRunning against GTK+ %d.%d.%d",
PACKAGE_VERSION,
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ()),
"copyright", "(C) 1997-2009 The GTK+ Team",
"license-type", GTK_LICENSE_LGPL_2_1,
"website", "http://www.gtk.org",
"comments", "Program to demonstrate GTK+ functions.",
"authors", authors,
"documenters", documentors,
"logo", pixbuf,
"title", "About GTK+ Code Demos",
NULL);
g_object_unref (pixbuf);
}
static void
activate_quit (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GtkApplication *app = user_data;
GtkWidget *win;
GList *list, *next;
list = gtk_application_get_windows (app);
while (list)
{
win = list->data;
next = list->next;
gtk_widget_destroy (GTK_WIDGET (win));
list = next;
}
}
static void
register_stock_icons (void)
{
static gboolean registered = FALSE;
if (!registered)
{
GdkPixbuf *pixbuf;
GtkIconFactory *factory;
GtkIconSet *icon_set;
static GtkStockItem items[] = {
{ "demo-gtk-logo", "_GTK!", 0, 0, NULL }
};
registered = TRUE;
gtk_stock_add (items, G_N_ELEMENTS (items));
factory = gtk_icon_factory_new ();
gtk_icon_factory_add_default (factory);
pixbuf = gdk_pixbuf_new_from_resource ("/logos/gtk-logo-24.png", NULL);
icon_set = gtk_icon_set_new_from_pixbuf (pixbuf);
gtk_icon_factory_add (factory, "demo-gtk-logo", icon_set);
gtk_icon_set_unref (icon_set);
g_object_unref (pixbuf);
/* Drop our reference to the factory, GTK will hold a reference. */
g_object_unref (factory);
}
}
static void
update_statusbar (GtkTextBuffer *buffer,
GtkStatusbar *statusbar)
{
gchar *msg;
gint row, col;
gint count;
GtkTextIter iter;
/* clear any previous message, underflow is allowed */
gtk_statusbar_pop (statusbar, 0);
count = gtk_text_buffer_get_char_count (buffer);
gtk_text_buffer_get_iter_at_mark (buffer,
&iter,
gtk_text_buffer_get_insert (buffer));
row = gtk_text_iter_get_line (&iter);
col = gtk_text_iter_get_line_offset (&iter);
msg = g_strdup_printf ("Cursor at row %d column %d - %d chars in document",
row, col, count);
gtk_statusbar_push (statusbar, 0, msg);
g_free (msg);
}
static void
mark_set_callback (GtkTextBuffer *buffer,
const GtkTextIter *new_location,
GtkTextMark *mark,
gpointer data)
{
update_statusbar (buffer, GTK_STATUSBAR (data));
}
static void
change_theme_state (GSimpleAction *action,
GVariant *state,
gpointer user_data)
{
GtkSettings *settings = gtk_settings_get_default ();
g_object_set (G_OBJECT (settings),
"gtk-application-prefer-dark-theme",
g_variant_get_boolean (state),
NULL);
g_simple_action_set_state (action, state);
}
static void
change_titlebar_state (GSimpleAction *action,
GVariant *state,
gpointer user_data)
{
GtkWindow *window = user_data;
gtk_window_set_hide_titlebar_when_maximized (GTK_WINDOW (window),
g_variant_get_boolean (state));
g_simple_action_set_state (action, state);
}
static void
change_radio_state (GSimpleAction *action,
GVariant *state,
gpointer user_data)
{
g_simple_action_set_state (action, state);
}
static GActionEntry app_entries[] = {
{ "new", activate_action, NULL, NULL, NULL },
{ "open", activate_action, NULL, NULL, NULL },
{ "save", activate_action, NULL, NULL, NULL },
{ "save-as", activate_action, NULL, NULL, NULL },
{ "quit", activate_quit, NULL, NULL, NULL },
{ "dark", activate_toggle, NULL, "false", change_theme_state }
};
static GActionEntry win_entries[] = {
{ "titlebar", activate_toggle, NULL, "false", change_titlebar_state },
{ "shape", activate_radio, "s", "'oval'", change_radio_state },
{ "bold", activate_toggle, NULL, "false", NULL },
{ "about", activate_about, NULL, NULL, NULL },
{ "file1", activate_action, NULL, NULL, NULL },
{ "logo", activate_action, NULL, NULL, NULL }
};
static void
clicked_cb (GtkWidget *widget, GtkWidget *info)
{
gtk_widget_hide (info);
}
static void
startup (GApplication *app)
{
GtkBuilder *builder;
GMenuModel *appmenu;
GMenuModel *menubar;
builder = gtk_builder_new ();
gtk_builder_add_from_resource (builder, "/ui/menus.ui", NULL);
appmenu = (GMenuModel *)gtk_builder_get_object (builder, "appmenu");
menubar = (GMenuModel *)gtk_builder_get_object (builder, "menubar");
gtk_application_set_app_menu (GTK_APPLICATION (app), appmenu);
gtk_application_set_menubar (GTK_APPLICATION (app), menubar);
g_object_unref (builder);
}
static void
activate (GApplication *app)
{
GtkBuilder *builder;
GtkWidget *window;
GtkWidget *grid;
GtkWidget *contents;
GtkWidget *status;
GtkWidget *message;
GtkWidget *button;
GtkWidget *infobar;
GtkWidget *menutool;
GMenuModel *toolmenu;
GtkTextBuffer *buffer;
window = gtk_application_window_new (GTK_APPLICATION (app));
gtk_window_set_title (GTK_WINDOW (window), "Application Class");
gtk_window_set_icon_name (GTK_WINDOW (window), "document-open");
gtk_window_set_default_size (GTK_WINDOW (window), 200, 200);
g_action_map_add_action_entries (G_ACTION_MAP (window),
win_entries, G_N_ELEMENTS (win_entries),
window);
builder = gtk_builder_new ();
gtk_builder_add_from_resource (builder, "/ui/application.ui", NULL);
grid = (GtkWidget *)gtk_builder_get_object (builder, "grid");
contents = (GtkWidget *)gtk_builder_get_object (builder, "contents");
status = (GtkWidget *)gtk_builder_get_object (builder, "status");
message = (GtkWidget *)gtk_builder_get_object (builder, "message");
button = (GtkWidget *)gtk_builder_get_object (builder, "button");
infobar = (GtkWidget *)gtk_builder_get_object (builder, "infobar");
menutool = (GtkWidget *)gtk_builder_get_object (builder, "menutool");
toolmenu = (GMenuModel *)gtk_builder_get_object (builder, "toolmenu");
g_object_set_data (G_OBJECT (window), "message", message);
g_object_set_data (G_OBJECT (window), "infobar", infobar);
gtk_container_add (GTK_CONTAINER (window), grid);
gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (menutool),
gtk_menu_new_from_model (toolmenu));
gtk_widget_grab_focus (contents);
g_signal_connect (button, "clicked", G_CALLBACK (clicked_cb), infobar);
/* Show text widget info in the statusbar */
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (contents));
g_signal_connect_object (buffer, "changed",
G_CALLBACK (update_statusbar), status, 0);
g_signal_connect_object (buffer, "mark-set",
G_CALLBACK (mark_set_callback), status, 0);
update_statusbar (buffer, GTK_STATUSBAR (status));
gtk_widget_show_all (window);
g_object_unref (builder);
}
int
main (int argc, char *argv[])
{
GtkApplication *app;
GSettings *settings;
GAction *action;
gtk_init (NULL, NULL);
register_stock_icons ();
app = gtk_application_new ("org.gtk.Demo", 0);
settings = g_settings_new ("org.gtk.Demo");
g_action_map_add_action_entries (G_ACTION_MAP (app),
app_entries, G_N_ELEMENTS (app_entries),
app);
action = g_settings_create_action (settings, "color");
g_action_map_add_action (G_ACTION_MAP (app), action);
g_signal_connect (app, "startup", G_CALLBACK (startup), NULL);
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
g_application_run (G_APPLICATION (app), 0, NULL);
return 0;
}
#else /* !STANDALONE */
static gboolean name_seen;
static GtkWidget *placeholder;
static void
on_name_appeared (GDBusConnection *connection,
const gchar *name,
const gchar *name_owner,
gpointer user_data)
{
name_seen = TRUE;
}
static void
on_name_vanished (GDBusConnection *connection,
const gchar *name,
gpointer user_data)
{
if (!name_seen)
return;
if (placeholder)
{
gtk_widget_destroy (placeholder);
g_object_unref (placeholder);
placeholder = NULL;
}
}
GtkWidget *
do_application (GtkWidget *toplevel)
{
static guint watch = 0;
if (watch == 0)
watch = g_bus_watch_name (G_BUS_TYPE_SESSION,
"org.gtk.Demo",
0,
on_name_appeared,
on_name_vanished,
NULL, NULL);
if (placeholder == NULL)
{
const gchar *command;
GError *error = NULL;
if (g_file_test ("./gtk3-demo-application", G_FILE_TEST_IS_EXECUTABLE))
command = "./gtk3-demo-application";
else
command = "gtk3-demo-application";
if (!g_spawn_command_line_async (command, &error))
{
g_warning ("%s", error->message);
g_error_free (error);
}
placeholder = gtk_label_new ("");
g_object_ref_sink (placeholder);
}
else
{
g_dbus_connection_call_sync (g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL),
"org.gtk.Demo",
"/org/gtk/Demo",
"org.gtk.Actions",
"Activate",
g_variant_new ("(sava{sv})", "quit", NULL, NULL),
NULL,
0,
G_MAXINT,
NULL, NULL);
}
return placeholder;
}
#endif
-11
View File
@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/logos">
<file preprocess="to-pixdata">gtk-logo-24.png</file>
<file preprocess="to-pixdata">gtk-logo-48.png</file>
</gresource>
<gresource prefix="/ui">
<file preprocess="xml-stripblanks">application.ui</file>
<file preprocess="xml-stripblanks">menus.ui</file>
</gresource>
</gresources>
-104
View File
@@ -1,104 +0,0 @@
<?xml version="1.0"?>
<interface>
<object class="GtkGrid" id="grid">
<child>
<object class="GtkToolbar" id="toolbar">
<property name="orientation">horizontal</property>
<property name="halign">fill</property>
<property name="hexpand">True</property>
<child>
<object class="GtkMenuToolButton" id="menutool">
<property name="stock-id">gtk-open</property>
</object>
</child>
<child>
<object class="GtkToolButton" id="quit">
<property name="stock-id">gtk-quit</property>
<property name="action-name">app.quit</property>
</object>
</child>
<child>
<object class="GtkSeparatorToolItem" id="sep"/>
</child>
<child>
<object class="GtkToolButton" id="logo">
<property name="stock-id">demo-gtk-logo</property>
<property name="action-name">win.logo</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkInfoBar" id="infobar">
<property name="no-show-all">True</property>
<property name="halign">fill</property>
<property name="hexpand">True</property>
<child internal-child="content_area">
<object class="GtkBox" id="content_area">
<child>
<object class="GtkLabel" id="message">
<property name="visible">True</property>
<property name="hexpand">True</property>
<property name="halign">fill</property>
</object>
</child>
</object>
</child>
<child internal-child="action_area">
<object class="GtkBox" id="action_area">
<child>
<object class="GtkButton" id="button">
<property name="visible">True</property>
<property name="valign">center</property>
<property name="label">gtk-ok</property>
<property name="use-stock">True</property>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="sw">
<property name="shadow-type">in</property>
<child>
<object class="GtkTextView" id="contents">
<property name="halign">fill</property>
<property name="valign">fill</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkStatusbar" id="status">
<property name="halign">fill</property>
<property name="hexpand">True</property>
<property name="visible">True</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
</object>
<menu id="toolmenu">
<item>
<attribute name="label">File1</attribute>
<attribute name="action">win.file1</attribute>
</item>
</menu>
</interface>
+1 -3
View File
@@ -1,8 +1,6 @@
/* Application window
/* Application main window
*
* Demonstrates a typical application window with menubar, toolbar, statusbar.
*
* This example uses GtkUIManager and GtkActionGroup.
*/
#include <gtk/gtk.h>
+2 -2
View File
@@ -23,14 +23,14 @@ apply_changes_gradually (gpointer data)
if (fraction < 1.0)
{
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress_bar), fraction);
return G_SOURCE_CONTINUE;
return TRUE;
}
else
{
/* Close automatically once changes are fully applied. */
gtk_widget_destroy (assistant);
assistant = NULL;
return G_SOURCE_REMOVE;
return FALSE;
}
}
+1 -1
View File
@@ -172,7 +172,7 @@ button_press (GtkWidget *widget,
GtkWidget *menu;
GtkWidget *item;
if (button->button != GDK_BUTTON_SECONDARY)
if (button->button != 3)
return FALSE;
menu = gtk_menu_new ();
+13 -4
View File
@@ -36,17 +36,26 @@ change_color_callback (GtkWidget *button,
{
GtkWidget *dialog;
GtkColorSelection *colorsel;
GtkColorChooserDialog *selection_dialog;
GtkColorSelectionDialog *selection_dialog;
gint response;
dialog = gtk_color_chooser_dialog_new ("Changing color", GTK_WINDOW (window));
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (dialog), &color);
dialog = gtk_color_selection_dialog_new ("Changing color");
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window));
selection_dialog = GTK_COLOR_SELECTION_DIALOG (dialog);
colorsel = GTK_COLOR_SELECTION (gtk_color_selection_dialog_get_color_selection (selection_dialog));
gtk_color_selection_set_previous_rgba (colorsel, &color);
gtk_color_selection_set_current_rgba (colorsel, &color);
gtk_color_selection_set_has_palette (colorsel, TRUE);
response = gtk_dialog_run (GTK_DIALOG (dialog));
if (response == GTK_RESPONSE_OK)
{
gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (dialog), &color);
gtk_color_selection_get_current_rgba (colorsel, &color);
gtk_widget_override_background_color (da, 0, &color);
}
+1 -1
View File
@@ -97,7 +97,7 @@ scribble_button_press_event (GtkWidget *widget,
if (surface == NULL)
return FALSE; /* paranoia check, in case we haven't gotten a configure event */
if (event->button == GDK_BUTTON_PRIMARY)
if (event->button == 1)
draw_brush (widget, event->x, event->y);
/* We've handled the event, stop processing */
+1 -1
View File
@@ -116,7 +116,7 @@ if (defined @child_arrays) {
}
# toplevel
print "\nDemo gtk_demos[] = {\n";
print "\nDemo testgtk_demos[] = {\n";
$first = 1;
foreach $href (@demos) {
Binary file not shown.

Before

Width:  |  Height:  |  Size: 674 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

+1 -1
View File
@@ -144,7 +144,7 @@ event_after (GtkWidget *text_view,
event = (GdkEventButton *)ev;
if (event->button != GDK_BUTTON_PRIMARY)
if (event->button != 1)
return FALSE;
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view));
+1 -7
View File
@@ -63,13 +63,7 @@ do_links (GtkWidget *do_widget)
label = gtk_label_new ("Some <a href=\"http://en.wikipedia.org/wiki/Text\""
"title=\"plain text\">text</a> may be marked up\n"
"as hyperlinks, which can be clicked\n"
"or activated via <a href=\"keynav\">keynav</a>\n"
"and they work fine with other markup, like when\n"
"searching on <a href=\"http://www.google.com/\">"
"<span color=\"#0266C8\">G</span><span color=\"#F90101\">o</span>"
"<span color=\"#F2B50F\">o</span><span color=\"#0266C8\">g</span>"
"<span color=\"#00933B\">l</span><span color=\"#F90101\">e</span>"
"</a>.");
"or activated via <a href=\"keynav\">keynav</a>");
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
g_signal_connect (label, "activate-link", G_CALLBACK (activate_link), NULL);
gtk_container_add (GTK_CONTAINER (window), label);
+2 -2
View File
@@ -60,7 +60,7 @@ spinner_timeout (gpointer data)
guint pulse;
if (model == NULL)
return G_SOURCE_REMOVE;
return FALSE;
gtk_tree_model_get_iter_first (model, &iter);
gtk_tree_model_get (model, &iter,
@@ -77,7 +77,7 @@ spinner_timeout (gpointer data)
COLUMN_ACTIVE, TRUE,
-1);
return G_SOURCE_CONTINUE;
return TRUE;
}
static GtkTreeModel *
+5 -3
View File
@@ -782,7 +782,7 @@ create_tree (void)
GtkTreeIter iter;
GtkWidget *box, *label, *scrolled_window;
Demo *d = gtk_demos;
Demo *d = testgtk_demos;
model = gtk_tree_store_new (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_INT);
tree_view = gtk_tree_view_new ();
@@ -936,8 +936,10 @@ main (int argc, char **argv)
* these few lines, which are just a hack so gtk-demo will work
* in the GTK tree without installing it.
*/
if (g_file_test ("../../modules/input/immodules.cache", G_FILE_TEST_EXISTS))
if (g_file_test ("../../gdk-pixbuf/libpixbufloader-pnm.la",
G_FILE_TEST_EXISTS))
{
g_setenv ("GDK_PIXBUF_MODULE_FILE", "../../gdk-pixbuf/loaders.cache", TRUE);
g_setenv ("GTK_IM_MODULE_FILE", "../../modules/input/immodules.cache", TRUE);
}
/* -- End of hack -- */
@@ -1000,7 +1002,7 @@ main (int argc, char **argv)
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
gtk_widget_show_all (window);
load_file (gtk_demos[0].filename);
load_file (testgtk_demos[0].filename);
gtk_main ();
-107
View File
@@ -1,107 +0,0 @@
<?xml version="1.0"?>
<interface>
<menu id="appmenu">
<section>
<item>
<attribute name="label" translatable="yes">_New</attribute>
<attribute name="action">app.new</attribute>
<attribute name="accel">&lt;Primary&gt;n</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Open</attribute>
<attribute name="action">app.open</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Save</attribute>
<attribute name="action">app.save</attribute>
<attribute name="accel">&lt;Primary&gt;s</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Save _As...</attribute>
<attribute name="action">app.save-as</attribute>
<attribute name="accel">&lt;Primary&gt;s</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="action">app.quit</attribute>
<attribute name="accel">&lt;Primary&gt;q</attribute>
</item>
</section>
</menu>
<menu id="menubar">
<submenu>
<attribute name="label" translatable="yes">_Preferences</attribute>
<section>
<item>
<attribute name="label" translatable="yes">_Prefer Dark Theme</attribute>
<attribute name="action">app.dark</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Hide Titlebar when maximized</attribute>
<attribute name="action">win.titlebar</attribute>
</item>
<submenu>
<attribute name="label" translatable="yes">_Color</attribute>
<section>
<item>
<attribute name="label" translatable="yes">_Red</attribute>
<attribute name="action">app.color</attribute>
<attribute name="target">red</attribute>
<attribute name="accel">&lt;Primary&gt;r</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Green</attribute>
<attribute name="action">app.color</attribute>
<attribute name="target">green</attribute>
<attribute name="accel">&lt;Primary&gt;g</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Blue</attribute>
<attribute name="action">app.color</attribute>
<attribute name="target">blue</attribute>
<attribute name="accel">&lt;Primary&gt;b</attribute>
</item>
</section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_Shape</attribute>
<section>
<item>
<attribute name="label" translatable="yes">_Square</attribute>
<attribute name="action">win.shape</attribute>
<attribute name="target">square</attribute>
<attribute name="accel">&lt;Primary&gt;s</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Rectangle</attribute>
<attribute name="action">win.shape</attribute>
<attribute name="target">rectangle</attribute>
<attribute name="accel">&lt;Primary&gt;r</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Oval</attribute>
<attribute name="action">win.shape</attribute>
<attribute name="target">oval</attribute>
<attribute name="accel">&lt;Primary&gt;o</attribute>
</item>
</section>
</submenu>
<item>
<attribute name="label" translatable="yes">_Bold</attribute>
<attribute name="action">win.bold</attribute>
<attribute name="accel">&lt;Primary&gt;b</attribute>
</item>
</section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_Help</attribute>
<item>
<attribute name="label" translatable="yes">_About</attribute>
<attribute name="action">win.about</attribute>
<attribute name="accel">&lt;Primary&gt;a</attribute>
</item>
</submenu>
</menu>
</interface>
-17
View File
@@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist>
<enum id='org.gtk.Demo.Color'>
<value nick='red' value='0'/>
<value nick='green' value='1'/>
<value nick='blue' value='2'/>
</enum>
<schema id='org.gtk.Demo' path='/org/gtk/Demo/'>
<key name='color' enum='org.gtk.Demo.Color'>
<default>'red'</default>
</key>
</schema>
</schemalist>
+1 -1
View File
@@ -180,7 +180,7 @@ timeout (gpointer data)
GDK_THREADS_LEAVE ();
frame_num++;
return G_SOURCE_CONTINUE;
return TRUE;
}
static guint timeout_id;
+2 -1
View File
@@ -29,7 +29,8 @@ static gboolean
search_progress (gpointer data)
{
gtk_entry_progress_pulse (GTK_ENTRY (data));
return G_SOURCE_CONTINUE;
return TRUE;
}
static void
+2 -2
View File
@@ -49,7 +49,7 @@ scroll_to_end (GtkTextView *textview)
if (count > 150)
count = 0;
return G_SOURCE_CONTINUE;
return TRUE;
}
/* Scroll to the bottom of the buffer.
@@ -100,7 +100,7 @@ scroll_to_bottom (GtkTextView *textview)
if (count > 40)
count = 0;
return G_SOURCE_CONTINUE;
return TRUE;
}
static guint
+1 -1
View File
@@ -350,7 +350,7 @@ interactive_canvas_real_drag_leave (gpointer data)
gtk_widget_queue_draw (widget);
}
return G_SOURCE_REMOVE;
return FALSE;
}
static void
-31
View File
@@ -1,31 +0,0 @@
include $(top_srcdir)/Makefile.decl
bin_PROGRAMS = gtk3-widget-factory
gtk3_widget_factory_SOURCES = \
widget-factory.c \
widget_factory_resources.c
BUILT_SOURCES = \
widget_factory_resources.c
gtk3_widget_factory_DEPENDENCIES = \
$(top_builddir)/gtk/libgtk-3.la
gtk3_widget_factory_CPPFLAGS = \
-I$(top_srcdir) \
$(GTK_DEBUG_FLAGS) \
$(GTK_DEP_CFLAGS)
gtk3_widget_factory_LDADD = \
$(top_builddir)/gdk/libgdk-3.la \
$(top_builddir)/gtk/libgtk-3.la \
$(GTK_DEP_LIBS)
widget_factory_resources.c: widget-factory.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies $(srcdir)/widget-factory.gresource.xml)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $<
EXTRA_DIST += \
widget-factory.ui \
widget-factory.gresource.xml \
gtk-logo-256.png
Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/logos">
<file>gtk-logo-256.png</file>
</gresource>
<gresource prefix="/ui">
<file preprocess="xml-stripblanks">widget-factory.ui</file>
</gresource>
</gresources>
-4
View File
@@ -631,7 +631,6 @@ gdk_keymap_get_direction
gdk_keymap_have_bidi_layouts
gdk_keymap_get_caps_lock_state
gdk_keymap_get_num_lock_state
gdk_keymap_get_modifier_state
gdk_keymap_add_virtual_modifiers
gdk_keymap_map_virtual_modifiers
gdk_keymap_get_modifier_mask
@@ -760,9 +759,6 @@ GDK_PRIORITY_EVENTS
GDK_PRIORITY_REDRAW
GDK_EVENT_PROPAGATE
GDK_EVENT_STOP
GDK_BUTTON_PRIMARY
GDK_BUTTON_MIDDLE
GDK_BUTTON_SECONDARY
<SUBSECTION>
gdk_events_pending
+2 -6
View File
@@ -123,8 +123,7 @@ content_files = \
glossary.xml \
migrating-2to3.xml \
migrating-checklist.sgml \
migrating-unique-GtkApplication.xml \
migrating-smclient-GtkApplication.xml \
migrating-GtkApplication.xml \
migrating-GtkGrid.xml \
migrating-GtkStyleContext.xml \
objects_grouped.sgml \
@@ -147,8 +146,7 @@ expand_content_files = \
glossary.xml \
migrating-2to3.xml \
migrating-checklist.sgml \
migrating-unique-GtkApplication.xml \
migrating-smclient-GtkApplication.xml \
migrating-GtkApplication.xml \
migrating-GtkGrid.xml \
migrating-GtkStyleContext.xml \
question_index.sgml \
@@ -287,7 +285,6 @@ HTML_IMAGES = \
$(srcdir)/images/check-button.png \
$(srcdir)/images/color-button.png \
$(srcdir)/images/colorsel.png \
$(srcdir)/images/colorchooser.png \
$(srcdir)/images/combo-box.png \
$(srcdir)/images/combo-box-entry.png \
$(srcdir)/images/entry.png \
@@ -297,7 +294,6 @@ HTML_IMAGES = \
$(srcdir)/images/filechooser.png \
$(srcdir)/images/font-button.png \
$(srcdir)/images/fontsel.png \
$(srcdir)/images/fontchooser.png \
$(srcdir)/images/frame.png \
$(srcdir)/images/icon-view.png \
$(srcdir)/images/image.png \
+5 -11
View File
@@ -209,22 +209,18 @@
<chapter id="SelectorWidgets">
<title>Selectors (Color/File/Font)</title>
<xi:include href="xml/gtkcolorchooser.xml" />
<xi:include href="xml/gtkcolorbutton.xml" />
<xi:include href="xml/gtkcolorchooserwidget.xml" />
<xi:include href="xml/gtkcolorchooserdialog.xml" />
<xi:include href="xml/gtkcolorsel.xml" />
<xi:include href="xml/gtkcolorseldlg.xml" />
<xi:include href="xml/gtkcolorsel.xml" />
<xi:include href="xml/gtkhsv.xml" />
<xi:include href="xml/gtkfilechooser.xml" />
<xi:include href="xml/gtkfilechooserbutton.xml" />
<xi:include href="xml/gtkfilechooserdialog.xml" />
<xi:include href="xml/gtkfilechooserwidget.xml" />
<xi:include href="xml/gtkfilefilter.xml" />
<xi:include href="xml/gtkfontchooser.xml" />
<xi:include href="xml/gtkfontbutton.xml" />
<xi:include href="xml/gtkfontchooserwidget.xml" />
<xi:include href="xml/gtkfontchooserdialog.xml" />
<xi:include href="xml/gtkfontchooser.xml" />
<xi:include href="xml/gtkfontchooserdlg.xml" />
<xi:include href="xml/gtkfontsel.xml" />
<xi:include href="xml/gtkfontseldlg.xml" />
</chapter>
@@ -343,7 +339,6 @@
<title>Application support</title>
<xi:include href="xml/gtkapplication.xml" />
<xi:include href="xml/gtkapplicationwindow.xml" />
<xi:include href="xml/gtkactionable.xml" />
</chapter>
</part>
@@ -360,12 +355,11 @@
</para>
</partintro>
<xi:include href="xml/migrating-checklist.sgml" />
<xi:include href="xml/migrating-2to3.xml" />
<xi:include href="xml/migrating-GtkStyleContext.xml" />
<xi:include href="xml/migrating-unique-GtkApplication.xml" />
<xi:include href="xml/migrating-smclient-GtkApplication.xml" />
<xi:include href="xml/migrating-GtkApplication.xml" />
<xi:include href="xml/migrating-GtkGrid.xml" />
<xi:include href="xml/migrating-checklist.sgml" />
</part>
<part>
+4 -99
View File
@@ -37,7 +37,6 @@ gtk_about_dialog_get_logo
gtk_about_dialog_set_logo
gtk_about_dialog_get_logo_icon_name
gtk_about_dialog_set_logo_icon_name
gtk_about_dialog_add_credit_section
gtk_show_about_dialog
<SUBSECTION Standard>
GTK_ABOUT_DIALOG
@@ -1535,7 +1534,7 @@ gtk_font_chooser_widget_get_type
</SECTION>
<SECTION>
<FILE>gtkfontchooserdialog</FILE>
<FILE>gtkfontchooserdlg</FILE>
<TITLE>GtkFontChooserDialog</TITLE>
GtkFontChooserDialog
gtk_font_chooser_dialog_new
@@ -2060,7 +2059,6 @@ gtk_link_button_get_type
<TITLE>GtkMenu</TITLE>
GtkMenu
gtk_menu_new
gtk_menu_new_from_model
gtk_menu_set_screen
gtk_menu_reorder_child
gtk_menu_attach
@@ -2105,7 +2103,6 @@ gtk_menu_get_type
<TITLE>GtkMenuBar</TITLE>
GtkMenuBar
gtk_menu_bar_new
gtk_menu_bar_new_from_model
GtkPackDirection
gtk_menu_bar_set_pack_direction
gtk_menu_bar_get_pack_direction
@@ -2939,6 +2936,9 @@ gtk_scrolled_window_get_min_content_width
gtk_scrolled_window_set_min_content_width
gtk_scrolled_window_get_min_content_height
gtk_scrolled_window_set_min_content_height
GtkKineticScrollingFlags
gtk_scrolled_window_set_kinetic_scrolling
gtk_scrolled_window_get_kinetic_scrolling
<SUBSECTION Standard>
GTK_SCROLLED_WINDOW
@@ -5297,7 +5297,6 @@ gtk_window_set_gravity
gtk_window_get_gravity
gtk_window_set_position
gtk_window_set_transient_for
gtk_window_set_attached_to
gtk_window_set_destroy_with_parent
gtk_window_set_hide_titlebar_when_maximized
gtk_window_set_screen
@@ -5356,7 +5355,6 @@ gtk_window_get_role
gtk_window_get_size
gtk_window_get_title
gtk_window_get_transient_for
gtk_window_get_attached_to
gtk_window_get_type_hint
gtk_window_get_skip_taskbar_hint
gtk_window_get_skip_pager_hint
@@ -5685,7 +5683,6 @@ gtk_style_context_add_provider_for_screen
gtk_style_context_get
gtk_style_context_get_direction
gtk_style_context_get_junction_sides
gtk_style_context_set_parent
gtk_style_context_get_path
gtk_style_context_get_property
gtk_style_context_get_screen
@@ -5694,7 +5691,6 @@ gtk_style_context_get_style
gtk_style_context_get_style_property
gtk_style_context_get_style_valist
gtk_style_context_get_valist
gtk_style_context_get_section
gtk_style_context_get_color
gtk_style_context_get_background_color
gtk_style_context_get_border_color
@@ -5719,7 +5715,6 @@ gtk_style_context_restore
gtk_style_context_save
gtk_style_context_set_direction
gtk_style_context_set_junction_sides
gtk_style_context_set_parent
gtk_style_context_set_path
gtk_style_context_add_class
gtk_style_context_remove_class
@@ -7014,12 +7009,6 @@ gtk_application_add_window
gtk_application_remove_window
gtk_application_get_windows
<SUBSECTION>
GtkApplicationInhibitFlags
gtk_application_inhibit
gtk_application_uninhibit
gtk_application_is_inhibited
<SUBSECTION>
gtk_application_get_app_menu
gtk_application_set_app_menu
@@ -7061,32 +7050,6 @@ gtk_application_window_get_type
GtkApplicationWindowPrivate
</SECTION>
<SECTION>
<FILE>gtkactionable</FILE>
<TITLE>GtkActionable</TITLE>
GtkActionable
GtkActionableInterface
<SUBSECTION>
gtk_actionable_get_action_name
gtk_actionable_set_action_name
<SUBSECTION>
gtk_actionable_get_action_target_value
gtk_actionable_set_action_target_value
gtk_actionable_set_action_target
<SUBSECTION>
gtk_actionable_set_detailed_action_name
<SUBSECTION Standard>
gtk_actionable_get_type
GTK_ACTIONABLE
GTK_ACTIONABLE_GET_IFACE
GTK_IS_ACTIONABLE
GTK_TYPE_ACTIONABLE
</SECTION>
<SECTION>
<FILE>gtkgrid</FILE>
<TITLE>GtkGrid</TITLE>
@@ -7296,61 +7259,3 @@ GtkOverlayClass
gtk_overlay_get_type
GtkOverlayPrivate
</SECTION>
<SECTION>
<FILE>gtkcolorchooser</FILE>
<TITLE>GtkColorChooser</TITLE>
GtkColorChooser
gtk_color_chooser_get_rgba
gtk_color_chooser_set_rgba
gtk_color_chooser_get_use_alpha
gtk_color_chooser_set_use_alpha
gtk_color_chooser_add_palette
<SUBSECTION Standard>
GTK_TYPE_COLOR_CHOOSER
GTK_COLOR_CHOOSER
GTK_IS_COLOR_CHOOSER
GTK_COLOR_CHOOSER_GET_IFACE
<SUBSECTION Private>
gtk_color_chooser_get_type
</SECTION>
<SECTION>
<FILE>gtkcolorchooserwidget</FILE>
<TITLE>GtkColorChooserWidget</TITLE>
GtkColorChooserWidget
gtk_color_chooser_widget_new
<SUBSECTION Standard>
GTK_TYPE_COLOR_CHOOSER_WIDGET
GTK_COLOR_CHOOSER_WIDGET
GTK_COLOR_CHOOSER_WIDGET_CLASS
GTK_IS_COLOR_CHOOSER_WIDGET
GTK_IS_COLOR_CHOOSER_WIDGET_CLASS
GTK_COLOR_CHOOSER_WIDGET_GET_CLASS
<SUBSECTION Private>
gtk_color_chooser_widget_get_type
GtkColorChooserWidgetPrivate
</SECTION>
<SECTION>
<FILE>gtkcolorchooserdialog</FILE>
<TITLE>GtkColorChooserDialog</TITLE>
GtkColorChooserDialog
gtk_color_chooser_dialog_new
<SUBSECTION Standard>
GTK_TYPE_COLOR_CHOOSER_DIALOG
GTK_COLOR_CHOOSER_DIALOG
GTK_COLOR_CHOOSER_DIALOG_CLASS
GTK_IS_COLOR_CHOOSER_DIALOG
GTK_IS_COLOR_CHOOSER_DIALOG_CLASS
GTK_COLOR_CHOOSER_DIALOG_GET_CLASS
<SUBSECTION Private>
GtkColorChooserDialogPrivate
gtk_color_chooser_dialog_get_type
</SECTION>
-4
View File
@@ -6,7 +6,6 @@ gtk_accel_group_get_type
gtk_accel_label_get_type
gtk_accel_map_get_type
gtk_accessible_get_type
gtk_actionable_get_type
gtk_action_get_type
gtk_action_group_get_type
gtk_activatable_get_type
@@ -47,9 +46,6 @@ gtk_check_button_get_type
gtk_check_menu_item_get_type
gtk_clipboard_get_type
gtk_color_button_get_type
gtk_color_chooser_get_type
gtk_color_chooser_dialog_get_type
gtk_color_chooser_widget_get_type
gtk_color_selection_dialog_get_type
gtk_color_selection_get_type
gtk_combo_box_get_type
Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

@@ -2,7 +2,7 @@
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
<chapter id="gtk-migrating-unique-GtkApplication">
<chapter id="gtk-migrating-GtkApplication">
<title>Migrating from libunique to GApplication or GtkApplication</title>
@@ -20,7 +20,7 @@
<example><title>A unique application</title>
<para>Here is a simple application using libunique:
<informalexample><programlisting>
<programlisting>
int
main (int argc, char *argv[])
{
@@ -53,9 +53,9 @@ main (int argc, char *argv[])
return 0;
}
</programlisting></informalexample>
</programlisting>
The same application using GtkApplication:
<informalexample><programlisting>
<programlisting>
static void
activate (GtkApplication *app)
{
@@ -85,13 +85,13 @@ main (int argc, char *argv[])
app = gtk_application_new ("org.gtk.TestApplication", 0);
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
status = g_application_run (G_APPLICATION (app), argc, argv);
status = g_application_run (app);
g_object_unref (app);
return status;
}
</programlisting></informalexample>
</programlisting>
</para>
</example>
<section><title>Uniqueness</title>
+2 -2
View File
@@ -3,10 +3,10 @@
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
<chapter id="gtk-migrating-checklist">
<title>Migration Details Checklist</title>
<title>Migration Checklist</title>
<para>
This chapter includes a checklist of smaller things you need to do to
This chapter includes a checklist of things you need to do to
ensure that your programs are good citizens in the GTK+ world. By
paying attention to the points in the checklist, you ensure that
many automatic features of GTK+ will work correctly in your
@@ -1,48 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
<chapter id="gtk-migrating-smclient-GtkApplication">
<title>Migrating from EggSMClient to GtkApplication</title>
<para>
EggSMClient provides 'session management' support for applications.
This means a number of things:
<itemizedlist>
<listitem>logout notification and negotiation</listitem>
<listitem>application state saving</listitem>
<listitem>restarting of applications with saved state</listitem>
</itemizedlist>
EggSMClient supports this functionality to varying degrees on
Windows and OS X, as well as with XSMP and D-Bus based session
managers in X11.
</para>
<para>
Starting with GTK+ 3.4, #GtkApplication supports logout notification
and negotiation similar to EggSMClient.
</para>
<table>
<tgroup cols="2">
<title>EggSMClient to GtkApplication</title>
<thead>
<row><entry>EggSMClient</entry><entry>GtkApplication</entry></row>
</thead>
<tbody>
<row><entry>EggSMClient::quit-requested</entry><entry>instead of calling will_quit (FALSE,...) in response to this signal, install an inhibitor</entry></row>
<row><entry>EggSMClient::quit</entry><entry>the #GtkApplication::quit signal</entry></row>
<row><entry>EggSMClient::quit-cancelled</entry><entry></entry></row>
<row><entry>egg_sm_client_will_quit</entry><entry>instead of calling will_quit (FALSE,...), install an inhibitor</entry></row>
<row><entry>egg_sm_client_end_session</entry><entry>gtk_application_end_session()</entry></row>
</tbody>
</tgroup>
</table>
<para>
At this point, GtkApplication has no special support for state saving.
Applications can use GSettings or GKeyFile and save as much state as
they see fit in response to #GtkApplication::quit or whenever they
consider appropriate.
</para>
</chapter>
+2 -2
View File
@@ -121,9 +121,9 @@ Here's a simple example:
do_small_part_of_task ();
if (task_complete)
return G_SOURCE_REMOVE; /* removes the idle handler */
return FALSE; /* removes the idle handler */
else
return G_SOURCE_CONTINUE; /* runs the idle handler again */
return TRUE; /* runs the idle handler again */
}
g_idle_add (my_idle_handler, NULL);
-6
View File
@@ -135,10 +135,4 @@
<link linkend="GtkSwitch">
<inlinegraphic fileref="switch.png" format="PNG"></inlinegraphic>
</link>
<link linkend="GtkColorChooserDialog">
<inlinegraphic fileref="colorchooser.png" format="PNG"></inlinegraphic>
</link>
<link linkend="GtkFontChooserDialog">
<inlinegraphic fileref="fontchooser.png" format="PNG"></inlinegraphic>
</link>
</para>
-29
View File
@@ -1154,33 +1154,6 @@ create_appchooserdialog (void)
return info;
}
static WidgetInfo *
create_fontchooserdialog (void)
{
WidgetInfo *info;
GtkWidget *widget;
widget = gtk_font_chooser_dialog_new ("Font Chooser Dialog", NULL);
gtk_window_set_default_size (GTK_WINDOW (widget), 200, 300);
info = new_widget_info ("fontchooser", widget, ASIS);
info->include_decorations = TRUE;
return info;
}
static WidgetInfo *
create_colorchooserdialog (void)
{
WidgetInfo *info;
GtkWidget *widget;
widget = gtk_color_chooser_dialog_new ("Color Chooser Dialog", NULL);
info = new_widget_info ("colorchooser", widget, ASIS);
info->include_decorations = TRUE;
return info;
}
GList *
get_all_widgets (void)
{
@@ -1231,8 +1204,6 @@ get_all_widgets (void)
retval = g_list_prepend (retval, create_appchooserbutton ());
retval = g_list_prepend (retval, create_appchooserdialog ());
retval = g_list_prepend (retval, create_lockbutton ());
retval = g_list_prepend (retval, create_fontchooserdialog ());
retval = g_list_prepend (retval, create_colorchooserdialog ());
return retval;
}
+37 -128
View File
@@ -13,14 +13,6 @@ activate_toggle (GSimpleAction *action,
g_variant_unref (state);
}
static void
activate_radio (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
g_action_change_state (G_ACTION (action), parameter);
}
static void
change_fullscreen_state (GSimpleAction *action,
GVariant *state,
@@ -34,29 +26,6 @@ change_fullscreen_state (GSimpleAction *action,
g_simple_action_set_state (action, state);
}
static void
change_justify_state (GSimpleAction *action,
GVariant *state,
gpointer user_data)
{
GtkTextView *text = g_object_get_data (user_data, "bloatpad-text");
const gchar *str;
str = g_variant_get_string (state, NULL);
if (g_str_equal (str, "left"))
gtk_text_view_set_justification (text, GTK_JUSTIFY_LEFT);
else if (g_str_equal (str, "center"))
gtk_text_view_set_justification (text, GTK_JUSTIFY_CENTER);
else if (g_str_equal (str, "right"))
gtk_text_view_set_justification (text, GTK_JUSTIFY_RIGHT);
else
/* ignore this attempted change */
return;
g_simple_action_set_state (action, state);
}
static GtkClipboard *
get_clipboard (GtkWidget *widget)
{
@@ -93,8 +62,7 @@ window_paste (GSimpleAction *action,
static GActionEntry win_entries[] = {
{ "copy", window_copy, NULL, NULL, NULL },
{ "paste", window_paste, NULL, NULL, NULL },
{ "fullscreen", activate_toggle, NULL, "false", change_fullscreen_state },
{ "justify", activate_radio, "s", "'left'", change_justify_state }
{ "fullscreen", activate_toggle, NULL, "false", change_fullscreen_state }
};
static void
@@ -102,9 +70,6 @@ new_window (GApplication *app,
GFile *file)
{
GtkWidget *window, *grid, *scrolled, *view;
GtkWidget *toolbar;
GtkToolItem *button;
GtkWidget *sw, *box, *label;
window = gtk_application_window_new (GTK_APPLICATION (app));
gtk_window_set_default_size ((GtkWindow*)window, 640, 480);
@@ -114,36 +79,6 @@ new_window (GApplication *app,
grid = gtk_grid_new ();
gtk_container_add (GTK_CONTAINER (window), grid);
toolbar = gtk_toolbar_new ();
button = gtk_toggle_tool_button_new_from_stock (GTK_STOCK_JUSTIFY_LEFT);
gtk_actionable_set_detailed_action_name (GTK_ACTIONABLE (button), "win.justify::left");
gtk_container_add (GTK_CONTAINER (toolbar), GTK_WIDGET (button));
button = gtk_toggle_tool_button_new_from_stock (GTK_STOCK_JUSTIFY_CENTER);
gtk_actionable_set_detailed_action_name (GTK_ACTIONABLE (button), "win.justify::center");
gtk_container_add (GTK_CONTAINER (toolbar), GTK_WIDGET (button));
button = gtk_toggle_tool_button_new_from_stock (GTK_STOCK_JUSTIFY_RIGHT);
gtk_actionable_set_detailed_action_name (GTK_ACTIONABLE (button), "win.justify::right");
gtk_container_add (GTK_CONTAINER (toolbar), GTK_WIDGET (button));
button = gtk_separator_tool_item_new ();
gtk_separator_tool_item_set_draw (GTK_SEPARATOR_TOOL_ITEM (button), FALSE);
gtk_tool_item_set_expand (GTK_TOOL_ITEM (button), TRUE);
gtk_container_add (GTK_CONTAINER (toolbar), GTK_WIDGET (button));
button = gtk_tool_item_new ();
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_container_add (GTK_CONTAINER (button), box);
label = gtk_label_new ("Fullscreen:");
gtk_container_add (GTK_CONTAINER (box), label);
sw = gtk_switch_new ();
gtk_actionable_set_action_name (GTK_ACTIONABLE (sw), "win.fullscreen");
gtk_container_add (GTK_CONTAINER (box), sw);
gtk_container_add (GTK_CONTAINER (toolbar), GTK_WIDGET (button));
gtk_grid_attach (GTK_GRID (grid), toolbar, 0, 0, 1, 1);
scrolled = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_set_hexpand (scrolled, TRUE);
gtk_widget_set_vexpand (scrolled, TRUE);
@@ -153,7 +88,7 @@ new_window (GApplication *app,
gtk_container_add (GTK_CONTAINER (scrolled), view);
gtk_grid_attach (GTK_GRID (grid), scrolled, 0, 1, 1, 1);
gtk_grid_attach (GTK_GRID (grid), scrolled, 0, 0, 1, 1);
if (file != NULL)
{
@@ -207,15 +142,13 @@ new_activated (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GApplication *app = user_data;
g_application_activate (app);
g_application_activate (user_data);
}
static void
about_activated (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
show_about (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
gtk_show_about_dialog (NULL,
"program-name", "Bloatpad",
@@ -225,19 +158,31 @@ about_activated (GSimpleAction *action,
}
static void
quit_activated (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
quit_app (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GApplication *app = user_data;
GList *list, *next;
GtkWindow *win;
g_application_quit (app);
g_print ("Going down...\n");
list = gtk_application_get_windows (GTK_APPLICATION (g_application_get_default ()));
while (list)
{
win = list->data;
next = list->next;
gtk_widget_destroy (GTK_WIDGET (win));
list = next;
}
}
static GActionEntry app_entries[] = {
{ "new", new_activated, NULL, NULL, NULL },
{ "about", about_activated, NULL, NULL, NULL },
{ "quit", quit_activated, NULL, NULL, NULL },
{ "about", show_about, NULL, NULL, NULL },
{ "quit", quit_app, NULL, NULL, NULL },
};
static void
@@ -255,50 +200,25 @@ bloat_pad_startup (GApplication *application)
"<interface>"
" <menu id='app-menu'>"
" <section>"
" <item>"
" <attribute name='label' translatable='yes'>_New Window</attribute>"
" <attribute name='action'>app.new</attribute>"
" <attribute name='accel'>&lt;Primary&gt;n</attribute>"
" </item>"
" <item label='_New Window' action='app.new' accel='<Primary>n'/>"
" </section>"
" <section>"
" <item>"
" <attribute name='label' translatable='yes'>_About Bloatpad</attribute>"
" <attribute name='action'>app.about</attribute>"
" </item>"
" <item label='_About Bloatpad' action='app.about'/>"
" </section>"
" <section>"
" <item>"
" <attribute name='label' translatable='yes'>_Quit</attribute>"
" <attribute name='action'>app.quit</attribute>"
" <attribute name='accel'>&lt;Primary&gt;q</attribute>"
" </item>"
" <item label='_Quit' action='app.quit' accel='<Primary>q'/>"
" </section>"
" </menu>"
" <menu id='menubar'>"
" <submenu>"
" <attribute name='label' translatable='yes'>_Edit</attribute>"
" <submenu label='_Edit'>"
" <section>"
" <item>"
" <attribute name='label' translatable='yes'>_Copy</attribute>"
" <attribute name='action'>win.copy</attribute>"
" <attribute name='accel'>&lt;Primary&gt;c</attribute>"
" </item>"
" <item>"
" <attribute name='label' translatable='yes'>_Parse</attribute>"
" <attribute name='action'>win.parse</attribute>"
" <attribute name='accel'>&lt;Primary&gt;v</attribute>"
" </item>"
" <item label='_Copy' action='win.copy' accel='<Primary>c'/>"
" <item label='_Paste' action='win.paste' accel='<Primary>v'/>"
" </section>"
" </submenu>"
" <submenu>"
" <attribute name='label' translatable='yes'>_View</attribute>"
" <submenu label='_View'>"
" <section>"
" <item>"
" <attribute name='label' translatable='yes'>_Fullscreen</attribute>"
" <attribute name='action'>win.fullscreen</attribute>"
" <attribute name='accel'>F11</attribute>"
" </item>"
" <item label='_Fullscreen' action='win.fullscreen'/>"
" </section>"
" </submenu>"
" </menu>"
@@ -330,20 +250,12 @@ bloat_pad_class_init (BloatPadClass *class)
BloatPad *
bloat_pad_new (void)
{
GtkApplication *bloat_pad;
g_type_init ();
g_set_application_name ("Bloatpad");
bloat_pad = g_object_new (bloat_pad_get_type (),
"application-id", "org.gtk.Test.bloatpad",
"flags", G_APPLICATION_HANDLES_OPEN,
"inactivity-timeout", 30000,
"register-session", TRUE,
NULL);
return bloat_pad;
return g_object_new (bloat_pad_get_type (),
"application-id", "org.gtk.Test.bloatpad",
"flags", G_APPLICATION_HANDLES_OPEN,
NULL);
}
int
@@ -353,12 +265,9 @@ main (int argc, char **argv)
int status;
bloat_pad = bloat_pad_new ();
gtk_application_add_accelerator (GTK_APPLICATION (bloat_pad),
"F11", "win.fullscreen", NULL);
status = g_application_run (G_APPLICATION (bloat_pad), argc, argv);
g_object_unref (bloat_pad);
return status;
+2 -2
View File
@@ -86,11 +86,11 @@ button_press_event_cb (GtkWidget *widget,
if (surface == NULL)
return FALSE;
if (event->button == GDK_BUTTON_PRIMARY)
if (event->button == 1)
{
draw_brush (widget, event->x, event->y);
}
else if (event->button == GDK_BUTTON_SECONDARY)
else if (event->button == 3)
{
clear_surface ();
gtk_widget_queue_draw (widget);
+4 -5
View File
@@ -223,7 +223,6 @@ enable_plugin (const gchar *name)
g_signal_connect (action, "activate", G_CALLBACK (plugin_action), (gpointer)name);
g_action_map_add_action (G_ACTION_MAP (g_application_get_default ()), action);
g_print ("Actions of '%s' plugin added\n", name);
g_object_unref (action);
plugin_menu = find_plugin_menu ();
if (plugin_menu)
@@ -231,14 +230,14 @@ enable_plugin (const gchar *name)
GMenu *section;
GMenuItem *item;
gchar *label;
gchar *action_name;
gchar *action;
section = g_menu_new ();
label = g_strdup_printf ("Turn text %s", name);
action_name = g_strconcat ("app.", name, NULL);
g_menu_insert (section, 0, label, action_name);
action = g_strconcat ("app.", name, NULL);
g_menu_insert (section, 0, label, action);
g_free (label);
g_free (action_name);
g_free (action);
item = g_menu_item_new_section (NULL, (GMenuModel*)section);
g_menu_item_set_attribute (item, "id", "s", name);
g_menu_append_item (G_MENU (plugin_menu), item);
+8 -20
View File
@@ -362,7 +362,7 @@ parse_input (BroadwayInput *input)
gsize len, payload_len;
BroadwayWSOpCode code;
gboolean is_mask, fin;
guchar *buf, *data, *mask;
guchar *buf, *data;
buf = input->buffer->data;
len = input->buffer->len;
@@ -391,16 +391,6 @@ parse_input (BroadwayInput *input)
payload_len = GUINT64_FROM_BE( *(guint64 *) data );
data += 8;
}
mask = NULL;
if (is_mask)
{
if (data - buf + 4 > len)
return;
mask = data;
data += 4;
}
if (data - buf + payload_len > len)
return; /* wait to accumulate more */
@@ -408,7 +398,8 @@ parse_input (BroadwayInput *input)
{
gsize i;
for (i = 0; i < payload_len; i++)
data[i] ^= mask[i%4];
data[i + 4] ^= data[i%4];
data += 4;
}
switch (code) {
@@ -422,11 +413,7 @@ parse_input (BroadwayInput *input)
#endif
}
else
{
char *terminated = g_strndup((char *)data, payload_len);
parse_input_message (input, terminated);
g_free (terminated);
}
parse_input_message (input, (char *)data);
break;
case BROADWAY_WS_CNX_PING:
broadway_output_pong (broadway_display->output);
@@ -487,7 +474,7 @@ process_input_idle_cb (GdkBroadwayDisplay *display)
{
display->process_input_idle = 0;
process_input_messages (display);
return G_SOURCE_REMOVE;
return FALSE;
}
static void
@@ -1016,7 +1003,7 @@ got_http_request_line (GInputStream *stream,
/* Protect against overflow in request length */
if (request->request->len > 1024 * 5)
{
send_error (request, 400, "Request too long");
send_error (request, 400, "Request to long");
}
else
{
@@ -1226,7 +1213,8 @@ gdk_broadway_display_finalize (GObject *object)
_gdk_broadway_cursor_display_finalize (GDK_DISPLAY_OBJECT(broadway_display));
/* input GdkDevice list */
g_list_free_full (broadway_display->input_devices, g_object_unref);
g_list_foreach (broadway_display->input_devices, (GFunc) g_object_unref, NULL);
g_list_free (broadway_display->input_devices);
/* Free all GdkScreens */
g_object_unref (broadway_display->screens[0]);
g_free (broadway_display->screens);
+1 -1
View File
@@ -895,7 +895,7 @@ gdk_threads_add_idle (GSourceFunc function,
*
* self->timeout_id = 0;
*
* return G_SOURCE_REMOVE;
* return FALSE;
* }
*
* static void some_widget_do_stuff_later (SomeWidget *self)
-1
View File
@@ -209,7 +209,6 @@ gdk_keymap_get_entries_for_keycode
gdk_keymap_get_entries_for_keyval
gdk_keymap_get_for_display
gdk_keymap_get_modifier_mask
gdk_keymap_get_modifier_state
gdk_keymap_get_num_lock_state
gdk_keymap_get_type
gdk_keymap_have_bidi_layouts
-2
View File
@@ -38,7 +38,6 @@
* screen or workspace.
* <example>
* <title>Launching an application</title>
* <informalexample>
* <programlisting>
* GdkAppLaunchContext *context;
*
@@ -52,7 +51,6 @@
*
* g_object_unref (context);
* </programlisting>
* </informalexample>
* </example>
*/
+3 -1
View File
@@ -61,6 +61,7 @@ typedef enum
* of a stylus on a graphics tablet.
* @GDK_SOURCE_CURSOR: the device is a graphics tablet "puck" or similar device.
* @GDK_SOURCE_KEYBOARD: the device is a keyboard.
* @GDK_SOURCE_TOUCH: the device is a touch capable device.
*
* An enumeration describing the type of an input device in general terms.
*/
@@ -70,7 +71,8 @@ typedef enum
GDK_SOURCE_PEN,
GDK_SOURCE_ERASER,
GDK_SOURCE_CURSOR,
GDK_SOURCE_KEYBOARD
GDK_SOURCE_KEYBOARD,
GDK_SOURCE_TOUCH
} GdkInputSource;
/**
+26 -11
View File
@@ -154,7 +154,8 @@ free_device_grabs_foreach (gpointer key,
{
GList *list = value;
g_list_free_full (list, (GDestroyNotify) free_device_grab);
g_list_foreach (list, (GFunc) free_device_grab, NULL);
g_list_free (list);
return TRUE;
}
@@ -210,7 +211,8 @@ gdk_display_dispose (GObject *object)
device_manager = gdk_display_get_device_manager (GDK_DISPLAY (object));
g_list_free_full (display->queued_events, (GDestroyNotify) gdk_event_free);
g_list_foreach (display->queued_events, (GFunc)gdk_event_free, NULL);
g_list_free (display->queued_events);
display->queued_events = NULL;
display->queued_tail = NULL;
@@ -897,15 +899,25 @@ switch_to_pointer_grab (GdkDisplay *display,
if (grab == NULL) /* Ungrabbed, send events */
{
pointer_window = NULL;
if (new_toplevel)
{
/* Find (possibly virtual) child window */
pointer_window =
_gdk_window_find_descendant_at (new_toplevel,
x, y,
NULL, NULL);
}
/* If the source device is a touch device, do not
* propagate any enter event yet, until one is
* synthesized when needed.
*/
if (source_device &&
gdk_device_get_source (source_device) == GDK_SOURCE_TOUCH)
info->need_touch_press_enter = TRUE;
pointer_window = NULL;
if (new_toplevel &&
!info->need_touch_press_enter)
{
/* Find (possibly virtual) child window */
pointer_window =
_gdk_window_find_descendant_at (new_toplevel,
x, y,
NULL, NULL);
}
if (pointer_window != last_grab->window)
synthesize_crossing_events (display, device, source_device,
@@ -1120,6 +1132,9 @@ _gdk_display_get_pointer_info (GdkDisplay *display,
{
GdkPointerWindowInfo *info;
if (device && gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
device = gdk_device_get_associated_device (device);
if (G_UNLIKELY (!device))
return NULL;
+2
View File
@@ -75,6 +75,8 @@ typedef struct
gdouble toplevel_x, toplevel_y;
guint32 state;
guint32 button;
GdkDevice *last_slave;
guint need_touch_press_enter : 1;
} GdkPointerWindowInfo;
typedef struct
+3 -3
View File
@@ -1460,7 +1460,7 @@ gdk_event_request_motions (const GdkEventMotion *event)
* also trigger a context menu if this modifier is pressed.
*
* This function should always be used instead of simply checking for
* event->button == %GDK_BUTTON_SECONDARY.
* event->button == 3.
*
* Returns: %TRUE if the event should trigger a context menu.
*
@@ -1479,7 +1479,7 @@ gdk_event_triggers_context_menu (const GdkEvent *event)
g_return_val_if_fail (GDK_IS_WINDOW (bevent->window), FALSE);
if (bevent->button == GDK_BUTTON_SECONDARY &&
if (bevent->button == 3 &&
! (bevent->state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK)))
return TRUE;
@@ -1489,7 +1489,7 @@ gdk_event_triggers_context_menu (const GdkEvent *event)
GDK_MODIFIER_INTENT_CONTEXT_MENU);
if (modifier != 0 &&
bevent->button == GDK_BUTTON_PRIMARY &&
bevent->button == 1 &&
! (bevent->state & (GDK_BUTTON2_MASK | GDK_BUTTON3_MASK)) &&
(bevent->state & modifier))
return TRUE;
+13 -32
View File
@@ -94,37 +94,6 @@ G_BEGIN_DECLS
*/
#define GDK_EVENT_STOP (TRUE)
/**
* GDK_BUTTON_PRIMARY:
*
* The primary button. This is typically the left mouse button, or the
* right button in a left-handed setup.
*
* Since: 3.4
*/
#define GDK_BUTTON_PRIMARY (1)
/**
* GDK_BUTTON_MIDDLE:
*
* The middle button.
*
* Since: 3.4
*/
#define GDK_BUTTON_MIDDLE (2)
/**
* GDK_BUTTON_SECONDARY:
*
* The secondary button. This is typically the right mouse button, or the
* left button in a left-handed setup.
*
* Since: 3.4
*/
#define GDK_BUTTON_SECONDARY (3)
typedef struct _GdkEventAny GdkEventAny;
typedef struct _GdkEventExpose GdkEventExpose;
typedef struct _GdkEventVisibility GdkEventVisibility;
@@ -385,6 +354,15 @@ typedef enum
* @GDK_CROSSING_GTK_UNGRAB: crossing because a GTK+ grab is deactivated.
* @GDK_CROSSING_STATE_CHANGED: crossing because a GTK+ widget changed
* state (e.g. sensitivity).
* @GDK_CROSSING_STATE_CHANGED: crossing because a GTK+ widget changed
* state (e.g. sensitivity).
* @GDK_CROSSING_TOUCH_PRESS: crossing because a touch device was pressed,
* this event is synthetic as the pointer might have not left the window.
* @GDK_CROSSING_TOUCH_RELEASE: crossing because a touch device was released.
* this event is synthetic as the pointer might have not left the window.
* @GDK_CROSSING_DEVICE_SWITCH: crossing because of a device switch (i.e.
* a mouse taking control of the pointer after a touch device), this event
* is synthetic as the pointer didn't leave the window.
*
* Specifies the crossing mode for #GdkEventCrossing.
*/
@@ -395,7 +373,10 @@ typedef enum
GDK_CROSSING_UNGRAB,
GDK_CROSSING_GTK_GRAB,
GDK_CROSSING_GTK_UNGRAB,
GDK_CROSSING_STATE_CHANGED
GDK_CROSSING_STATE_CHANGED,
GDK_CROSSING_TOUCH_PRESS,
GDK_CROSSING_TOUCH_RELEASE,
GDK_CROSSING_DEVICE_SWITCH
} GdkCrossingMode;
/**
-21
View File
@@ -378,27 +378,6 @@ gdk_keymap_get_num_lock_state (GdkKeymap *keymap)
return GDK_KEYMAP_GET_CLASS (keymap)->get_num_lock_state (keymap);
}
/**
* gdk_keymap_get_modifier_state:
* @keymap: a #GdkKeymap
*
* Returns the current modifier state.
*
* Returns: the current modifier state.
*
* Since: 3.2
*/
guint
gdk_keymap_get_modifier_state (GdkKeymap *keymap)
{
g_return_val_if_fail (GDK_IS_KEYMAP (keymap), FALSE);
if (GDK_KEYMAP_GET_CLASS (keymap)->get_modifier_state)
return GDK_KEYMAP_GET_CLASS (keymap)->get_modifier_state (keymap);
return 0;
}
/**
* gdk_keymap_get_entries_for_keyval:
* @keymap: a #GdkKeymap
-1
View File
@@ -110,7 +110,6 @@ PangoDirection gdk_keymap_get_direction (GdkKeymap *keymap)
gboolean gdk_keymap_have_bidi_layouts (GdkKeymap *keymap);
gboolean gdk_keymap_get_caps_lock_state (GdkKeymap *keymap);
gboolean gdk_keymap_get_num_lock_state (GdkKeymap *keymap);
guint gdk_keymap_get_modifier_state (GdkKeymap *keymap);
void gdk_keymap_add_virtual_modifiers (GdkKeymap *keymap,
GdkModifierType *state);
gboolean gdk_keymap_map_virtual_modifiers (GdkKeymap *keymap,
-1
View File
@@ -63,7 +63,6 @@ struct _GdkKeymapClass
GdkModifierType *state);
GdkModifierType (*get_modifier_mask) (GdkKeymap *keymap,
GdkModifierIntent intent);
guint (* get_modifier_state) (GdkKeymap *keymap);
/* Signals */
+8 -1
View File
@@ -145,12 +145,19 @@ _gdk_offscreen_window_create_surface (GdkWindow *offscreen,
{
cairo_surface_t *similar;
cairo_surface_t *surface;
cairo_content_t content = CAIRO_CONTENT_COLOR;
g_return_val_if_fail (GDK_IS_OFFSCREEN_WINDOW (offscreen->impl), NULL);
similar = _gdk_window_ref_cairo_surface (offscreen->parent);
surface = cairo_surface_create_similar (similar, CAIRO_CONTENT_COLOR_ALPHA, width, height);
if (gdk_window_get_visual (offscreen) ==
gdk_screen_get_rgba_visual (gdk_window_get_screen (offscreen)))
{
content = CAIRO_CONTENT_COLOR_ALPHA;
}
surface = cairo_surface_create_similar (similar, content, width, height);
cairo_surface_destroy (similar);
+20 -34
View File
@@ -27,8 +27,6 @@
#include "config.h"
#include "gdkrgba.h"
#include <string.h>
#include <errno.h>
#include <math.h>
/**
* SECTION:rgba_colors
@@ -73,7 +71,15 @@ G_DEFINE_BOXED_TYPE (GdkRGBA, gdk_rgba,
GdkRGBA *
gdk_rgba_copy (const GdkRGBA *rgba)
{
return g_slice_dup (GdkRGBA, rgba);
GdkRGBA *copy;
copy = g_slice_new (GdkRGBA);
copy->red = rgba->red;
copy->green = rgba->green;
copy->blue = rgba->blue;
copy->alpha = rgba->alpha;
return copy;
}
/**
@@ -103,17 +109,14 @@ gdk_rgba_free (GdkRGBA *rgba)
* - We accept mixed percentages and non-percentages in a single
* rgb() or rgba() specification.
*/
static gboolean
parse_rgb_value (const gchar *str,
gchar **endp,
gdouble *number)
static double
parse_rgb_value (const char *str,
char **endp)
{
double number;
const char *p;
*number = g_ascii_strtod (str, endp);
if (errno == ERANGE || *endp == str ||
isinf (*number) || isnan (*number))
return FALSE;
number = g_ascii_strtod (str, endp);
p = *endp;
@@ -122,14 +125,12 @@ parse_rgb_value (const gchar *str,
if (*p == '%')
{
*endp = (char *)(p + 1);
*number = CLAMP(*number / 100., 0., 1.);
return CLAMP(number / 100., 0., 1.);
}
else
{
*number = CLAMP(*number / 255., 0., 1.);
return CLAMP(number / 255., 0., 1.);
}
return TRUE;
}
/**
@@ -175,7 +176,6 @@ gdk_rgba_parse (GdkRGBA *rgba,
gboolean has_alpha;
gdouble r, g, b, a;
gchar *str = (gchar *) spec;
gchar *p;
if (strncmp (str, "rgba", 4) == 0)
{
@@ -220,8 +220,7 @@ gdk_rgba_parse (GdkRGBA *rgba,
/* Parse red */
SKIP_WHITESPACES (str);
if (!parse_rgb_value (str, &str, &r))
return FALSE;
r = parse_rgb_value (str, &str);
SKIP_WHITESPACES (str);
if (*str != ',')
@@ -231,8 +230,7 @@ gdk_rgba_parse (GdkRGBA *rgba,
/* Parse green */
SKIP_WHITESPACES (str);
if (!parse_rgb_value (str, &str, &g))
return FALSE;
g = parse_rgb_value (str, &str);
SKIP_WHITESPACES (str);
if (*str != ',')
@@ -242,8 +240,7 @@ gdk_rgba_parse (GdkRGBA *rgba,
/* Parse blue */
SKIP_WHITESPACES (str);
if (!parse_rgb_value (str, &str, &b))
return FALSE;
b = parse_rgb_value (str, &str);
SKIP_WHITESPACES (str);
if (has_alpha)
@@ -254,24 +251,13 @@ gdk_rgba_parse (GdkRGBA *rgba,
str++;
SKIP_WHITESPACES (str);
a = g_ascii_strtod (str, &p);
if (errno == ERANGE || p == str ||
isinf (a) || isnan (a))
return FALSE;
str = p;
a = g_ascii_strtod (str, &str);
SKIP_WHITESPACES (str);
}
if (*str != ')')
return FALSE;
str++;
SKIP_WHITESPACES (str);
if (*str != '\0')
return FALSE;
if (rgba)
{
rgba->red = CLAMP (r, 0, 1);
+158 -57
View File
@@ -203,8 +203,8 @@ struct _GdkWindowPaint
{
cairo_region_t *region;
cairo_surface_t *surface;
cairo_region_t *flushed;
guint uses_implicit : 1;
guint flushed : 1;
};
typedef struct {
@@ -824,7 +824,7 @@ gdk_window_update_visibility (GdkWindow *window)
window->effective_visibility = new_visibility;
if (new_visibility != GDK_VISIBILITY_NOT_VIEWABLE &&
window->event_mask & GDK_VISIBILITY_NOTIFY_MASK)
window->event_mask & GDK_VISIBILITY_NOTIFY)
{
event = _gdk_make_event (window, GDK_VISIBILITY_NOTIFY,
NULL, FALSE);
@@ -1420,8 +1420,7 @@ gdk_window_new (GdkWindow *parent,
window->depth = window->visual->depth;
/* XXX: Cache this somehow? */
window->background = cairo_pattern_create_rgba (0, 0, 0, 0);
window->has_alpha_background = TRUE;
window->background = cairo_pattern_create_rgb (0, 0, 0);
}
else
{
@@ -2066,8 +2065,12 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
window->clip_region_with_children = NULL;
}
g_list_free_full (window->outstanding_moves, (GDestroyNotify) gdk_window_region_move_free);
window->outstanding_moves = NULL;
if (window->outstanding_moves)
{
g_list_foreach (window->outstanding_moves, (GFunc)gdk_window_region_move_free, NULL);
g_list_free (window->outstanding_moves);
window->outstanding_moves = NULL;
}
}
break;
}
@@ -2714,7 +2717,7 @@ gdk_window_begin_implicit_paint (GdkWindow *window, GdkRectangle *rect)
paint = g_new (GdkWindowPaint, 1);
paint->region = cairo_region_create (); /* Empty */
paint->uses_implicit = FALSE;
paint->flushed = NULL;
paint->flushed = FALSE;
paint->surface = gdk_window_create_similar_surface (window,
gdk_window_get_content (window),
MAX (rect->width, 1),
@@ -2762,11 +2765,9 @@ gdk_window_flush_implicit_paint (GdkWindow *window)
return;
paint = impl_window->implicit_paint;
paint->flushed = TRUE;
region = cairo_region_copy (window->clip_region_with_children);
cairo_region_translate (region, window->abs_x, window->abs_y);
cairo_region_intersect (region, paint->region);
/* Don't flush active double buffers, as that may show partially done
* rendering */
for (list = window->paint_stack; list != NULL; list = list->next)
@@ -2776,6 +2777,9 @@ gdk_window_flush_implicit_paint (GdkWindow *window)
cairo_region_subtract (region, tmp_paint->region);
}
cairo_region_translate (region, -window->abs_x, -window->abs_y);
cairo_region_intersect (region, paint->region);
if (!GDK_WINDOW_DESTROYED (window) && !cairo_region_is_empty (region))
{
cairo_t *cr;
@@ -2791,11 +2795,9 @@ gdk_window_flush_implicit_paint (GdkWindow *window)
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
cairo_paint (cr);
cairo_destroy (cr);
paint->flushed = region;
}
else
cairo_region_destroy (region);
cairo_region_destroy (region);
}
/* Ends an implicit paint, paired with gdk_window_begin_implicit_paint returning TRUE */
@@ -2827,8 +2829,7 @@ gdk_window_end_implicit_paint (GdkWindow *window)
}
cairo_region_destroy (paint->region);
if (paint->flushed)
cairo_region_destroy (paint->flushed);
cairo_surface_destroy (paint->surface);
g_free (paint);
}
@@ -2970,33 +2971,12 @@ gdk_window_begin_paint_region (GdkWindow *window,
if (!gdk_window_has_impl (window) &&
window->has_alpha_background &&
(!implicit_paint ||
(implicit_paint && implicit_paint->flushed != NULL && !cairo_region_is_empty (implicit_paint->flushed))))
(implicit_paint && implicit_paint->flushed)))
{
cairo_t *cr = cairo_create (paint->surface);
/* We can't use gdk_cairo_set_source_window here, as that might
flush the implicit paint at an unfortunate time, since this
would be detected as a draw during non-expose time */
cairo_surface_t *source_surface = gdk_window_ref_impl_surface (impl_window);
cairo_set_source_surface (cr, source_surface,
- (window->abs_x + clip_box.x),
- (window->abs_y + clip_box.y));
cairo_surface_destroy (source_surface);
/* Only read back the flushed area if any */
if (implicit_paint)
{
cairo_region_t *flushed = cairo_region_copy (implicit_paint->flushed);
cairo_region_intersect (flushed, region);
/* Convert from impl coords */
cairo_region_translate (flushed, -window->abs_x, -window->abs_y);
gdk_cairo_region (cr, flushed);
cairo_clip (cr);
/* Convert to impl coords */
cairo_region_translate (flushed, window->abs_x, window->abs_y);
cairo_region_subtract (implicit_paint->flushed, flushed);
cairo_region_destroy (flushed);
}
gdk_cairo_set_source_window (cr, impl_window,
- (window->abs_x + clip_box.x),
- (window->abs_y + clip_box.y));
cairo_paint (cr);
cairo_destroy (cr);
}
@@ -3575,6 +3555,44 @@ gdk_window_clear_backing_region (GdkWindow *window,
cairo_region_destroy (clip);
}
static void
gdk_window_clear_backing_region_direct (GdkWindow *window,
cairo_region_t *region)
{
GdkWindowPaint paint;
cairo_region_t *clip;
cairo_t *cr;
if (GDK_WINDOW_DESTROYED (window))
return;
paint.surface = _gdk_window_ref_cairo_surface (window);
cr = setup_backing_rect (window, &paint);
clip = cairo_region_copy (window->clip_region_with_children);
cairo_region_intersect (clip, region);
gdk_cairo_region (cr, clip);
cairo_fill (cr);
cairo_destroy (cr);
cairo_region_destroy (clip);
cairo_surface_destroy (paint.surface);
}
static void
gdk_window_clear_region_internal (GdkWindow *window,
cairo_region_t *region)
{
if (window->paint_stack)
gdk_window_clear_backing_region (window, region);
else
gdk_window_clear_backing_region_direct (window, region);
}
static void
gdk_window_drop_cairo_surface (GdkWindow *window)
{
@@ -3895,7 +3913,7 @@ _gdk_window_process_updates_recurse (GdkWindow *window,
* piggyback on the implicit paint */
gdk_window_begin_paint_region (window, clipped_expose_region);
/* The actual clear happens in begin_paint_region */
gdk_window_clear_region_internal (window, clipped_expose_region);
gdk_window_end_paint (window);
}
}
@@ -3927,7 +3945,8 @@ _gdk_window_process_updates_recurse (GdkWindow *window,
}
}
g_list_free_full (children, g_object_unref);
g_list_foreach (children, (GFunc)g_object_unref, NULL);
g_list_free (children);
}
@@ -8321,9 +8340,11 @@ send_crossing_event (GdkDisplay *display,
GdkEvent *event;
guint32 window_event_mask, type_event_mask;
GdkDeviceGrabInfo *grab;
GdkPointerWindowInfo *pointer_info;
gboolean block_event = FALSE;
grab = _gdk_display_has_device_grab (display, device, serial);
pointer_info = _gdk_display_get_pointer_info (display, device);
if (grab != NULL &&
!grab->owner_events)
@@ -8336,7 +8357,13 @@ send_crossing_event (GdkDisplay *display,
else
window_event_mask = window->event_mask;
if (type == GDK_LEAVE_NOTIFY)
if (pointer_info->need_touch_press_enter &&
mode != GDK_CROSSING_TOUCH_PRESS &&
mode != GDK_CROSSING_TOUCH_RELEASE)
{
block_event = TRUE;
}
else if (type == GDK_LEAVE_NOTIFY)
{
type_event_mask = GDK_LEAVE_NOTIFY_MASK;
window->devices_inside = g_list_remove (window->devices_inside, device);
@@ -9045,7 +9072,7 @@ do_synthesize_crossing_event (gpointer data)
_gdk_synthesize_crossing_events (display,
pointer_info->window_under_pointer,
new_window_under_pointer,
device, NULL,
device, pointer_info->last_slave,
GDK_CROSSING_NORMAL,
pointer_info->toplevel_x,
pointer_info->toplevel_y,
@@ -9160,7 +9187,7 @@ proxy_pointer_event (GdkDisplay *display,
guint state;
gdouble toplevel_x, toplevel_y;
guint32 time_;
gboolean non_linear;
gboolean non_linear, need_synthetic_enter = FALSE;
event_window = source_event->any.window;
gdk_event_get_coords (source_event, &toplevel_x, &toplevel_y);
@@ -9180,6 +9207,13 @@ proxy_pointer_event (GdkDisplay *display,
source_event->crossing.detail == GDK_NOTIFY_NONLINEAR_VIRTUAL))
non_linear = TRUE;
if (pointer_info->need_touch_press_enter &&
gdk_device_get_source (pointer_info->last_slave) != GDK_SOURCE_TOUCH)
{
pointer_info->need_touch_press_enter = FALSE;
need_synthetic_enter = TRUE;
}
/* If we get crossing events with subwindow unexpectedly being NULL
that means there is a native subwindow that gdk doesn't know about.
We track these and forward them, with the correct virtual window
@@ -9303,6 +9337,18 @@ proxy_pointer_event (GdkDisplay *display,
gdk_window_get_device_events (event_win, device) == 0)
return TRUE;
/* The last device to interact with the window was a touch device,
* which synthesized a leave notify event, so synthesize another enter
* notify to tell the pointer is on the window.
*/
if (need_synthetic_enter)
_gdk_synthesize_crossing_events (display,
NULL, pointer_window,
device, source_device,
GDK_CROSSING_DEVICE_SWITCH,
toplevel_x, toplevel_y,
state, time_, NULL,
serial, FALSE);
is_hint = FALSE;
if (event_win &&
@@ -9361,6 +9407,7 @@ proxy_button_event (GdkEvent *source_event,
GdkWindow *pointer_window;
GdkWindow *parent;
GdkEvent *event;
GdkPointerWindowInfo *pointer_info;
guint state;
guint32 time_;
GdkEventType type;
@@ -9380,6 +9427,7 @@ proxy_button_event (GdkEvent *source_event,
toplevel_window = convert_native_coords_to_toplevel (event_window,
toplevel_x, toplevel_y,
&toplevel_x, &toplevel_y);
pointer_info = _gdk_display_get_pointer_info (display, device);
if (type == GDK_BUTTON_PRESS &&
!source_event->any.send_event &&
@@ -9432,6 +9480,30 @@ proxy_button_event (GdkEvent *source_event,
gdk_window_get_device_events (event_win, device) == 0)
return TRUE;
if (type == GDK_BUTTON_PRESS &&
pointer_info->need_touch_press_enter)
{
GdkCrossingMode mode;
/* The last device to interact with the window was a touch device,
* which synthesized a leave notify event, so synthesize another enter
* notify to tell the pointer is on the window.
*/
if (gdk_device_get_source (source_device) == GDK_SOURCE_TOUCH)
mode = GDK_CROSSING_TOUCH_PRESS;
else
mode = GDK_CROSSING_DEVICE_SWITCH;
pointer_info->need_touch_press_enter = FALSE;
_gdk_synthesize_crossing_events (display,
NULL,
pointer_info->window_under_pointer,
device, source_device, mode,
toplevel_x, toplevel_y,
state, time_, source_event,
serial, FALSE);
}
event = _gdk_make_event (event_win, type, source_event, FALSE);
switch (type)
@@ -9452,7 +9524,23 @@ proxy_button_event (GdkEvent *source_event,
gdk_event_set_source_device (event, source_device);
if (type == GDK_BUTTON_PRESS)
_gdk_event_button_generate (display, event);
_gdk_event_button_generate (display, event);
else if (type == GDK_BUTTON_RELEASE &&
pointer_window == pointer_info->window_under_pointer &&
gdk_device_get_source (source_device) == GDK_SOURCE_TOUCH)
{
/* Synthesize a leave notify event
* whenever a touch device is released
*/
pointer_info->need_touch_press_enter = TRUE;
_gdk_synthesize_crossing_events (display,
pointer_window, NULL,
device, source_device,
GDK_CROSSING_TOUCH_RELEASE,
toplevel_x, toplevel_y,
state, time_, NULL,
serial, FALSE);
}
return TRUE;
case GDK_SCROLL:
@@ -9571,6 +9659,17 @@ _gdk_windowing_got_event (GdkDisplay *display,
{
GdkInputMode mode;
if (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD)
{
pointer_info = _gdk_display_get_pointer_info (display, device);
if (source_device != pointer_info->last_slave &&
gdk_device_get_device_type (source_device) == GDK_DEVICE_TYPE_SLAVE)
pointer_info->last_slave = source_device;
else
source_device = pointer_info->last_slave;
}
g_object_get (device, "input-mode", &mode, NULL);
_gdk_display_device_grab_update (display, device, source_device, serial);
@@ -9589,8 +9688,6 @@ _gdk_windowing_got_event (GdkDisplay *display,
if (!event_window)
return;
pointer_info = _gdk_display_get_pointer_info (display, device);
#ifdef DEBUG_WINDOW_PRINTING
if (event->type == GDK_KEY_PRESS &&
(event->key.keyval == 0xa7 ||
@@ -9675,15 +9772,19 @@ _gdk_windowing_got_event (GdkDisplay *display,
}
}
/* Store last pointer window and position/state */
old_state = pointer_info->state;
old_button = pointer_info->button;
if (pointer_info)
{
/* Store last pointer window and position/state */
old_state = pointer_info->state;
old_button = pointer_info->button;
gdk_event_get_coords (event, &x, &y);
convert_native_coords_to_toplevel (event_window, x, y, &x, &y);
pointer_info->toplevel_x = x;
pointer_info->toplevel_y = y;
gdk_event_get_state (event, &pointer_info->state);
}
gdk_event_get_coords (event, &x, &y);
convert_native_coords_to_toplevel (event_window, x, y, &x, &y);
pointer_info->toplevel_x = x;
pointer_info->toplevel_y = y;
gdk_event_get_state (event, &pointer_info->state);
if (event->type == GDK_BUTTON_PRESS ||
event->type == GDK_BUTTON_RELEASE)
pointer_info->button = event->button.button;
+2 -2
View File
@@ -180,7 +180,7 @@ create_builtin_cursor (GdkCursorType cursor_type)
cursor = gdk_quartz_cursor_new_from_nscursor (nscursor, GDK_CURSOR_IS_PIXMAP);
cached_xcursors[cursor_type] = g_object_ref (cursor);
cached_xcursors[cursor_type] = gdk_cursor_ref (cursor);
GDK_QUARTZ_RELEASE_POOL;
@@ -243,7 +243,7 @@ _gdk_quartz_display_get_cursor_for_type (GdkDisplay *display,
case GDK_BLANK_CURSOR:
return create_blank_cursor ();
default:
return g_object_ref (create_builtin_cursor (cursor_type));
return gdk_cursor_ref (create_builtin_cursor (cursor_type));
}
[nscursor retain];
+2 -1
View File
@@ -308,7 +308,8 @@ gdk_quartz_display_finalize (GObject *object)
{
GdkQuartzDisplay *display_quartz = GDK_QUARTZ_DISPLAY (object);
g_list_free_full (display_quartz->input_devices, g_object_unref);
g_list_foreach (display_quartz->input_devices, (GFunc) g_object_unref, NULL);
g_list_free (display_quartz->input_devices);
G_OBJECT_CLASS (gdk_quartz_display_parent_class)->finalize (object);
}
-7
View File
@@ -963,13 +963,6 @@ fill_key_event (GdkWindow *window,
event->key.state |= _gdk_quartz_events_get_current_mouse_modifiers ();
/* The X11 backend adds the first virtual modifier MOD2..MOD5 are
* mapped to. Since we only have one virtual modifier in the quartz
* backend, calling the standard function will do.
*/
gdk_keymap_add_virtual_modifiers (gdk_keymap_get_for_display (_gdk_display),
&event->key.state);
event->key.string = NULL;
/* Fill in ->string since apps depend on it, taken from the x11 backend. */
+1 -12
View File
@@ -1630,18 +1630,7 @@ gdk_window_quartz_restack_toplevel (GdkWindow *window,
GdkWindow *sibling,
gboolean above)
{
GdkWindowImplQuartz *impl;
gint sibling_num;
impl = GDK_WINDOW_IMPL_QUARTZ (sibling->impl);
sibling_num = [impl->toplevel windowNumber];
impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
if (above)
[impl->toplevel orderWindow:NSWindowAbove relativeTo:sibling_num];
else
[impl->toplevel orderWindow:NSWindowBelow relativeTo:sibling_num];
/* FIXME: Implement this */
}
static void
+3 -3
View File
@@ -19,9 +19,9 @@ progs_ldadd = \
#check_gdk_cairo_SOURCES = check-gdk-cairo.c
#check_gdk_cairo_LDADD = $(progs_ldadd)
TEST_PROGS += rgba
rgba_SOURCES = rgba.c
rgba_LDADD = $(progs_ldadd)
TEST_PROGS += gdk-color
gdk_color_SOURCES = gdk-color.c
gdk_color_LDADD = $(progs_ldadd)
TEST_PROGS += encoding
encoding_SOURCES = encoding.c
+2 -64
View File
@@ -49,14 +49,6 @@ test_color_parse (void)
res = gdk_rgba_parse (&color, "#0080ff");
g_assert (res);
g_assert (gdk_rgba_equal (&color, &expected));
expected.red = 0.0;
expected.green = 0.0;
expected.blue = 0.0;
expected.alpha = 1.0;
res = gdk_rgba_parse (&color, "rgb(0,0,0)");
g_assert (res);
g_assert (gdk_rgba_equal (&color, &expected));
}
static void
@@ -98,67 +90,13 @@ test_color_to_string (void)
g_free (orig);
}
static void
test_color_copy (void)
{
GdkRGBA rgba;
GdkRGBA *out;
rgba.red = 0.0;
rgba.green = 0.1;
rgba.blue = 0.6;
rgba.alpha = 0.9;
out = gdk_rgba_copy (&rgba);
g_assert (gdk_rgba_equal (&rgba, out));
gdk_rgba_free (out);
}
static void
test_color_parse_nonsense (void)
{
GdkRGBA color;
gboolean res;
g_test_bug ("667485");
res = gdk_rgba_parse (&color, "rgb(,,)");
g_assert (!res);
res = gdk_rgba_parse (&color, "rgb(%,%,%)");
g_assert (!res);
res = gdk_rgba_parse (&color, "rgb(nan,nan,nan)");
g_assert (!res);
res = gdk_rgba_parse (&color, "rgb(inf,inf,inf)");
g_assert (!res);
res = gdk_rgba_parse (&color, "rgb(1p12,0,0)");
g_assert (!res);
res = gdk_rgba_parse (&color, "rgb(5d1%,1,1)");
g_assert (!res);
res = gdk_rgba_parse (&color, "rgb(0,0,0)moo");
g_assert (!res);
res = gdk_rgba_parse (&color, "rgb(0,0,0) moo");
g_assert (!res);
}
int
main (int argc, char *argv[])
{
g_test_init (&argc, &argv, NULL);
g_test_bug_base ("http://bugzilla.gnome.org");
g_test_add_func ("/rgba/parse", test_color_parse);
g_test_add_func ("/rgba/parse/nonsense", test_color_parse_nonsense);
g_test_add_func ("/rgba/to-string", test_color_to_string);
g_test_add_func ("/rgba/copy", test_color_copy);
g_test_add_func ("/color/parse", test_color_parse);
g_test_add_func ("/color/to-string", test_color_to_string);
return g_test_run ();
}
+2 -2
View File
@@ -227,7 +227,7 @@ create_cursor(GdkDisplayWayland *display, GdkPixbuf *pixbuf, int x, int y)
fd,
cursor->width,
cursor->height,
stride, WL_SHM_FORMAT_ARGB8888);
stride, WL_SHM_FORMAT_ARGB32);
close(fd);
@@ -293,7 +293,7 @@ _gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
{
gchar *filename;
filename = g_build_filename (directories[j],
"weston",
"wayland",
cursor_definitions[i].filename,
NULL);
if (g_file_test (filename, G_FILE_TEST_EXISTS))
+19 -447
View File
@@ -17,11 +17,6 @@
* Boston, MA 02111-1307, USA.
*/
#define _GNU_SOURCE
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include "config.h"
#include <string.h>
@@ -37,8 +32,6 @@
#include <X11/extensions/XKBcommon.h>
#include <X11/keysym.h>
#include <sys/time.h>
#define GDK_TYPE_DEVICE_CORE (gdk_device_core_get_type ())
#define GDK_DEVICE_CORE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE_CORE, GdkDeviceCore))
#define GDK_DEVICE_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE_CORE, GdkDeviceCoreClass))
@@ -52,8 +45,6 @@ typedef struct _GdkWaylandDevice GdkWaylandDevice;
typedef struct _DataOffer DataOffer;
typedef struct _GdkWaylandSelectionOffer GdkWaylandSelectionOffer;
struct _GdkWaylandDevice
{
GdkDisplay *display;
@@ -66,16 +57,9 @@ struct _GdkWaylandDevice
struct wl_data_device *data_device;
int32_t x, y, surface_x, surface_y;
uint32_t time;
GdkWindow *pointer_grab_window;
uint32_t pointer_grab_time;
guint32 repeat_timer;
guint32 repeat_key;
guint32 repeat_count;
DataOffer *drag_offer;
DataOffer *selection_offer;
GdkWaylandSelectionOffer *selection_offer_out;
};
struct _GdkDeviceCore
@@ -155,20 +139,14 @@ gdk_device_core_set_window_cursor (GdkDevice *device,
int x, y;
if (cursor)
g_object_ref (cursor);
/* Setting the cursor to NULL means that we should use the default cursor */
if (!cursor)
{
/* FIXME: Is this the best sensible default ? */
cursor = _gdk_wayland_display_get_cursor_for_type (device->display,
GDK_LEFT_PTR);
buffer = _gdk_wayland_cursor_get_buffer(cursor, &x, &y);
wl_input_device_attach(wd->device, wd->time, buffer, x, y);
}
else
{
wl_input_device_attach(wd->device, wd->time, NULL, 0, 0);
}
buffer = _gdk_wayland_cursor_get_buffer(cursor, &x, &y);
wl_input_device_attach(wd->device, wd->time, buffer, x, y);
g_object_unref (cursor);
}
static void
@@ -223,30 +201,6 @@ gdk_device_core_grab (GdkDevice *device,
GdkCursor *cursor,
guint32 time_)
{
GdkWaylandDevice *wayland_device = GDK_DEVICE_CORE (device)->device;
if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
{
/* Device is a keyboard */
return GDK_GRAB_SUCCESS;
}
else
{
/* Device is a pointer */
if (wayland_device->pointer_grab_window != NULL &&
time_ != 0 && wayland_device->pointer_grab_time > time_)
{
return GDK_GRAB_ALREADY_GRABBED;
}
if (time_ == 0)
time_ = wayland_device->time;
wayland_device->pointer_grab_window = window;
wayland_device->pointer_grab_time = time_;
}
return GDK_GRAB_SUCCESS;
}
@@ -254,23 +208,6 @@ static void
gdk_device_core_ungrab (GdkDevice *device,
guint32 time_)
{
GdkDisplay *display;
GdkDeviceGrabInfo *grab;
display = gdk_device_get_display (device);
if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
{
/* Device is a keyboard */
}
else
{
/* Device is a pointer */
grab = _gdk_display_get_last_device_grab (display, device);
if (grab)
grab->serial_end = grab->serial_start;
}
}
static GdkWindow *
@@ -378,19 +315,6 @@ input_handle_button(void *data, struct wl_input_device *input_device,
GdkDisplayWayland *display = GDK_DISPLAY_WAYLAND (device->display);
GdkEvent *event;
uint32_t modifier;
int gdk_button;
switch (button) {
case 273:
gdk_button = 3;
break;
case 274:
gdk_button = 2;
break;
default:
gdk_button = button - 271;
break;
}
device->time = time;
event = gdk_event_new (state ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE);
@@ -403,10 +327,10 @@ input_handle_button(void *data, struct wl_input_device *input_device,
event->button.y_root = (gdouble) device->y;
event->button.axes = NULL;
event->button.state = device->modifiers;
event->button.button = gdk_button;
event->button.button = button - 271;
gdk_event_set_screen (event, display->screen);
modifier = 1 << (8 + gdk_button - 1);
modifier = 1 << (8 + button - 272);
if (state)
device->modifiers |= modifier;
else
@@ -484,13 +408,11 @@ translate_keyboard_string (GdkEventKey *event)
}
}
static gboolean
keyboard_repeat (gpointer data);
static gboolean
deliver_key_event(GdkWaylandDevice *device,
uint32_t time, uint32_t key, uint32_t state)
static void
input_handle_key(void *data, struct wl_input_device *input_device,
uint32_t time, uint32_t key, uint32_t state)
{
GdkWaylandDevice *device = data;
GdkEvent *event;
uint32_t code, modifier, level;
struct xkb_desc *xkb;
@@ -533,60 +455,6 @@ deliver_key_event(GdkWaylandDevice *device,
"string %s, mods 0x%x",
code, event->key.keyval,
event->key.string, event->key.state));
device->repeat_count++;
device->repeat_key = key;
if (state == 0)
{
if (device->repeat_timer)
{
g_source_remove (device->repeat_timer);
device->repeat_timer = 0;
}
return FALSE;
}
else if (modifier)
{
return FALSE;
}
else switch (device->repeat_count)
{
case 1:
if (device->repeat_timer)
{
g_source_remove (device->repeat_timer);
device->repeat_timer = 0;
}
device->repeat_timer =
gdk_threads_add_timeout (400, keyboard_repeat, device);
return TRUE;
case 2:
device->repeat_timer =
gdk_threads_add_timeout (80, keyboard_repeat, device);
return FALSE;
default:
return TRUE;
}
}
static gboolean
keyboard_repeat (gpointer data)
{
GdkWaylandDevice *device = data;
return deliver_key_event (device, device->time, device->repeat_key, 1);
}
static void
input_handle_key(void *data, struct wl_input_device *input_device,
uint32_t time, uint32_t key, uint32_t state)
{
GdkWaylandDevice *device = data;
device->repeat_count = 0;
deliver_key_event (data, time, key, state);
}
static void
@@ -688,7 +556,6 @@ input_handle_keyboard_focus(void *data,
device->time = time;
if (device->keyboard_focus)
{
_gdk_wayland_window_remove_focus (device->keyboard_focus);
event = gdk_event_new (GDK_FOCUS_CHANGE);
event->focus_change.window = g_object_ref (device->keyboard_focus);
event->focus_change.send_event = FALSE;
@@ -723,8 +590,6 @@ input_handle_keyboard_focus(void *data,
device, device->keyboard_focus));
_gdk_wayland_display_deliver_event (device->display, event);
_gdk_wayland_window_add_focus (device->keyboard_focus);
}
}
@@ -858,21 +723,14 @@ data_device_selection (void *data,
struct wl_data_offer *offer)
{
GdkWaylandDevice *device = (GdkWaylandDevice *)data;
GdkDeviceManager *device_manager =
gdk_display_get_device_manager (device->display);
GdkDeviceManagerCore *device_manager_core =
GDK_DEVICE_MANAGER_CORE (device_manager);
g_debug (G_STRLOC ": %s wl_data_device = %p wl_data_offer = %p",
G_STRFUNC, wl_data_device, offer);
if (!offer)
{
if (device->selection_offer)
{
data_offer_unref (device->selection_offer);
device->selection_offer = NULL;
}
return;
}
if (device->selection_offer)
{
data_offer_unref (device->selection_offer);
@@ -953,7 +811,7 @@ _gdk_wayland_device_manager_add_device (GdkDeviceManager *device_manager,
}
static void
free_device (gpointer data)
free_device (void *data, void *user_data)
{
g_object_unref (data);
}
@@ -965,7 +823,8 @@ gdk_device_manager_core_finalize (GObject *object)
device_manager_core = GDK_DEVICE_MANAGER_CORE (object);
g_list_free_full (device_manager_core->devices, free_device);
g_list_foreach (device_manager_core->devices, free_device, NULL);
g_list_free (device_manager_core->devices);
G_OBJECT_CLASS (gdk_device_manager_core_parent_class)->finalize (object);
}
@@ -1018,290 +877,3 @@ _gdk_wayland_device_manager_new (GdkDisplay *display)
"display", display,
NULL);
}
gint
gdk_wayland_device_get_selection_type_atoms (GdkDevice *gdk_device,
GdkAtom **atoms_out)
{
gint i;
GdkAtom *atoms;
GdkWaylandDevice *device;
g_return_val_if_fail (GDK_IS_DEVICE_CORE (gdk_device), 0);
g_return_val_if_fail (atoms_out != NULL, 0);
device = GDK_DEVICE_CORE (gdk_device)->device;
if (!device->selection_offer || device->selection_offer->types->len == 0)
{
*atoms_out = NULL;
return 0;
}
atoms = g_new0 (GdkAtom, device->selection_offer->types->len);
/* Convert list of targets to atoms */
for (i = 0; i < device->selection_offer->types->len; i++)
{
atoms[i] = gdk_atom_intern (device->selection_offer->types->pdata[i],
FALSE);
GDK_NOTE (MISC,
g_message (G_STRLOC ": Adding atom for %s",
(char *)device->selection_offer->types->pdata[i]));
}
*atoms_out = atoms;
return device->selection_offer->types->len;
}
typedef struct
{
GdkWaylandDevice *device;
DataOffer *offer;
GIOChannel *channel;
GdkDeviceWaylandRequestContentCallback cb;
gpointer userdata;
} RequestContentClosure;
static gboolean
_request_content_io_func (GIOChannel *channel,
GIOCondition condition,
gpointer userdata)
{
RequestContentClosure *closure = (RequestContentClosure *)userdata;
gchar *data = NULL;
gsize len = 0;
GError *error = NULL;
/* FIXME: We probably want to do something better than this to avoid
* blocking on the transfer of large pieces of data: call the callback
* multiple times I should think.
*/
if (g_io_channel_read_to_end (channel,
&data,
&len,
&error) != G_IO_STATUS_NORMAL)
{
g_warning (G_STRLOC ": Error reading content from pipe: %s", error->message);
g_clear_error (&error);
}
/* Since we use _read_to_end we've got a guaranteed EOF and thus can go
* ahead and close the fd
*/
g_io_channel_shutdown (channel, TRUE, NULL);
closure->cb (closure->device->pointer, data, len, closure->userdata);
g_free (data);
data_offer_unref (closure->offer);
g_io_channel_unref (channel);
g_free (closure);
return FALSE;
}
gboolean
gdk_wayland_device_request_selection_content (GdkDevice *gdk_device,
const gchar *requested_mime_type,
GdkDeviceWaylandRequestContentCallback cb,
gpointer userdata)
{
int pipe_fd[2];
RequestContentClosure *closure;
GdkWaylandDevice *device;
GError *error = NULL;
g_return_val_if_fail (GDK_IS_DEVICE_CORE (gdk_device), FALSE);
g_return_val_if_fail (requested_mime_type != NULL, FALSE);
g_return_val_if_fail (cb != NULL, FALSE);
device = GDK_DEVICE_CORE (gdk_device)->device;
if (!device->selection_offer)
return FALSE;
/* TODO: Check mimetypes */
closure = g_new0 (RequestContentClosure, 1);
device->selection_offer->ref_count++;
pipe2 (pipe_fd, O_CLOEXEC);
wl_data_offer_receive (device->selection_offer->offer,
requested_mime_type,
pipe_fd[1]);
close (pipe_fd[1]);
closure->device = device;
closure->offer = device->selection_offer;
closure->channel = g_io_channel_unix_new (pipe_fd[0]);
closure->cb = cb;
closure->userdata = userdata;
if (!g_io_channel_set_encoding (closure->channel, NULL, &error))
{
g_warning (G_STRLOC ": Error setting encoding on channel: %s",
error->message);
g_clear_error (&error);
goto error;
}
g_io_add_watch (closure->channel,
G_IO_IN,
_request_content_io_func,
closure);
return TRUE;
error:
data_offer_unref (closure->offer);
g_io_channel_unref (closure->channel);
close (pipe_fd[1]);
g_free (closure);
return FALSE;
}
struct _GdkWaylandSelectionOffer {
GdkDeviceWaylandOfferContentCallback cb;
gpointer userdata;
struct wl_data_source *source;
GdkWaylandDevice *device;
};
static void
data_source_target (void *data,
struct wl_data_source *source,
const char *mime_type)
{
g_debug (G_STRLOC ": %s source = %p, mime_type = %s",
G_STRFUNC, source, mime_type);
}
static void
data_source_send (void *data,
struct wl_data_source *source,
const char *mime_type,
int32_t fd)
{
GdkWaylandSelectionOffer *offer = (GdkWaylandSelectionOffer *)data;;
gchar *buf;
gssize len, bytes_written = 0;
g_debug (G_STRLOC ": %s source = %p, mime_type = %s fd = %d",
G_STRFUNC, source, mime_type, fd);
buf = offer->cb (offer->device->pointer, mime_type, &len, offer->userdata);
while (len > 0)
{
bytes_written += write (fd, buf + bytes_written, len);
if (bytes_written == -1)
goto error;
len -= bytes_written;
}
close (fd);
g_free (buf);
return;
error:
g_warning (G_STRLOC ": Error writing data to client: %s",
g_strerror (errno));
close (fd);
g_free (buf);
}
static void
data_source_cancelled (void *data,
struct wl_data_source *source)
{
g_debug (G_STRLOC ": %s source = %p",
G_STRFUNC, source);
}
static const struct wl_data_source_listener data_source_listener = {
data_source_target,
data_source_send,
data_source_cancelled
};
static guint32
_wl_time_now (void)
{
struct timeval tv;
gettimeofday(&tv, NULL);
return tv.tv_sec * 1000 + tv.tv_usec / 1000;
}
gboolean
gdk_wayland_device_offer_selection_content (GdkDevice *gdk_device,
const gchar **mime_types,
gint nr_mime_types,
GdkDeviceWaylandOfferContentCallback cb,
gpointer userdata)
{
GdkDisplay *display;
GdkDisplayWayland *display_wayland;
GdkWaylandSelectionOffer *offer;
GdkWaylandDevice *device;
gint i;
g_return_val_if_fail (GDK_IS_DEVICE_CORE (gdk_device), 0);
device = GDK_DEVICE_CORE (gdk_device)->device;
display = device->display;
display_wayland = GDK_DISPLAY_WAYLAND (display);
offer = g_new0 (GdkWaylandSelectionOffer, 1);
offer->cb = cb;
offer->userdata = userdata;
offer->source =
wl_data_device_manager_create_data_source (display_wayland->data_device_manager);
offer->device = device;
for (i = 0; i < nr_mime_types; i++)
{
wl_data_source_offer (offer->source,
mime_types[i]);
}
wl_data_source_add_listener (offer->source,
&data_source_listener,
offer);
wl_data_device_set_selection (device->data_device,
offer->source,
_wl_time_now ());
device->selection_offer_out = offer;
return TRUE;
}
gboolean
gdk_wayland_device_clear_selection_content (GdkDevice *gdk_device)
{
GdkWaylandDevice *device;
g_return_val_if_fail (GDK_IS_DEVICE_CORE (gdk_device), 0);
device = GDK_DEVICE_CORE (gdk_device)->device;
if (!device->selection_offer_out)
return FALSE;
wl_data_device_set_selection (device->data_device,
NULL,
_wl_time_now ());
wl_data_source_destroy (device->selection_offer_out->source);
g_free (device->selection_offer_out);
device->selection_offer_out = NULL;
return TRUE;
}
+3 -3
View File
@@ -274,7 +274,8 @@ gdk_wayland_display_finalize (GObject *object)
g_object_unref (display_wayland->keymap);
/* input GdkDevice list */
g_list_free_full (display_wayland->input_devices, g_object_unref);
g_list_foreach (display_wayland->input_devices, (GFunc) g_object_unref, NULL);
g_list_free (display_wayland->input_devices);
g_object_unref (display_wayland->screen);
@@ -425,8 +426,7 @@ gdk_wayland_display_after_process_all_updates (GdkDisplay *display)
static gulong
gdk_wayland_display_get_next_serial (GdkDisplay *display)
{
static gulong serial = 0;
return ++serial;
return 0;
}
void
+2 -2
View File
@@ -135,8 +135,8 @@ gdk_wayland_display_manager_get_atom_name (GdkDisplayManager *manager_in,
while (g_hash_table_iter_next (&iter, &key, &value))
{
if (GDK_POINTER_TO_ATOM (value) == atom)
return g_strdup (key);
if (GDK_POINTER_TO_ATOM (key) == atom)
return g_strdup (value);
}
return NULL;
+2 -2
View File
@@ -113,10 +113,10 @@ void
_gdk_wayland_display_deliver_event (GdkDisplay *display, GdkEvent *event)
{
GList *node;
static int serial;
node = _gdk_event_queue_append (display, event);
_gdk_windowing_got_event (display, node, event,
_gdk_display_get_next_serial (display));
_gdk_windowing_got_event (display, node, event, serial++);
}
GSource *
+5 -3
View File
@@ -515,10 +515,12 @@ gdk_wayland_keymap_add_virtual_modifiers (GdkKeymap *keymap,
wayland_keymap = GDK_WAYLAND_KEYMAP (keymap);
for (i = 4; i < 8; i++)
for (i = 3; i < 8; i++)
{
if ((1 << i) & *state)
{
if (wayland_keymap->modmap[i] & GDK_MOD1_MASK)
*state |= GDK_MOD1_MASK;
if (wayland_keymap->modmap[i] & GDK_SUPER_MASK)
*state |= GDK_SUPER_MASK;
if (wayland_keymap->modmap[i] & GDK_HYPER_MASK)
@@ -538,7 +540,7 @@ gdk_wayland_keymap_map_virtual_modifiers (GdkKeymap *keymap,
};
int i, j;
GdkWaylandKeymap *wayland_keymap;
gboolean retval = TRUE;
gboolean retval;
wayland_keymap = GDK_WAYLAND_KEYMAP (keymap);
@@ -546,7 +548,7 @@ gdk_wayland_keymap_map_virtual_modifiers (GdkKeymap *keymap,
{
if (*state & vmods[j])
{
for (i = 4; i < 8; i++)
for (i = 3; i < 8; i++)
{
if (wayland_keymap->modmap[i] & vmods[j])
{
+4 -2
View File
@@ -45,8 +45,10 @@
#define GDK_WINDOW_IS_WAYLAND(win) (GDK_IS_WINDOW_IMPL_WAYLAND (((GdkWindow *)win)->impl))
GType _gdk_wayland_window_get_type (void);
void _gdk_wayland_window_add_focus (GdkWindow *window);
void _gdk_wayland_window_remove_focus (GdkWindow *window);
void _gdk_wayland_window_update_size (GdkWindow *window,
int32_t width,
int32_t height,
uint32_t edges);
GdkKeymap *_gdk_wayland_keymap_new (GdkDisplay *display);
struct xkb_desc *_gdk_wayland_keymap_get_xkb_desc (GdkKeymap *keymap);
-30
View File
@@ -33,36 +33,6 @@ G_BEGIN_DECLS
GType gdk_wayland_display_manager_get_type (void);
#if defined (GTK_COMPILATION) || defined (GDK_COMPILATION)
#define gdk_wayland_device_get_selection_type_atoms gdk_wayland_device_get_selection_type_atoms_libgtk_only
int
gdk_wayland_device_get_selection_type_atoms (GdkDevice *device,
GdkAtom **atoms_out);
typedef void (*GdkDeviceWaylandRequestContentCallback) (GdkDevice *device, const gchar *data, gsize len, gpointer userdata);
#define gdk_wayland_device_request_selection_content gdk_wayland_device_request_selection_content_libgtk_only
gboolean
gdk_wayland_device_request_selection_content (GdkDevice *device,
const gchar *requested_mime_type,
GdkDeviceWaylandRequestContentCallback cb,
gpointer userdata);
typedef gchar *(*GdkDeviceWaylandOfferContentCallback) (GdkDevice *device, const gchar *mime_type, gssize *len, gpointer userdata);
#define gdk_wayland_device_offer_selection_content gdk_wayland_device_offer_selection_content_libgtk_only
gboolean
gdk_wayland_device_offer_selection_content (GdkDevice *gdk_device,
const gchar **mime_types,
gint nr_mime_types,
GdkDeviceWaylandOfferContentCallback cb,
gpointer userdata);
#define gdk_wayland_device_clear_selection_content gdk_wayland_device_clear_selection_content_libgtk_only
gboolean
gdk_wayland_device_clear_selection_content (GdkDevice *gdk_device);
#endif
G_END_DECLS
#endif /* __GDK_WAYLAND_H__ */
+58 -104
View File
@@ -102,14 +102,42 @@ struct _GdkWindowImplWayland
struct wl_shell_surface *shell_surface;
unsigned int mapped : 1;
GdkWindow *transient_for;
GdkWindowTypeHint hint;
cairo_surface_t *cairo_surface;
cairo_surface_t *server_surface;
GLuint texture;
uint32_t resize_edges;
int focus_count;
/* Set if the window, or any descendent of it, is the server's focus window
*/
guint has_focus_window : 1;
/* Set if window->has_focus_window and the focus isn't grabbed elsewhere.
*/
guint has_focus : 1;
/* Set if the pointer is inside this window. (This is needed for
* for focus tracking)
*/
guint has_pointer : 1;
/* Set if the window is a descendent of the focus window and the pointer is
* inside it. (This is the case where the window will receive keystroke
* events even window->has_focus_window is FALSE)
*/
guint has_pointer_focus : 1;
/* Set if we are requesting these hints */
guint skip_taskbar_hint : 1;
guint skip_pager_hint : 1;
guint urgency_hint : 1;
guint on_all_desktops : 1; /* _NET_WM_STICKY == 0xFFFFFFFF */
guint have_sticky : 1; /* _NET_WM_STATE_STICKY */
guint have_maxvert : 1; /* _NET_WM_STATE_MAXIMIZED_VERT */
guint have_maxhorz : 1; /* _NET_WM_STATE_MAXIMIZED_HORZ */
guint have_fullscreen : 1; /* _NET_WM_STATE_FULLSCREEN */
gulong map_serial; /* Serial of last transition from unmapped */
@@ -118,9 +146,6 @@ struct _GdkWindowImplWayland
/* Time of most recent user interaction. */
gulong user_time;
GdkGeometry geometry_hints;
GdkWindowHints geometry_mask;
};
struct _GdkWindowImplWaylandClass
@@ -136,36 +161,16 @@ _gdk_window_impl_wayland_init (GdkWindowImplWayland *impl)
impl->toplevel_window_type = -1;
}
void
_gdk_wayland_window_add_focus (GdkWindow *window)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
impl->focus_count++;
if (impl->focus_count == 1)
gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FOCUSED);
}
void
_gdk_wayland_window_remove_focus (GdkWindow *window)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
impl->focus_count--;
if (impl->focus_count == 0)
gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FOCUSED, 0);
}
/**
* gdk_wayland_window_update_size:
* _gdk_wayland_window_update_size:
* @drawable: a #GdkDrawableImplWayland.
*
* Updates the state of the drawable (in particular the drawable's
* cairo surface) when its size has changed.
**/
static void
gdk_wayland_window_update_size (GdkWindow *window,
int32_t width, int32_t height, uint32_t edges)
void
_gdk_wayland_window_update_size (GdkWindow *window,
int32_t width, int32_t height, uint32_t edges)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
GdkRectangle area;
@@ -436,33 +441,6 @@ gdk_wayland_window_ref_cairo_surface (GdkWindow *window)
return impl->cairo_surface;
}
static void
gdk_wayland_window_configure (GdkWindow *window,
int width, int height, int edges)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
GdkDisplay *display;
GdkEvent *event;
display = gdk_window_get_display (window);
/* TODO: Only generate a configure event if width or height have actually
* changed?
*/
event = gdk_event_new (GDK_CONFIGURE);
event->configure.window = window;
event->configure.send_event = FALSE;
event->configure.width = width;
event->configure.height = height;
_gdk_window_update_size (window);
gdk_wayland_window_update_size (window, width, height, edges);
g_object_ref(window);
_gdk_wayland_display_deliver_event (display, event);
}
static void
gdk_wayland_window_set_user_time (GdkWindow *window, guint32 user_time)
{
@@ -503,16 +481,23 @@ shell_surface_handle_configure(void *data,
int32_t height)
{
GdkWindow *window = GDK_WINDOW (data);
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
GdkDisplay *display;
GdkEvent *event;
gdk_window_constrain_size (&impl->geometry_hints,
impl->geometry_mask,
width,
height,
&width,
&height);
display = gdk_window_get_display (window);
gdk_wayland_window_configure (window, width, height, edges);
event = gdk_event_new (GDK_CONFIGURE);
event->configure.window = window;
event->configure.send_event = FALSE;
event->configure.width = width;
event->configure.height = height;
_gdk_window_update_size (window);
_gdk_wayland_window_update_size (window, width, height, edges);
g_object_ref(window);
_gdk_wayland_display_deliver_event (display, event);
}
static const struct wl_shell_surface_listener shell_surface_listener = {
@@ -543,8 +528,6 @@ gdk_wayland_window_show (GdkWindow *window, gboolean already_mapped)
wl_shell_surface_add_listener(impl->shell_surface,
&shell_surface_listener, window);
gdk_window_set_type_hint (window, impl->hint);
_gdk_make_event (window, GDK_MAP, NULL, FALSE);
event = _gdk_make_event (window, GDK_VISIBILITY_NOTIFY, NULL, FALSE);
event->visibility.state = GDK_VISIBILITY_UNOBSCURED;
@@ -646,11 +629,7 @@ gdk_window_wayland_move_resize (GdkWindow *window,
window->x = x;
window->y = y;
/* If this function is called with width and height = -1 then that means
* just move the window - don't update its size
*/
if (width > 0 && height > 0)
gdk_wayland_window_configure (window, width, height, 0);
_gdk_wayland_window_update_size (window, width, height, 0);
}
static void
@@ -819,7 +798,6 @@ gdk_wayland_window_destroy (GdkWindow *window,
{
if (GDK_WINDOW_IMPL_WAYLAND (window->impl)->surface)
wl_surface_destroy(GDK_WINDOW_IMPL_WAYLAND (window->impl)->surface);
wl_shell_surface_destroy(GDK_WINDOW_IMPL_WAYLAND (window->impl)->shell_surface);
}
}
@@ -860,20 +838,16 @@ static void
gdk_wayland_window_set_type_hint (GdkWindow *window,
GdkWindowTypeHint hint)
{
GdkWindowImplWayland *impl;
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
if (GDK_WINDOW_DESTROYED (window))
return;
impl->hint = hint;
switch (hint)
{
case GDK_WINDOW_TYPE_HINT_DIALOG:
case GDK_WINDOW_TYPE_HINT_MENU:
case GDK_WINDOW_TYPE_HINT_TOOLBAR:
case GDK_WINDOW_TYPE_HINT_UTILITY:
case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN:
case GDK_WINDOW_TYPE_HINT_DOCK:
case GDK_WINDOW_TYPE_HINT_DESKTOP:
case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU:
@@ -886,11 +860,7 @@ gdk_wayland_window_set_type_hint (GdkWindow *window,
default:
g_warning ("Unknown hint %d passed to gdk_window_set_type_hint", hint);
/* Fall thru */
case GDK_WINDOW_TYPE_HINT_DIALOG:
case GDK_WINDOW_TYPE_HINT_NORMAL:
case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN:
if (impl->shell_surface)
wl_shell_surface_set_toplevel (impl->shell_surface);
break;
}
}
@@ -930,17 +900,10 @@ gdk_wayland_window_set_geometry_hints (GdkWindow *window,
const GdkGeometry *geometry,
GdkWindowHints geom_mask)
{
GdkWindowImplWayland *impl;
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
return;
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
impl->geometry_hints = *geometry;
impl->geometry_mask = geom_mask;
/*
* GDK_HINT_POS
* GDK_HINT_USER_POS
@@ -1231,14 +1194,9 @@ gdk_wayland_window_begin_resize_drag (GdkWindow *window,
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
wl_shell_surface_resize (impl->shell_surface,
_gdk_wayland_device_get_device (device),
timestamp, grab_type);
/* This is needed since Wayland will absorb all the pointer events after the
* above function - FIXME: Is this always safe..?
*/
gdk_device_ungrab (device, timestamp);
wl_shell_surface_resize(impl->shell_surface,
_gdk_wayland_device_get_device (device),
timestamp, grab_type);
}
static void
@@ -1249,6 +1207,7 @@ gdk_wayland_window_begin_move_drag (GdkWindow *window,
gint root_y,
guint32 timestamp)
{
GdkDisplay *display = gdk_window_get_display (window);
GdkWindowImplWayland *impl;
if (GDK_WINDOW_DESTROYED (window) ||
@@ -1257,13 +1216,8 @@ gdk_wayland_window_begin_move_drag (GdkWindow *window,
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
wl_shell_surface_move (impl->shell_surface,
_gdk_wayland_device_get_device (device), timestamp);
/* This is needed since Wayland will absorb all the pointer events after the
* above function - FIXME: Is this always safe..?
*/
gdk_device_ungrab (device, timestamp);
wl_shell_surface_move(impl->shell_surface,
_gdk_wayland_device_get_device (device), timestamp);
}
static void
+1 -5
View File
@@ -1503,11 +1503,7 @@ gdk_win32_window_raise (GdkWindow *window)
0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE));
else if (window->accept_focus)
/* Do not wrap this in an API_CALL macro as SetForegroundWindow might
* fail when for example dragging a window belonging to a different
* application at the time of a gtk_window_present() call due to focus
* stealing prevention. */
SetForegroundWindow (GDK_WINDOW_HWND (window));
API_CALL (BringWindowToTop, (GDK_WINDOW_HWND (window)));
else
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_TOP,
0, 0, 0, 0,
+1 -1
View File
@@ -221,7 +221,7 @@ startup_timeout (void *data)
std->timeout_id = g_timeout_add_seconds ((min_timeout + 500)/1000, startup_timeout, std);
/* always remove this one, but we may have reinstalled another one. */
return G_SOURCE_REMOVE;
return FALSE;
}
+1 -1
View File
@@ -742,7 +742,7 @@ _gdk_x11_device_xi2_translate_state (XIModifierState *mods_state,
{
gint group;
group = group_state->base + group_state->latched + group_state->locked;
group = group_state->base | group_state->latched | group_state->locked;
/* FIXME: do we need the XKB complications for this ? */
group = CLAMP(group, 0, 3);
+4
View File
@@ -29,6 +29,10 @@
#include "gdkprivate-x11.h"
#include "gdkkeysyms.h"
#ifdef HAVE_XKB
#include <X11/XKBlib.h>
#endif
#define HAS_FOCUS(toplevel) \
((toplevel)->has_focus || (toplevel)->has_pointer_focus)
-4
View File
@@ -100,8 +100,6 @@ _gdk_x11_device_manager_new (GdkDisplay *display)
*
* Returns: (transfer none): (allow-none): The #GdkDevice wrapping the device ID,
* or %NULL if the given ID doesn't currently represent a device.
*
* Since: 3.2
**/
GdkDevice *
gdk_x11_device_manager_lookup (GdkDeviceManager *device_manager,
@@ -147,8 +145,6 @@ gdk_x11_device_manager_lookup (GdkDeviceManager *device_manager,
* </note>
*
* Returns: the XInput2 device ID.
*
* Since: 3.2
**/
gint
gdk_x11_device_get_id (GdkDevice *device)

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