mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
CtrlLib, CtrlCore: Cups printing now active for Cocoa
git-svn-id: svn://ultimatepp.org/upp/trunk@12178 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
5855d84ee7
commit
8b17a43d74
5 changed files with 22 additions and 44 deletions
|
|
@ -163,29 +163,6 @@ struct MMImp;
|
|||
|
||||
#define GUIPLATFORM_TOPWINDOW_DECLS_INCLUDE <CtrlCore/CocoTop.h>
|
||||
|
||||
class PrinterJob {
|
||||
NilDraw nild;
|
||||
Vector<int> pages;
|
||||
|
||||
public:
|
||||
Draw& GetDraw() { return nild; }
|
||||
operator Draw&() { return GetDraw(); }
|
||||
const Vector<int>& GetPages() const { return pages; }
|
||||
int operator[](int i) const { return 0; }
|
||||
int GetPageCount() const { return 0; }
|
||||
|
||||
bool Execute() { return false; }
|
||||
|
||||
PrinterJob& Landscape(bool b = true) { return *this; }
|
||||
PrinterJob& MinMaxPage(int minpage, int maxpage) { return *this; }
|
||||
PrinterJob& PageCount(int n) { return *this; }
|
||||
PrinterJob& CurrentPage(int currentpage) { return *this; }
|
||||
PrinterJob& Name(const char *_name) { return *this; }
|
||||
|
||||
PrinterJob(const char *name = NULL) {}
|
||||
~PrinterJob() {}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#define GUIPLATFORM_INCLUDE_AFTER <CtrlCore/CocoAfter.h>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
sooner:
|
||||
|
||||
- reference/Reports - missing text
|
||||
|
||||
- opening FindInFiles, then selecting folder - pushing buttons does not exit dialog
|
||||
|
||||
- package organizer initial size too small
|
||||
|
|
@ -13,7 +11,7 @@ sooner:
|
|||
- not all additional cursors are correct
|
||||
- Synthetise fonts
|
||||
- Sort fonts
|
||||
- fix link options (joining link options missing space)
|
||||
- fix package organiser link options (joining link options missing space)
|
||||
|
||||
- numpad Enter does not do K_ENTER
|
||||
|
||||
|
|
@ -25,8 +23,8 @@ later:
|
|||
- fullscreen mode issues
|
||||
- PrinterJob
|
||||
- CommonFontInfo GetFontInfoSys(Font font) metrics
|
||||
- ROTATED TEXT
|
||||
- GetGlyphInfoSys metrics
|
||||
- ROTATED TEXT
|
||||
- EndSession ?
|
||||
- ignoreclick
|
||||
- event flags
|
||||
|
|
@ -50,6 +48,7 @@ void SystemDraw::DrawArcOp(const Rect& rc, Point start, Point end, int width, Co
|
|||
|
||||
done:
|
||||
|
||||
- reference/Reports - missing text
|
||||
- doubleclick interval: https://developer.apple.com/documentation/appkit/nsevent/1528384-doubleclickinterval?language=objc
|
||||
- rect loop (ViewDraw)
|
||||
- DrawDragRect
|
||||
|
|
|
|||
|
|
@ -113,23 +113,23 @@ LAYOUT(PrinterLayout, 380, 276)
|
|||
ITEM(Label, dv___1, SetLabel(t_("Printer")).LeftPosZ(16, 88).TopPosZ(28, 20))
|
||||
ITEM(DropList, printer, HSizePosZ(104, 16).TopPosZ(28, 19))
|
||||
ITEM(Label, dv___3, SetLabel(t_("Paper size")).LeftPosZ(16, 88).TopPosZ(52, 20))
|
||||
ITEM(DropList, paper, LeftPosZ(272, 92).TopPosZ(52, 19))
|
||||
ITEM(DropList, paper, LeftPosZ(104, 92).TopPosZ(52, 19))
|
||||
ITEM(Label, dv___5, SetLabel(t_("Input slot")).LeftPosZ(204, 68).TopPosZ(52, 20))
|
||||
ITEM(DropList, slot, LeftPosZ(104, 92).TopPosZ(52, 19))
|
||||
ITEM(Label, dv___7, SetLabel(t_("Pages per sheet")).LeftPosZ(196, 108).TopPosZ(200, 20))
|
||||
ITEM(DropList, npage, LeftPosZ(308, 56).TopPosZ(200, 19))
|
||||
ITEM(LabelBox, dv___9, SetLabel(t_("Print range")).LeftPosZ(8, 224).TopPosZ(92, 80))
|
||||
ITEM(DropList, slot, LeftPosZ(272, 92).TopPosZ(52, 19))
|
||||
ITEM(LabelBox, dv___7, SetLabel(t_("Print range")).LeftPosZ(8, 224).TopPosZ(92, 80))
|
||||
ITEM(Switch, range, SetLabel(t_("All pages\nCurrent page\nPages from")).LeftPosZ(16, 196).TopPosZ(112, 56))
|
||||
ITEM(EditIntSpin, from, LeftPosZ(112, 44).TopPosZ(136, 19))
|
||||
ITEM(Label, dv___12, SetLabel(t_("to")).LeftPosZ(160, 16).TopPosZ(140, 13))
|
||||
ITEM(Label, dv___10, SetLabel(t_("to")).LeftPosZ(160, 16).TopPosZ(140, 13))
|
||||
ITEM(EditIntSpin, to, LeftPosZ(176, 44).TopPosZ(136, 19))
|
||||
ITEM(LabelBox, dv___14, SetLabel(t_("Copies")).HSizePosZ(240, 8).TopPosZ(92, 80))
|
||||
ITEM(Label, dv___15, SetLabel(t_("Copies")).LeftPosZ(252, 56).TopPosZ(112, 20))
|
||||
ITEM(LabelBox, dv___12, SetLabel(t_("Copies")).HSizePosZ(240, 8).TopPosZ(92, 80))
|
||||
ITEM(Label, dv___13, SetLabel(t_("Copies")).LeftPosZ(252, 56).TopPosZ(112, 20))
|
||||
ITEM(EditIntSpin, copies, RightPosZ(16, 56).TopPosZ(112, 19))
|
||||
ITEM(Option, collate, SetLabel(t_("Collate")).RightPosZ(16, 112).TopPosZ(140, 19))
|
||||
ITEM(LabelBox, dv___16, SetLabel(t_("Placement")).HSizePosZ(8, 8).TopPosZ(180, 52))
|
||||
ITEM(Switch, landscape, SetLabel(t_("Portrait\nLandscape")).LeftPosZ(16, 176).TopPosZ(200, 15))
|
||||
ITEM(Label, dv___18, SetLabel(t_("Pages per sheet")).LeftPosZ(196, 108).TopPosZ(200, 20))
|
||||
ITEM(DropList, npage, LeftPosZ(308, 56).TopPosZ(200, 19))
|
||||
ITEM(Button, ok, SetLabel(t_("OK")).RightPosZ(76, 64).BottomPosZ(8, 24))
|
||||
ITEM(Button, cancel, SetLabel(t_("Cancel")).RightPosZ(8, 64).BottomPosZ(8, 24))
|
||||
ITEM(Switch, landscape, SetLabel(t_("Portrait\nLandscape")).LeftPosZ(16, 176).TopPosZ(200, 15))
|
||||
ITEM(LabelBox, dv___21, SetLabel(t_("Placement")).HSizePosZ(8, 8).TopPosZ(180, 52))
|
||||
END_LAYOUT
|
||||
|
||||
|
|
|
|||
|
|
@ -52,14 +52,14 @@ struct Win32PrintDlg_;
|
|||
|
||||
#ifndef PLATFORM_WINCE
|
||||
|
||||
#if defined(GUI_WIN) || defined(PLATFORM_X11)
|
||||
#if defined(GUI_WIN) || defined(PLATFORM_POSIX)
|
||||
|
||||
class PrinterJob {
|
||||
#ifdef GUI_WIN
|
||||
One<Win32PrintDlg_> pdlg;
|
||||
bool Execute0(bool dodlg);
|
||||
#endif
|
||||
#ifdef PLATFORM_X11
|
||||
#ifdef PLATFORM_POSIX
|
||||
Size pgsz;
|
||||
Size GetDefaultPageSize(String *name = NULL);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ PrinterJob& PrinterJob::CurrentPage(int i)
|
|||
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_X11
|
||||
#ifdef PLATFORM_POSIX
|
||||
|
||||
struct PageSizeName {
|
||||
const char *name;
|
||||
|
|
@ -376,7 +376,7 @@ PrinterJob::PrinterJob(const char *_name)
|
|||
from = to = 0;
|
||||
current = 0;
|
||||
pgsz = GetDefaultPageSize();
|
||||
dlgSuccess = false;
|
||||
dlgSuccess = true;
|
||||
}
|
||||
|
||||
PrinterJob::~PrinterJob()
|
||||
|
|
@ -394,6 +394,7 @@ bool PrinterJob::Execute0()
|
|||
dlg.to.Enable(from != to);
|
||||
dlg.range.EnableCase(1, from != to);
|
||||
dlg.range.EnableCase(2, from != to);
|
||||
dlg.landscape <<= landscape;
|
||||
String h;
|
||||
GetDefaultPageSize(&h);
|
||||
h.IsEmpty() ? dlg.paper <<= "A4" : dlg.paper <<= h;
|
||||
|
|
@ -406,8 +407,7 @@ bool PrinterJob::Execute0()
|
|||
options << "-d " << ~dlg.printer;
|
||||
options << " -o media=";
|
||||
dlg.paper.GetIndex() < 0 ? options << ~dlg.slot : options << ~dlg.paper << "," << ~dlg.slot;
|
||||
if(dlg.landscape)
|
||||
options << " -o landscape";
|
||||
landscape = dlg.landscape;
|
||||
options << " -o number-up=" << ~dlg.npage;
|
||||
options << " -n " << ~dlg.copies;
|
||||
if(dlg.collate)
|
||||
|
|
@ -456,9 +456,11 @@ struct PrinterDraw : PdfDraw {
|
|||
Draw& PrinterJob::GetDraw()
|
||||
{
|
||||
if(!draw) {
|
||||
PrinterDraw *pd = new PrinterDraw(pgsz);
|
||||
PrinterDraw *pd = new PrinterDraw(landscape ? Size(pgsz.cy, pgsz.cx) : pgsz);
|
||||
pd->canceled = !dlgSuccess;
|
||||
pd->options = options;
|
||||
if(landscape)
|
||||
pd->options << " -o landscape";
|
||||
draw = pd;
|
||||
}
|
||||
return *draw;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue