Recent

Author Topic: Light LCL (LLCL) - Small Windows executable files v1.02  (Read 34273 times)

ChrisF

  • Hero Member
  • *****
  • Posts: 542
Light LCL (LLCL) - Small Windows executable files v1.02
« on: October 16, 2015, 03:36:14 pm »
    The Light LCL (LLCL) is intended to provide a way to produce small Windows executable files with Free Pascal/Lazarus or Delphi 7, while still being compatible with - a part of - the LCL/VCL.

    Based upon the Very Light VCL (LVCL), it's an emulation of a small subset of the standard LCL/VCL, for only the most basic controls and classes, with their most common properties, methods and events. Of course, it implies that only the controls and properties present in the Light LCL can be used.

    Using it is very simple. There is nothing to install, nor any configuration to modify: just indicate a valid path for the Light LCL files into your project options, and that's it !

    A few options are available (in include files): there is even an experimental UTF-16 option (with Free Pascal compiler version 3.x).

    The Light LCL is released under the Mozilla Public License version 2.0: you can use it with any kind of project.


Comparison of executable sizes

(32 bits, no debugging info, small icon)

|--------------|---------------------|------------------|
|Project       | LCL (Lazarus 1.4.4) | LLCL Free Pascal |
|--------------|---------------------|------------------|
|Demo LLCLTest |       1721 Kb       |      141 Kb      |
|--------------|---------------------|------------------|
|FileCRC       |       1696 Kb       |      141 Kb      |
|--------------|---------------------|------------------|
|MiniCalc      |       1652 Kb       |      118 Kb      |
|--------------|---------------------|------------------|



Download links (GitHub)

    Light LCL (LLCL), with a sample project: Light LCL (LLCL)

    Additional various sample projects: LLCL sample projects


Demonstration project screen
« Last Edit: August 01, 2016, 05:49:11 pm by ChrisF »

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2497
    • havefunsoft.com
Re: Light LCL (LLCL) - Small Windows executable files
« Reply #1 on: October 16, 2015, 03:47:34 pm »
I'd recommend to create a wiki page. The same way as competing KOL does.
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

ChrisF

  • Hero Member
  • *****
  • Posts: 542
Re: Light LCL (LLCL) - Small Windows executable files
« Reply #2 on: October 16, 2015, 04:29:42 pm »
I could, if the LLCL is considered sufficiently interesting to do it.

Anyway, there are already the main interesting pieces of information in the GitHub links. And also in the corresponding GitHub web pages:

http://fchrisf.github.io/LLCL
http://fchrisf.github.io/LLCL-samples


Note

BTW, I precise that, contrarily to KOL and some other libraries/packages, the LLCL is compatible with the LCL; at least if only the components/properties present in the LLCL are used of course. Which means that exactly the same project and code can be compiled either with the LCL or with the LLCL.
« Last Edit: October 17, 2015, 04:31:00 pm by ChrisF »

GetMem

  • Hero Member
  • *****
  • Posts: 3753
Re: Light LCL (LLCL) - Small Windows executable files
« Reply #3 on: October 16, 2015, 05:07:48 pm »
@ChrisF

In my opinion nowadays the size of the binary it's not so important, like it was in the 90(dial-up connections :) ). Nevertheless this is still a cool feature. I will run a few tests soon. Thanks Chris!

Handoko

  • Hero Member
  • *****
  • Posts: 3658
  • My goal: build my own game engine using Lazarus
Re: Light LCL (LLCL) - Small Windows executable files
« Reply #4 on: October 16, 2015, 05:39:58 pm »
Thank you ChrisF for the LLCL. Although it's not essential to keep the exe file small, but I think many people will interested to use it.

In my opinion nowadays the size of the binary it's not so important, like it was in the 90(dial-up connections :) ). Nevertheless this is still a cool feature. I will run a few tests soon. Thanks Chris!

Use it to impress clients.

I recall that some years ago I used Lazarus to build a simple stock keeping app. The user was amazed with a single ± 4 MB exe file that can perform the things she needs. No installation needed, no other files, the dbf files will generated automatically on the first run.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 993
Re: Light LCL (LLCL) - Small Windows executable files
« Reply #5 on: October 16, 2015, 06:18:27 pm »
Thank you ChrisF for the LLCL. Although it's not essential to keep the exe file small, but I think many people will interested to use it.

In my opinion nowadays the size of the binary it's not so important, like it was in the 90(dial-up connections :) ). Nevertheless this is still a cool feature. I will run a few tests soon. Thanks Chris!

Yes, some of us are still interested because of internet limitations in some countries, states and cities. No all the world has good internet conection even nowadays.

rtusrghsdfhsfdhsdfhsfdhs

  • Full Member
  • ***
  • Posts: 162
Re: Light LCL (LLCL) - Small Windows executable files
« Reply #6 on: October 16, 2015, 06:29:29 pm »
Please please add option for UTF16. Thanks.

ChrisF

  • Hero Member
  • *****
  • Posts: 542
Re: Light LCL (LLCL) - Small Windows executable files
« Reply #7 on: October 17, 2015, 04:30:16 pm »
@All:
Thanks for all your remarks and comments.

@Fiji:
UTF-16 (experimental) is already implemented, but you have to activate it manually (as indicated in README.txt).

For that, you must modify the compilation mode option in the Light LCL units (done using the common include file LLCLFPCInc.inc), and also in your project units.

For instance, using UTF-16 for the sample program (LLCLTest) included in the Light LCL files:

- modify the LLCLFPCInc.inc include file. Select one of the 2 possible UTF-16 options ("$modeswitch unicodestrings" or "$mode delphiunicode"):
Code: [Select]
//  {$mode objfpc}{$H+}                              // comment this line
//  {$mode delphi}
    {$mode objfpc}{$modeswitch unicodestrings}{$H+}  // uncomment this line
