Commit Graph

80 Commits

Author SHA1 Message Date
Benjamin Otte
3078b180fe Replace "gdouble" with "double" 2020-07-25 00:47:36 +02:00
Benjamin Otte
d375dce9f5 Replace "gchar" with "char" 2020-07-25 00:47:36 +02:00
Carlos Garnacho
1f798643c8 gtkprintoperation-win32: Don't track grab-notify
Further grabs could presumably only come from events handled within
the dialog itself. It seems overeager to do this.
2020-06-24 20:35:23 +02:00
Matthias Clasen
2a24b8c653 Replace most remaining uses of container api
These are all on GtkBox or enumerating children.
2020-05-11 22:38:21 -04:00
Matthias Clasen
025375ff5f Replace gtk_widget_destroy everywhere
Replace all remaining uses of gtk_widget_destroy
by gtk_container_remove or g_object_unref.
2020-05-11 12:20:59 -04:00
Matthias Clasen
19e2ab76ce win32: Build fixes
These fixes were done blindly, to make the ci pass,
and will need review by somebody with access to an
actual win32 system to make sure the surface subtypes
are implemented properly.
2020-03-13 07:47:48 -04:00
Benjamin Otte
a278edab22 window: Remove type argument from gtk_window_new() 2020-02-14 21:18:49 +01:00
Matthias Clasen
9eeeb631ca win32 printing: Stop using gtk_events_pending
Just use the GMainContext API directly.
2020-02-09 23:11:49 -05:00
Matthias Clasen
5c594fc46a Merge branch 'WindowsPrintDriverPreferencesMaster' into 'master'
Fixed bug that prevented GTK from storing printer driver preferences in the…

See merge request GNOME/gtk!397
2020-02-06 13:07:13 +00:00
Matthias Clasen
3fd427cfce win32: Use a regular window for printing
We never show this window, so it should not matter.
Ideally, we'd just create a surface to get handle,
anyway.
2019-12-29 20:31:58 -05:00
Руслан Ижбулатов
82c80c06e8 Add missing include 2019-05-28 20:25:17 +00:00
Matthias Clasen
302d2a04ae Stop using gtk_widget_get_surface
Replace all uses of gtk_widget_get_surface by
gtk_native_get_surface.
2019-05-28 20:25:16 +00:00
Benjamin Otte
b36b9323fc win32: Add missing enum value to switch statement 2019-05-21 07:23:30 +02:00
Benjamin Otte
aeda099f47 widget: Remove toplevel flag
Instead, rely on GTK_IS_ROOT().

Also implement GtkRoot on GtkWindow and GtkInvisible, the two widgets
that used to set the toplevel flag before.
2019-02-15 06:53:17 +01:00
Matthias Clasen
785373ce2a printoperation-win32: Stop using an invisible
We can just as well use a GtkWindow here. We just need
a handle. Untested.
2019-02-05 10:56:40 -05:00
Emmanuele Bassi
25fd230327 gtk: Drop the "plus"
Source names should use "[gtk]" without the plus.
2019-02-05 11:26:20 +01:00
Rick Yorgason
26febcc3a8 Fixed win32 printer dialogue not saving devmode->dmDeviceName. Caused the print dialogue to select the wrong printer, and potentially feed bad "extra" data to the default printer. 2018-11-01 11:31:05 -07:00
Rick Yorgason
5dd7f20dab Fixed code styling. 2018-10-29 04:04:10 -07:00
Rick Yorgason
fc15a409cc Fixed bug that prevented GTK from storing printer driver preferences in the print dialogue on Windows. 2018-10-27 06:00:20 -07:00
Руслан Ижбулатов
dedc1ee1e5 Use const for media type in devmode_to_settings() 2018-06-16 18:20:49 +00:00
Руслан Ижбулатов
fe76984e89 Add foward declarations to gtk_print_operation_run_without_dialog 2018-06-16 18:20:22 +00:00
Руслан Ижбулатов
58fc1229c1 Remove unused variables (mostly in W32 code) 2018-06-10 21:21:01 +00:00
Alexander Larsson
63e060a21d GtkWidget: Start renaming widget->window
This is an automated change doing these command:

git sed -f g gtk_widget_set_has_window gtk_widget_set_has_surface
git sed -f g gtk_widget_get_has_window gtk_widget_get_has_surface
git sed -f g gtk_widget_set_parent_window gtk_widget_set_parent_surface
git sed -f g gtk_widget_get_parent_window gtk_widget_get_parent_surface
git sed -f g gtk_widget_set_window gtk_widget_set_surface
git sed -f g gtk_widget_get_window gtk_widget_get_surface
git sed -f g gtk_widget_register_window gtk_widget_register_surface
git sed -f g gtk_widget_unregister_window gtk_widget_unregister_surface

