Bug 1751217 Part 3: Make HDR-capable macOS screens report 30 pixelDepth. r=mstange
[gecko.git] / widget / gtk / nsDeviceContextSpecG.h
blobe3b05377820954a377e5ef45eee92ffec1f5913e
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsDeviceContextSpecGTK_h___
7 #define nsDeviceContextSpecGTK_h___
9 struct JSContext;
11 #include "nsIDeviceContextSpec.h"
12 #include "nsIPrinterList.h"
13 #include "nsIPrintSettings.h"
14 #include "nsCOMPtr.h"
15 #include "nsString.h"
16 #include "mozilla/Attributes.h"
18 #include "nsCRT.h" /* should be <limits.h>? */
20 #include <gtk/gtk.h>
21 #include <gtk/gtkunixprint.h>
23 #define NS_PORTRAIT 0
24 #define NS_LANDSCAPE 1
26 class nsPrintSettingsGTK;
28 class nsDeviceContextSpecGTK : public nsIDeviceContextSpec {
29 public:
30 nsDeviceContextSpecGTK();
32 NS_DECL_ISUPPORTS
34 already_AddRefed<PrintTarget> MakePrintTarget() final;
36 NS_IMETHOD Init(nsIWidget* aWidget, nsIPrintSettings* aPS,
37 bool aIsPrintPreview) override;
38 NS_IMETHOD BeginDocument(const nsAString& aTitle,
39 const nsAString& aPrintToFileName,
40 int32_t aStartPage, int32_t aEndPage) override;
41 NS_IMETHOD EndDocument() override;
42 NS_IMETHOD BeginPage() override { return NS_OK; }
43 NS_IMETHOD EndPage() override { return NS_OK; }
45 protected:
46 virtual ~nsDeviceContextSpecGTK();
47 nsCOMPtr<nsPrintSettingsGTK> mPrintSettings;
48 bool mToPrinter : 1; /* If true, print to printer */
49 GtkPrintSettings* mGtkPrintSettings;
50 GtkPageSetup* mGtkPageSetup;
52 nsCString mSpoolName;
53 nsCOMPtr<nsIFile> mSpoolFile;
54 nsCString mTitle;
56 private:
57 void EnumeratePrinters();
58 void StartPrintJob();
59 static gboolean PrinterEnumerator(GtkPrinter* aPrinter, gpointer aData);
62 #endif /* !nsDeviceContextSpecGTK_h___ */