mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 12:00:42 +02:00
added mini libc for darwin
git-svn-id: trunk@8608 -
This commit is contained in:
parent
28067deac6
commit
b41729a19d
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -240,6 +240,7 @@ components/printers/unix/cupsprinters.inc svneol=native#text/pascal
|
||||
components/printers/unix/cupsprinters_h.inc svneol=native#text/pascal
|
||||
components/printers/unix/cupsprndialogs.inc svneol=native#text/pascal
|
||||
components/printers/unix/jobsimglist.lrs svneol=native#text/pascal
|
||||
components/printers/unix/minicupslibc.pas svneol=native#text/plain
|
||||
components/printers/unix/printerprop.lrs svneol=native#text/pascal
|
||||
components/printers/unix/selectprinter.lrs svneol=native#text/pascal
|
||||
components/printers/unix/udlgprintersjobs.lfm svneol=native#text/plain
|
||||
|
@ -25,7 +25,7 @@
|
||||
<License Value="LGPL
|
||||
"/>
|
||||
<Version Build="2"/>
|
||||
<Files Count="26">
|
||||
<Files Count="27">
|
||||
<Item1>
|
||||
<Filename Value="printersdlgs.lrs"/>
|
||||
<Type Value="LRS"/>
|
||||
@ -135,6 +135,10 @@
|
||||
<Filename Value="unix/cupsprndialogs.inc"/>
|
||||
<Type Value="Include"/>
|
||||
</Item26>
|
||||
<Item27>
|
||||
<Filename Value="unix/minicupslibc.pas"/>
|
||||
<UnitName Value="minicupslibc"/>
|
||||
</Item27>
|
||||
</Files>
|
||||
<Type Value="RunAndDesignTime"/>
|
||||
<RequiredPkgs Count="2">
|
||||
|
@ -7,7 +7,7 @@ unit Printer4Lazarus;
|
||||
interface
|
||||
|
||||
uses
|
||||
PrintersDlgs, OSPrinters, LazarusPackageIntf;
|
||||
PrintersDlgs, OSPrinters, MiniCUPSLibc, LazarusPackageIntf;
|
||||
|
||||
implementation
|
||||
|
||||
|
@ -51,10 +51,15 @@ interface
|
||||
uses
|
||||
Classes, SysUtils, dynlibs,
|
||||
{$ifdef UseLibC}
|
||||
LibC;
|
||||
{$IFDEF darwin}
|
||||
miniCupsLibc
|
||||
{$ELSE}
|
||||
Libc
|
||||
{$ENDIF}
|
||||
{$else}
|
||||
baseunix, unix, sockets;
|
||||
baseunix, unix, sockets
|
||||
{$endif}
|
||||
;
|
||||
|
||||
{$PACKRECORDS C}
|
||||
|
||||
|
51
components/printers/unix/minicupslibc.pas
Normal file
51
components/printers/unix/minicupslibc.pas
Normal file
@ -0,0 +1,51 @@
|
||||
{
|
||||
*****************************************************************************
|
||||
* *
|
||||
* See the file COPYING.LCL, included in this distribution, *
|
||||
* for details about the copyright. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* *
|
||||
*****************************************************************************
|
||||
}
|
||||
unit MiniCUPSLibc;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
const
|
||||
clib = 'c';
|
||||
|
||||
Type
|
||||
Time_t = longint;
|
||||
TTime_T = Time_t;
|
||||
Ptime_t = ^TTime_T;
|
||||
|
||||
type
|
||||
Ptm = ^tm;
|
||||
tm = record
|
||||
tm_sec : longint;
|
||||
tm_min : longint;
|
||||
tm_hour : longint;
|
||||
tm_mday : longint;
|
||||
tm_mon : longint;
|
||||
tm_year : longint;
|
||||
tm_wday : longint;
|
||||
tm_yday : longint;
|
||||
tm_isdst : longint;
|
||||
case boolean of
|
||||
false : (tm_gmtoff : longint;tm_zone : Pchar);
|
||||
true : (__tm_gmtoff : longint;__tm_zone : Pchar);
|
||||
end;
|
||||
|
||||
function __time(__timer:Ptime_t):time_t;cdecl;external clib name 'time';
|
||||
function localtime(__timer:Ptime_t):Ptm;cdecl;external clib name 'localtime';
|
||||
function localtime(var __timer : ttime_t):Ptm;cdecl;external clib name 'localtime';
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
|
@ -43,9 +43,14 @@ uses
|
||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls,
|
||||
Printers,cupsPrinters,Buttons,ComCtrls,StdCtrls,
|
||||
{$IFNDEF DYNLINK}
|
||||
Cups, cups_ipp,Libc
|
||||
Cups, cups_ipp,
|
||||
{$ELSE}
|
||||
CUPSDyn,LibC
|
||||
CUPSDyn,
|
||||
{$ENDIF}
|
||||
{$IFDEF darwin}
|
||||
miniCupsLibc,
|
||||
{$ELSE}
|
||||
Libc,
|
||||
{$ENDIF}
|
||||
;
|
||||
|
||||
|
@ -3,8 +3,6 @@
|
||||
------------
|
||||
*****************************************************************************
|
||||
* *
|
||||
* This file is part of the Lazarus Component Library (LCL) *
|
||||
* *
|
||||
* See the file COPYING.LCL, included in this distribution, *
|
||||
* for details about the copyright. *
|
||||
* *
|
||||
@ -43,8 +41,8 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
||||
Buttons, ExtCtrls, Spin, MaskEdit, ComCtrls,LCLType,
|
||||
Printers, OsPrinters in '../osprinters.pas', CUPSDyn,libc;
|
||||
Buttons, ExtCtrls, Spin, MaskEdit, ComCtrls, LCLType,
|
||||
Printers, OsPrinters in '../osprinters.pas', CUPSDyn;
|
||||
|
||||
type
|
||||
|
||||
@ -129,14 +127,21 @@ function LocalToGMTDateTime(aDate : TDateTime) : TDateTime;
|
||||
function LapseLocalToGMT : integer;
|
||||
|
||||
implementation
|
||||
uses udlgpropertiesprinter;
|
||||
|
||||
uses
|
||||
{$IFDEF darwin}
|
||||
miniCupsLibc,
|
||||
{$ELSE}
|
||||
Libc,
|
||||
{$ENDIF}
|
||||
uDlgPropertiesPrinter;
|
||||
|
||||
Type
|
||||
THackCUPSPrinter=Class(TCUPSPrinter);
|
||||
THackCUPSPrinter = Class(TCUPSPrinter);
|
||||
|
||||
{----------- Utile date/time convertion ------------}
|
||||
//Return the lapse time in second
|
||||
//beetween locatime and gmt time with daylight
|
||||
//beetween localtime and gmt time with daylight
|
||||
function LapseLocalToGMT : integer;
|
||||
var TT : ttime_t;
|
||||
LOC: PTm;
|
||||
|
Loading…
Reference in New Issue
Block a user