Commit Graph

35224 Commits

Author SHA1 Message Date
Alexander Larsson
48ff7d026e CSS: Add -gtk-scaled(image1,image2,...) support for hidpi assets 2013-07-03 14:39:25 +02:00
Alexander Larsson
af2c40bd54 css: Add a scale argument to css-value compute vfunc
We need to be able to compute different GtkCssImage values
depending on the scale, and we need this at compute time so that
we don't need to read any images other than the scale in used (to
e.g. calculate the image size). GtkStyleProviderPrivate is shared
for all style contexts, so its not right.
2013-07-03 14:39:25 +02:00
Alexander Larsson
38e1748df8 GtkWidget: Propagate scale to GtkStyleContext 2013-07-03 14:39:25 +02:00
Alexander Larsson
4cc1fe5bf5 GtkStyleContext: Add gtk_style_context_get/set_scale 2013-07-03 14:39:25 +02:00
Alexander Larsson
6cc5d29792 Use gdk_cairo_surface_create_from_pixbuf when possible 2013-07-03 14:39:25 +02:00
Alexander Larsson
ae43f9facb Add GDK_DPI_SCALE env var
This is very useful for hidpi where the dpi is scaled to make
non-dpi aware apps larger. In that case a dpi aware gtk+ using
GDK_SCALE will be getting huge fonts. You can the set GDK_DPI_SCALE
to compensate for this.
2013-07-03 14:39:25 +02:00
Alexander Larsson
e8b38fedbd gdk: Convert mouse position to doubles, add new getters
We've long had double precision mouse coordinates on wayland (e.g.
when rotating a window) but with the new scaling we even have it on
X (and, its also in Xinput2), so convert all the internal mouse/device
position getters to use doubles and add new accessors for the
public APIs that take doubles instead of ints.
2013-07-03 14:39:25 +02:00
Alexander Larsson
867ba1df27 x11: Don't follow dpi and scale from xsettings when GDK_SCALE set
If things are hardcoded in the environment, that wins.
2013-07-03 14:36:05 +02:00
Alexander Larsson
4b9c08f48d x11: Add Gdk/UnscaledDPI to override Xft/DPI
This lets use use a scaled Xft/DPI for old apps while not
blowing up the size of scaled windows. Only apps supporting
Gdk/WindowScaleFactor should supprt Gdk/UnscaledDPI.
2013-07-03 14:34:25 +02:00
Alexander Larsson
d89a98e31e x11: Support the Gdk/WindowScalingFactor xsetting
This xsetting can be used to tell Gtk to use a specific window
scaling for the screen.
2013-07-03 14:34:14 +02:00
Alexander Larsson
525e5cff04 x11: Initial cut at supporting window scaling for X11
If you set GDK_SCALE=2 in the environment then all windows will be
scaled by 2. Its not an ideal solution as it doesn't handle
multi-monitors at different scales, and only affects gtk apps.
But it is a good starting points and will help a lot on HiDPI
laptops.
2013-07-03 14:34:14 +02:00
Alexander Larsson
ed4fcee4c6 wayland: Support gdk_window_get_scale
We track the list of outputs each window is on, and set the
scale to the largest scale value of the outputs. Any time the scale
changes we also emit a configure event.
2013-07-03 14:34:13 +02:00
Alexander Larsson
031cf86b83 wayland: Require wayland-client 1.1.90
This has the new methods required for buffer scaling.
2013-07-03 14:34:13 +02:00
Alexander Larsson
ce68a2f870 wayland: Implement gdk_screen_get_monitor_scale()
We bind to the newer version of the wl_output which supports
the new done and scale events, and if we use this to get the
scale for each monitor (defaulting to 1 if not supported).
2013-07-03 14:34:13 +02:00
Alexander Larsson
8524e0c150 gdk: Add gdk_cairo_surface_create_from_pixbuf 2013-07-03 14:34:13 +02:00
Alexander Larsson
04f83a56a2 gdk: add gdk_window_create_similar_image_surface
This lets us create image surfaces that render faster on specific windows.
It also supports creating scaled image surfaces.
2013-07-03 14:34:13 +02:00
Alexander Larsson
56bec0c70c gdkwindow: Respect cairo surfaces with device scale
If a cairo_surface for a window has a device scale set we need
to respect this when creating a similar window. I.e. we want
to then automatically create a larger window which inherits
the scale from the original.