git checkout NEWS*
2018-03-20 15:21:12 +01:00
Alexander Larsson
391727bd0d GdkWindow -> GdkSurface initial type rename
This renames the GdkWindow class and related classes (impl, backend
subclasses) to surface. Additionally it renames related types:
GdkWindowAttr, GdkWindowPaint, GdkWindowWindowClass, GdkWindowType,
GdkWindowTypeHint, GdkWindowHints, GdkWindowState, GdkWindowEdge

This is an automatic conversion using the below commands:

git sed -f g GdkWindowWindowClass GdkSurfaceSurfaceClass

git sed -f g GdkWindow GdkSurface
git sed -f g "gdk_window\([ _\(\),;]\|$\)" "gdk_surface\1" # Avoid hitting gdk_windowing
git sed -f g "GDK_WINDOW\([ _\(]\|$\)" "GDK_SURFACE\1" # Avoid hitting GDK_WINDOWING
git sed "GDK_\([A-Z]*\)IS_WINDOW\([_ (]\|$\)" "GDK_\1IS_SURFACE\2"
git sed GDK_TYPE_WINDOW GDK_TYPE_SURFACE
git sed -f g GdkPointerWindowInfo GdkPointerSurfaceInfo

git sed -f g "BROADWAY_WINDOW" "BROADWAY_SURFACE"
git sed -f g "broadway_window" "broadway_surface"
git sed -f g "BroadwayWindow" "BroadwaySurface"
git sed -f g "WAYLAND_WINDOW" "WAYLAND_SURFACE"
git sed -f g "wayland_window" "wayland_surface"
git sed -f g "WaylandWindow" "WaylandSurface"
git sed -f g "X11_WINDOW" "X11_SURFACE"
git sed -f g "x11_window" "x11_surface"
git sed -f g "X11Window" "X11Surface"
git sed -f g "WIN32_WINDOW" "WIN32_SURFACE"
git sed -f g "win32_window" "win32_surface"
git sed -f g "Win32Window" "Win32Surface"
git sed -f g "QUARTZ_WINDOW" "QUARTZ_SURFACE"
git sed -f g "quartz_window" "quartz_surface"
git sed -f g "QuartzWindow" "QuartzSurface"

git checkout NEWS* po-properties
2018-03-20 11:40:08 +01:00
Emmanuele Bassi
c655759cef Replace gdk_threads_add_timeout* with g_timeout_add()
The main GDK thread lock is not portable and deprecated.

The only reason why gdk_threads_add_timeout() and
gdk_threads_add_timeout_full() exist is to allow invoking a callback
with the GDK lock held, in case 3rd party libraries still use the
deprecated gdk_threads_enter()/gdk_threads_leave() API.

Since we're removing the GDK lock, and we're releasing a new major API,
such code cannot exist any more; this means we can use the GLib API for
installing timeout callbacks.

https://bugzilla.gnome.org/show_bug.cgi?id=793124
2018-02-03 12:06:58 +01:00
Chun-wei Fan
73e81b64b6 gtk/gtkprintoperation-win32.c: Don't call gtk_widget_set_allocation()
This function was removed recently.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2017-07-21 23:35:38 +08:00
Chun-wei Fan
17fe2288e8 gtk/gtkprintoperation-win32.c: Fix for GTK+-4.0 API
We no longer have GtkPlug nor GtkWin32EmbedManifest for GTK+-4.x, and it
is not entirely clear at this point what would be the "best" replacement
for them, but this issue here prevents GTK+-3.89.x building on Windows.

As a result, this is a fast port to avoid using APIs that have been
removed for 4.x, and things seem to work properly (the print.c page
printed).

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2016-11-22 11:40:57 +08:00
Matthias Clasen
bbd94b5a9f gtk: Strip newlines from g_warning and g_error
g_logv adds one for us already.
2016-02-28 12:23:12 -05:00
Benjamin Otte
0ea9131ff7 printoperation-win32: Silence gcc 2016-02-11 03:44:47 +01:00
Руслан Ижбулатов
5ed5d11632 W32: bump _WIN32_WINNT and WINVER to 0x600 (Vista)
Move gdkprivate-win32.h include to ensure that this change affects gdkevents-win32.c
2015-04-29 21:12:14 +00:00
Руслан Ижбулатов
a0faf5a51c Fix various warnings
https://bugzilla.gnome.org/show_bug.cgi?id=734737
2014-08-13 23:41:56 +00:00
Chun-wei Fan
7a3bc9a5ff gtk/gtkprintoperation-win32.c: Fix Missed Include
We need to include gtkprivate.h for _gtk_load_dll_with_libgtk3_manifest().
2014-08-06 12:55:09 +08:00
Руслан Ижбулатов
0d02cc8203 Make sure native W32 print dialog uses visual styles
For that to happen the libgtk3 is embedded with a manifest that requests
common controls library 6.x, and GTK lazily calls InitCommonControlsEx()
to initialize those. Then this manifest is used to temporarily override
the process activation contest when loading comdlg32 (which contains the
code for the print dialog), ensuring that it too depends on common
controls 6.x, even if the application that uses GTK does not.

