Commit Graph

1165 Commits

Author SHA1 Message Date
Emmanuele Bassi
3377133d19 Require CUPS >= 2.0
Drop support for versions of CUPS < 2.0, to simplify the backend code
and drop a lot of conditional blocks.
2019-05-07 18:30:47 +02:00
Emmanuele Bassi
ed31ea3773 cups: Use non-deprecated API
The http* family of functions was deprecated after CUPS 1.7. We can
conditionally use it when built against a newer version of CUPS. The
additional parameters are taken directly from the fallback values
inside CUPS itself.
2019-05-07 18:30:47 +02:00
Emmanuele Bassi
feddf5a694 Detect CUPS ≥ 1.7
We support CUPS ≥ 1.2, but we use API that was introduced and deprecated
at a later point.
2019-05-07 18:30:47 +02:00
Till Kamppeter
c6ea37144c print: Check unknown option values whether they are actually custom settings
Additional code improvements and fixes:

- Use g_regex_match_simple() instead of sscanf()
- Added spaces between function names and left parantheses
- Set always correct custom page size
- Added page_setup field to CupsOptionsData data structure
- Replaced tab indentions by spaces
- Moved #define out of add_cups_options() function, removed line breaks from regular expressions
2019-04-04 16:39:18 +00:00
Chun-wei Fan
8d987be673 Merge branch 'wip/fanc999/meson.msvc' into 'master'
GTK+ 4: Improve Windows/Visual Studio build experience

See merge request GNOME/gtk!185
2019-02-23 02:13:35 +00:00
Emmanuele Bassi
1b6734346c modules: Drop the plus
Use 'GTK' consistently.
2019-02-05 10:30:33 +01:00
Benjamin Otte
1423265610 gstmedia: Implement error handling.
I wonder who forgot that.
Whoops.
2018-12-18 02:04:54 +01:00
Chun-wei Fan
5383d11bb4 modules/media/meson.build: Export needed symbols on MSVC
We need to override _GLIB_EXTERN to export the required symbols for the
GIO module on Visual Studio, so that the media modules can be
successfully loaded.
2018-12-06 17:07:33 +08:00
Benjamin Otte
3439862634 gtkmediafile: Don't leak all the images
We were leaking the GBytes for the image memory, which is a
noticeable memleak to anyone who's casually running a memory monitor.

Go KDE users!

Closes #1200
2018-07-04 15:05:02 +02:00
Benjamin Otte
e665667bff mediafile: Check if media files are open when trying to play
If no file is open, refuse to play.
2018-07-04 06:15:33 +02:00
Matthias Clasen
8755d884f3 Remove a lot of Since annotations
4.0 will represent a clean epoch. We don't want to have
lots of noise in the docs about 2.x or 3.x.
2018-06-25 19:55:04 -04:00
Mohammed Sadiq
fd4bfd5050 build: Fix compiler warnings 2018-06-11 21:12:41 +05:30
Adrian Johnson
b0bb7f3da4 Add gtk_printer_get_hard_margins_for_paper_size
to retreive paper size specific hard margins and use this
to set the hard margins in the print context.
(modified by Marek Kasik <mkasik@redhat.com>)

https://bugzilla.gnome.org/show_bug.cgi?id=686109
2018-04-26 14:19:55 +02:00
Emmanuele Bassi
14c8a603e3 Terminate strncpy() buffers correctly
When using strncpy() with a buffer we need to account for the
terminating NUL character. GCC 8 started warning when using PPD_MAX_NAME
as the buffer length for strncpy() because the buffer we're copying into
has the same length — which means that the terminating NUL may be
skipped if the source string has a length of PPD_MAX_NAME.