We also need to calculate a different device_offset if there
is a device_scale set.
2013-07-03 14:34:13 +02:00
Alexander Larsson
1b1f2b4b52 configure: Add buildtime check for cairo_surface_set_device_scale
We will need this for the window scale support, but its not yet
in a stable cairo release (or even on a master yet), so we make
this optional.
2013-07-03 14:34:13 +02:00
Alexander Larsson
c9b52d8820 pixel-cache: Refresh pixel cache on window scale factor changes. 2013-07-03 14:34:13 +02:00
Alexander Larsson
6bf32999b1 widget: Track when the window scale factor changes and notify
The scale-factor property on the widgets will be notified, and the
scale will change on the style property, causing us to pick up
new css assets.
2013-07-03 14:34:13 +02:00
Michael Natterer
c0ea0b5aad gtk: add gtk_widget_get_scale_factor() 2013-07-03 14:34:13 +02:00
Michael Natterer
d4607be003 quartz: Implement get_scale_factor() on screen and window 2013-07-03 14:34:13 +02:00
Alexander Larsson
30080faf2b offscreenwindow: Handle window_scale
We create similar windows in the right way to get the
device scale right.
2013-07-03 14:34:13 +02:00
Michael Natterer
8ad851f725 add gdk_screen_ and gdk_window_get_scale_factor()
These report the internal scaling factor, mapping from UI pixels
to hardware pixels.
2013-07-03 12:27:10 +02:00
Alexander Larsson
995a7e95b9 win32: Remove unused functions
The _gdk_windowing_* stuff is not used anymore
2013-07-03 12:27:10 +02:00
Alexander Larsson
aa3f0f8ec9 quartz: Remove unused functions
The _gdk_windowing_* stuff is not used anymore
2013-07-03 12:27:10 +02:00
Piotr Drąg
96abd26501 Updated POTFILES.skip 2013-07-03 00:05:34 +02:00
Alexander Larsson
2a81d6f396 listbox: Use new private model, remove priv pointer 2013-07-02 13:44:17 +02:00
Alexander Larsson
06a808cf2a stack: Use new private model, remove priv pointer 2013-07-02 13:43:20 +02:00
Alexander Larsson
09d22284f7 revealer: Use new private model, remove priv pointer 2013-07-02 13:42:43 +02:00
Matthias Clasen
6aa1d69978 Fix a copy-paste error 2013-07-01 13:18:22 -04:00
Alexander Larsson
09a975a765 gdk: Fix shaped toplevels
We need to apply the shape for toplevels that have a shape.

https://bugzilla.gnome.org/show_bug.cgi?id=702831
2013-07-01 15:34:15 +02:00
Alexander Larsson
970edd7e25 Fix typo in Makefile.am 2013-07-01 15:00:19 +02:00
Chun-wei Fan
fb6f34e499 Include crypt(3) implementation for MSVC
This adds a crypt(3) implementation for use with broadwayd as Visual Studio
does not support crypt(3) out of the box.

The public domain implementation is taken from the following URL,
http://michael.dipperstein.com/crypt/, where AFAICT this implementation
would not be subject to licensing restrictions that would prevent it from
being bundled.
2013-07-01 14:52:45 +02:00
Chun-wei Fan
2268e9d6c9 Broadway: Allow Compilation on Windows/MSVC
-Don't include unistd.h unconditionally as it's not available in Visual
 Studio, but include io.h where necessary.
-Avoid C99isms, and use _chsize_s in place of ftruncate when unistd.h is
 not available (as in the case of Visual Studio)
2013-07-01 14:51:03 +02:00
Tarnyko
4b49c44b0a win32: Make broadway build 2013-07-01 14:46:25 +02:00
Matthias Clasen
7702c6a512 Add GtkHeaderBar to the a11y tests 2013-06-30 22:33:12 -04:00
Matthias Clasen
2941196f84 Add GtkStack and GtkStackSwitcher to the a11y tests 2013-06-30 22:33:12 -04:00
Matthias Clasen
e11039a973 Add GtkListBox to the a11y tests 2013-06-30 22:33:12 -04:00
William Jon McCann
a9e82cd46a Deprecate and ignore gtk-enable-tooltips setting
It is enabled by default except on touch input devices.
2013-06-30 14:28:02 -04:00
William Jon McCann
85c0614707 Remove gtk-im-status-style and gtk-im-preedit-style from GDK as well 2013-06-30 13:45:43 -04:00
William Jon McCann
7ca327c9bb Deprecate the unused gtk-file-chooser-backend setting 2013-06-30 13:44:24 -04:00
William Jon McCann
3d5d3e8eae Fix a couple of deprecation warnings related to stock items 2013-06-30 13:14:18 -04:00
William Jon McCann
c6ca2374cc Deprecate and ignore gtk-im-status-style and gtk-im-preedit-style 2013-06-30 12:57:44 -04:00
William Jon McCann
d1817e7a5d Add deprecation warnings to GTK_STOCK macros 2013-06-30 12:33:22 -04:00
William Jon McCann
6f83657288 Fix the build
Remove references to removed files
2013-06-30 11:30:37 -04:00
William Jon McCann
4d6f9d280f Add xpadding around the image in message dialogs 2013-06-30 11:19:50 -04:00
William Jon McCann
c96a1c4980 Deprecate GtkAction and GtkUIManager
It is recommended to use GAction et al and GtkBuilder.
2013-06-30 11:19:50 -04:00
William Jon McCann
32ce8fa60a Remove deprecated UIManager from the demo 2013-06-30 11:19:50 -04:00
William Jon McCann
f7f46b9155 Port print-editor test to GtkBuilder from UIManager 2013-06-30 11:19:50 -04:00