https://bugzilla.gnome.org/show_bug.cgi?id=733773
2014-08-05 06:41:31 +00:00
Bastien Nocera
438cd857c4 all: Add names to timeouts
Add names to every timeout we setup, so it's easier to track their
usage, and debug possible misbehaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=710651
2013-10-23 13:31:18 +02:00
Chun-wei Fan
9232899c69 gtkprintoperation-win32.c: Drop unneeded include
Don't include gtkstock.h as it's not really needed here, and it has been
recently deprecated.

https://bugzilla.gnome.org/show_bug.cgi?id=705060
2013-07-29 20:10:03 -04:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Morten Welinder
fefe8e7c8c win32: Actually check for IPrintDialogCallback in configure 2011-11-10 17:41:08 +01:00
Benjamin Otte
1b18916a74 win32: Make GtkWin32EmbedWidget use HWND instead of GdkNativeWindow 2011-01-28 17:06:07 +01:00
Hans Breuer
a2b1da064a win32: ported backend specific code to now backend specific API 2011-01-02 13:33:08 +01:00
Benjamin Otte
d9c9259861 Move GtkSizeRequest into GtkWidget
It doesn't make sense to keep them separate as GtkSizeRequest requires a
GtkWidget and GtkWidget implements GtkSizeRequest, so you can never have
one without the other.
It also makes the code a lot easier because no casts are required when
calling functions.

Also, the names would translate to gtk_widget_get_width() and people
agreed that this would be a too generic name, so a "preferred" was added
to the names.

So this patch moves the functions:
gtk_size_request_get_request_mode() => gtk_widget_get_request_mode()
gtk_size_request_get_width() => gtk_widget_get_preferred_width()
gtk_size_request_get_height() => gtk_widget_get_preferred_height()
gtk_size_request_get_size() => gtk_widget_get_preferred_size()
gtk_size_request_get_width_for_height() =>
  gtk_widget_get_preferred_width_for_height()
gtk_size_request_get_height_for_width() =>
  gtk_widget_get_preferred_height_for_width()
... and moves the corresponding vfuncs to the GtkWidgetClass.

The patch also renames the implementations of the vfuncs in widgets to
include the word "preferrred".
2010-09-26 15:11:45 +02:00
Javier Jardón
b140884fec Use gtk_size_request_get_size() instead deprecated gtk_widget_size_request()
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=629598

Signed-off-by: Javier Jardón <jjardon@gnome.org>
Signed-off-by: Tristan Van Berkom <tristanvb@openismus.com>
2010-09-15 03:02:58 +02:00
Tor Lillqvist
f76fddb8a7 Use accessor functions in Win32-only code 2010-09-09 11:09:55 +03:00
Fridrich Štrba
c4b129bac2 Fix 32-bit Windows build using mingw-w64 toolchain 2010-08-03 03:01:49 +02:00
Javier Jardón
0a07e9733b gtk/: fully remove gtkalias hacks
https://bugzilla.gnome.org/show_bug.cgi?id=623845
2010-07-10 02:51:26 +02:00
Tor Lillqvist
a46d2e68c6 Check for __MINGW64__ and not __MINGW64
Should fix bug #612308.
2010-03-12 11:47:15 +02:00
Adrian Johnson
6e351f9214 Set win32 printer hard margins on print context 2009-12-05 13:51:37 +01:00
Christian Persch
723c16d6cd Revert "Set win32 printer hard margins on print context"
This reverts commit a42107389f.
2009-12-01 19:00:58 +01:00
Adrian Johnson
a42107389f Set win32 printer hard margins on print context 2009-12-01 17:40:16 +01:00
Adrian Johnson
9f2c5e3b3a Take printer margins into account on Windows
Fixes bug #381371.
2009-10-27 12:30:50 +02:00
Marek Kasik
91190ce281 Add ability to print in number-up mode for file backend and lpr backend
GtkPrintOperation is now able to render multiple pages per sheet by its
own. The most important changes are in these functions:
  * increment_page_sequence
  * prepare_data
  * common_render_page
  * print_pages_idle
Patch also changes set of choices for 2 pages per sheet mode when
landscape orientation is used to "Top to bottom" and "Bottom to top".
2009-05-13 18:28:42 +02:00