The appropriate way to handle the case where we're copying a source with
a length bigger than of PPD_MAX_NAME is, as reported in the strncpy()
documentation, to copy `PPD_MAX_NAME - 1` bytes, and explicitly NUL
terminate the destination buffer. This has the additional benefit of
avoiding the compiler warning.
2018-04-10 14:54:45 +01:00
Benjamin Otte
12063fe53e ffmpeg: Fix compile warnings for newest version 2018-04-10 15:13:38 +02:00
Benjamin Otte
c74854fe49 paintable: Introduce gdk_paintable_new_empty()
Also, use it where appropriate.
2018-04-05 14:56:39 +02:00
Руслан Ижбулатов
5cdb33d1c4 Alternative printbackends subdir for non-UNIX OSes
The main buildscript expects 'print_backends' list to be defined.
Since printbackends is os_unix-only, we need to define this list
ourselves for other OSes.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2018-03-28 15:39:36 +08:00
Benjamin Otte
2362e4d41e gtk: Add a GStreamer implementation of GtkMediaFile 2018-03-18 21:01:23 +01:00
Benjamin Otte
800bcb5cb4 gtk: Add ffmpeg implementation of GtkMediaFile
This adds a module using ffmpeg to implement the GtkMediaFile interface.
2018-03-18 21:01:23 +01:00
Matthias Clasen
e4338c4d42 mediafile: Turn into an extension point
This way, we can support external libraries providing implementations of
GtkMediaFile.

We also add a media backend called 'nomedia' that can be enabled to not
compile any support for GtkMediaFile. This is useful when people want to
statically compile GTK into an application that does not use media.
For now, this option is the default.

We also support a new environment variable GTK_MEDIA that allows
selecting the implementation to use.
GTK_MEDIA=help can be used to get info about the available
implementations.
2018-03-18 21:01:23 +01:00
Benjamin Otte
87fa7ff314 build: Fix printbackends
There's no "auto" option anymore, so remove checks for that option.
2018-03-18 19:08:28 +01:00
Emmanuele Bassi
a0d2d1f44b Use the same arguments for print backends
All the print backend shared modules should use the same C preprocessor
symbols.
2018-03-13 16:00:55 +00:00
Matthias Clasen
a78e9f2261 Consolidate print backends into one directory
This will let us use GTK_PATH to load them uninstalled, which
is useful for in-tree tests.
2018-03-11 12:38:35 -04:00
Matthias Clasen
15cc20e7b5 Always include platform immodules
No need to load these as gio modules, we just include
them in libgtk.
2018-02-24 21:34:40 -05:00
Matthias Clasen
29bcc38ae6 Convert immodules to use an extension point
Add an extension point called gtk-im-module, which requires
the type GtkIMContext. Simplify the loading by using GIO
infrastructure. Drop the locale filtering for now, I don't
think it is really necessary nowadays.

Convert existing platform modules to gio modules.
Sill to do: Drop the conditional build machinery.
Either always include them, or never.
2018-02-24 21:34:40 -05:00
Emmanuele Bassi
b3be9868d8 Remove unused variable in the CUPS print backend
The variable is a leftover from when we were not using the
G_DEFINE_DYNAMIC_TYPE macro.
2018-02-19 02:10:52 +00:00
Emmanuele Bassi
8f273d5e02 Fix the build in the Cloudprint print backend
Typos and re-declared functions.
2018-02-19 02:08:02 +00:00
Emmanuele Bassi
96f6f218ef Fix build of the lpr print backend
Some copy-and-paste from the CUPS print backend broke the build on
Continuous, where CUPS does not exist.
2018-02-19 02:07:09 +00:00
Emmanuele Bassi
809603c16c build: Fix checks on enabled print backends
The enabled print backends are a boolean, not a 'yes/no' string.
2018-02-19 02:06:11 +00:00
Matthias Clasen
19a13b316e Fix the build 2018-02-18 18:14:18 -05:00
Matthias Clasen
de0039546b Convert print backends to use a GIOExtensionPoint
Use GIOModule and GIOExtensionPoint. This is the preferred
way to define extensions these days, instead of manually
implementing type modules.
2018-02-18 18:00:42 -05:00
Ivan Zakharyaschev
4c2f904ac4 gtkprintbackendcups.c: fix \n at end of a debugging note
(cherry picked from commit 7461ceebe3)
(cherry picked from commit d2a4febfa7)
2018-02-17 21:29:34 +03:00
Matthias Clasen
e61e6a864b Drop unmaintained print backends
The papi and test printbackends have not seen any
maintenance in a long time.
2018-02-15 22:49:31 -05:00
Matthias Clasen
dd4bb00a24 Fix the build
This was a mis-merge.
2018-02-15 18:22:53 -05:00
Matthias Clasen
c481a773af Drop non-backend immodules
These are not well integrated, and have not seen any
maintenance in many years.
2018-02-15 16:05:20 -05:00
Matthias Clasen
c2531b7ff2 Merge branch 'wip/carlosg/imwayland' into 'master'
modules: Add wayland IM implementation

