Recent

Author Topic: LCL without GTK  (Read 8626 times)

Dibo

  • Hero Member
  • *****
  • Posts: 1057
Re: LCL without GTK
« Reply #15 on: May 19, 2014, 11:22:47 pm »
Well, instead of GetTickCount you can use epiktimer or other solutions for time measuring. About TPicture (Graphics unit)... well, it is indeed part of LCL. Don't know why, probably it is using OS widgetset Api somewhere. Why you need TPicture? Maybe you don't need such big class like TPicture, this is wrapper for FPC graphic units, see uses clause again, you find there FPWritePNG, PNGComn, FPReadPNM, FPWritePNM, FPReadJpeg, FPWriteJpeg, FPReadTiff, FPTiffCmn, FPReadGif units. They are from FCL, not LCL, you can check how TPicture is using these units and do this same without TPicture class. I don't know your needs
« Last Edit: May 19, 2014, 11:24:18 pm by Dibo »

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: LCL without GTK
« Reply #16 on: May 19, 2014, 11:27:46 pm »
thanks again and again!
i will test that but is there a way (with ifdef or ...) to i use tpicture in desktop app and not use it for my console app,because i dont nedd it for console app but it is is unit and i cand delete it!
?

ahmadian

  • New Member
  • *
  • Posts: 35
Re: LCL without GTK
« Reply #17 on: May 19, 2014, 11:34:04 pm »
Avoiding LCL is very hard.
I must have some charting and GUI for end user and I don't want the user access to desktop apps.
Xinit solve my problem now. It run GUI programs from terminal and no need to enter desktop(LXDE on RPI).
Lazarus1.2 + FPC2.6.2 on Raspberry Pi ( installed from Jessie Repo) + LazReport Package

Dibo

  • Hero Member
  • *****
  • Posts: 1057
Re: LCL without GTK
« Reply #18 on: May 19, 2014, 11:38:57 pm »
As I said I don't know your needs for TPicture :) . Especially in console app, why you need it? For conversion between formats? You always can create own unit MyGraphics.pas with TMyPicture and play with FPWritePNG, PNGComn, FPReadPNM, FPWritePNM etc units and just use TMyPicture in your desktop and console app instead of TPicture. Probably a lot of coding but you will have control on everything. Or you can use third party library for graphics, like http://www.imagemagick.org/ , it has port for Free Pascal and I think that it doesn't require LCL

Dibo

  • Hero Member
  • *****
  • Posts: 1057
Re: LCL without GTK
« Reply #19 on: May 19, 2014, 11:46:37 pm »
If you realy need LCL routines in your console app then you can also use LCL and build console versions for desktop enviromnents (if it is not a problem for your customer / end point user). For example console app for Qt widgetsets (KDE), Gtk (GNOME, XFCE, Unity, dont' know which RedHat is using). You need to change LCLWidget type in project options (for example GTK) and build binary, then change to Qt and build new one. User will use version which he need

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: LCL without GTK
« Reply #20 on: May 22, 2014, 10:23:10 am »
thanks
@ahmadian : Xinit command did not work in my server but thank you.
@Dibo : I test both answer but sadly my server din not graphical support.
for now i made a new package and with IFDEF for all graphical part.its not a good way but fast and easy for now.


 

TinyPortal © 2005-2018