//  {$mode delphiunicode}

- modify the unit1.pas file of the LLCLTest project:
Code: [Select]
{$IFDEF FPC}
//  {$mode objfpc}{$H+}                              // comment this line
//  {$mode delphi}
    {$mode objfpc}{$modeswitch unicodestrings}{$H+}  // uncomment this line
//  {$mode delphiunicode}
{$ENDIF}

- re-compile the project: it's done.


Additional notes:

- in this case, one could also want to use only the "wide" Windows APIs version. This can be done using the other common include file LLCLOptions.inc:
Code: [Select]
//{$DEFINE LLCL_OPT_UNICODE_API_A}
//{$DEFINE LLCL_OPT_UNICODE_API_W}
  {$DEFINE LLCL_OPT_UNICODE_API_W_ONLY}     // uncomment this line to use only the Wide/Unicode Windows APIs

- you must also indicate the encoding type of your source units to the compiler (usually -FcUTF8) in the project compiler options (Other->Custom Options).

Leledumbo

  • Hero Member
  • *****
  • Posts: 8244
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Light LCL (LLCL) - Small Windows executable files
« Reply #8 on: October 17, 2015, 04:44:43 pm »
Nice! Anyway, since this is meant to be a LCL compatible subset, it would be good to add a table of what's available. I'm testing to port one of my clean LCL apps.

ChrisF

  • Hero Member
  • *****
  • Posts: 542
Re: Light LCL (LLCL) - Small Windows executable files
« Reply #9 on: October 17, 2015, 05:13:57 pm »
[...] Anyway, since this is meant to be a LCL compatible subset, it would be good to add a table of what's available
[...]

Only a very small subset, I'm afraid (there are no miracles).

Please consider that the Light LCL is intended to deal only with "basic" user interactions:
- label/statictext to display some text informations,
- edit/checkbox/radiobutton to get some infos from the user
- pushbutton to start an action,
- and so on...

The lists for the controls and their properties/methods/events available are detailed in the README.txt file (Chapter 7).

Anyway, here is a copy of the list of the controls which are available:
Quote

7.1 CONTROL CLASSES AVAILABLE
-----------------------------
Standard: TLabel, TButton, TEdit, TMemo, TCheckBox,
          TRadioButton, TGroupBox, TComboBox, TListBox,
          TStaticText, TMainMenu, TPopupMenu
Additional: TImage,  TTrayIcon
Common: TProgressBar, TTrackBar, TXPManifest (Delphi)
Dialogs: TOpenDialog, TSaveDialog
System: TTimer

Other classes: TCustomForm, TForm

General variables: Application (TApplication), Mouse(TMouse)


For having doing it myself, modifying existing applications to use the Light LCL (or the Light VCL from Synopse) is usually a bit "complicated" (for not saying "very difficult").

There are always a few things wrong, not recognized (i.e. not implemented); and making the necessary changes is not always that simple.

Ideally, creating new applications, with the Light LCL limitations in mind during the designing/coding, is preferable (but of course not always possible).

Leledumbo

  • Hero Member
  • *****
  • Posts: 8244
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Light LCL (LLCL) - Small Windows executable files
« Reply #10 on: October 17, 2015, 06:29:02 pm »
The lists for the controls and their properties/methods/events available are detailed in the README.txt file (Chapter 7).
Please forgive my ignorance. I thought the .txt is the same as the .md.
Anyway, here is a copy of the list of the controls which are available:
Ah... too bad, it's missing TListView. No problem, perhaps it's better to keep it that way so the library stays small.

Dibo

  • Hero Member
  • *****
  • Posts: 1048
Re: Light LCL (LLCL) - Small Windows executable files
« Reply #11 on: October 17, 2015, 06:46:50 pm »
Light LCL idea remind mi FPgtk unit. Simple classes for low level OS API controls. But FPgtk is very old and support gtk1

ChrisF

  • Hero Member
  • *****
  • Posts: 542
Re: Light LCL (LLCL) - Small Windows executable files
« Reply #12 on: October 18, 2015, 12:22:37 am »
Please forgive my ignorance. I thought the .txt is the same as the .md.

My fault: I agree that using the same name is a bit confusing.


Ah... too bad, it's missing TListView. No problem, perhaps it's better to keep it that way so the library stays small.

I don't know if it really concerns what you were looking for with a TListView, but I intend to add a way to display 2 dimensional arrays of data in a near future.

Based on the native Windows Listview control (LVS_REPORT style), probably a TStringGrid (sorry, theoretically not a TListView with the vsReport ViewStyle); the TStringGrid control having the advantage to be located into a separate unit (Grids), which will imply no additional penalty size for projects not using it specifically.

Anyway, as usual for the Light LCL just the "very basic" features: 2 dimensional array of string data, no possible edition, one (and only one) optional fixed row (for the eventual column titles), ... What is already proposed natively in the Windows control (i.e. without a lot of additional code).

Derit

  • Jr. Member
  • **
  • Posts: 55
Re: Light LCL (LLCL) - Small Windows executable files
« Reply #13 on: October 20, 2015, 08:40:50 am »
Good Job...
Lazarus Trunk/FPC Trunk/2.6.2/2.6.4

x2nie

  • Sr. Member
  • ****
  • Posts: 478
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Re: Light LCL (LLCL) - Small Windows executable files
« Reply #14 on: October 20, 2015, 11:41:19 am »
Yeah! good work
When you were logged in, you can see attachments.
Lazarus Trunk @ Windows7 64bit, XP 32bit, Debian under VirtualMachine

 

TinyPortal © 2005-2018