See merge request GNOME/gtk!4
2018-02-15 03:01:43 +00:00
Emmanuele Bassi
1440db1570 build: Coalesce print backends options into one
Instead of having separate options for each print backend, we can use
the same approach as the input method modules: a single option, with a
comma-separated list of print backends.
2018-02-14 14:14:22 +00:00
Emmanuele Bassi
2e7fef7d18 build: Rename the 'enable-colord' option
Drop the 'enable-' prefix, to follow the naming best practices for Meson
configuration options.
2018-02-14 14:14:22 +00:00
Emmanuele Bassi
d1a8ed0214 build: Rename 'with-included-immodules' option
We can call it 'included-immodules', and simplify its logic by always
attempting to split the value, to avoid turning an array into a string
and then back into an array again.
2018-02-14 14:14:22 +00:00
Emmanuele Bassi
4b7017ef35 build: Rename 'disable-modules' option
We should not have 'disable' in the name, to conform with the Meson best
practices for boolean options.
2018-02-14 14:14:22 +00:00
Carlos Garnacho
21e9fe4f55 modules: Add wayland IM implementation
This IM context implementation goes through the gtk-text-input protocol,
leaving up to the compositor the actual interaction with IM engines.
2018-02-13 15:47:57 +01:00
Emmanuele Bassi
888dfe499d Drop the Big GDK Lock
GDK has a lock to mark critical sections inside the backends.
Additionally, code that would re-enter into the GTK main loop was
supposed to hold the lock.

Back in the Good Old Days™ this was guaranteed to kind of work only on
the X11 backend, and would cause a neat explosion on any other GDK
backend.

During GTK+ 3.x we deprecated the API to enter and leave the critical
sections, and now we can remove all the internal uses of the lock, since
external API that uses GTK+ 4.x won't be able to hold the GDK lock.

https://bugzilla.gnome.org/show_bug.cgi?id=793124
2018-02-03 12:07:10 +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
Matthias Clasen
2e04817701 xim: Stop using ::configure-event
The generic ::event will do.
2018-01-16 14:14:10 -05:00
Matthias Clasen
845f2657db cups: Warn only once if colord is not available
No need to keep complaining about this.

https://bugzilla.gnome.org/show_bug.cgi?id=791650
2017-12-17 17:09:55 -05:00
Matthias Clasen
072f06abf7 Fix fallout from g_object_ref change
g_object_ref now returns the type of the object that was
passed. Introduce cast as necessary to avoid warnings due
to this.
2017-12-08 17:48:47 -05:00
Chun-wei Fan
824837486b gtkimcontextime.c: Fix call to gtk_style_context_get()
The state argument was removed in commit 1518fe0 (API: stylecontext:
Remove state argument from getters), but we missed updating this file
until commit 5b94fe6 (stylecontext: Make first property name explicit),
as the compiler did not issue any warnings on the (now-defunct) usage.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2017-11-21 14:16:06 +08:00
Matthias Clasen
9d9674a7ca im context thai: Stop using gdk_beep
It is about to go away.
2017-11-16 22:09:44 -05:00
Matthias Clasen
2d6bd1ae6d Drop gdk_window_get_screen
This includes removing the GdkScreen argument from the
create_window_impl display vfunc.
2017-10-31 17:25:01 -04:00
Benjamin Otte
07164e098a window: Turn gtk_window_set_screen() into gtk_window_set_display()
And have a priv->display instead of a priv->screen.

Includes turning gtk_menu_set_screen() into gtk_menu_set_display(),
because that function just forwards to its window.
2017-10-31 08:25:37 +01:00