Recent

Author Topic: P.I.S.S. a PlugIn-framework / Service-locator Solution  (Read 2801 times)

cdbc

  • Hero Member
  • *****
  • Posts: 2872
    • http://www.cdbc.dk
Re: P.I.S.S. a PlugIn-framework / Service-locator Solution
« Reply #30 on: June 09, 2026, 08:07:36 am »
Hi
Right, got my hedge trimmed around the house and several other chores out of the way... Pheeeww  ;D
I've been preparing a small tool to view the 'log-files' generated by P.I.S.S. in color no less  8) and put it in THIS repo on Gitlab, you can have a look at the "Before" project (fpg-logviewer-no-piss), which is now functional. 8-)
I guess I'll then get on with an article describing the "Retro-fitting-an-existing-app" with the piss-framework & plugins...  :D
Stay tuned...
Regards Benny

ETA: Ohh, forgot to say, it compiles with FPC & Lazarus release-versions  ;)
...At a later date, I'll prolly do a LCL-version with "Pixie" as the viewing component, I just have to familiarize myself with 'Pixie' first  :D
« Last Edit: June 09, 2026, 09:45:06 am by cdbc »
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

cdbc

  • Hero Member
  • *****
  • Posts: 2872
    • http://www.cdbc.dk
Re: P.I.S.S. a PlugIn-framework / Service-locator Solution
« Reply #31 on: June 09, 2026, 11:27:35 am »
Hi
In the meantime you could check out the new feature in P.I.S.S. 'per app svc' tailoring -- made easier, it concerns 2 added lines in 'pluginconsts.inc' & 'plugintypes.inc', which if you define '-dappsvc' in Lazarus' custom options will defer the service-lookups to the app repo... 8)
I've implemented this new feature in THIS fpGUI project. Look in the 'utils' subdirectory... 8-)
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

cdbc

  • Hero Member
  • *****
  • Posts: 2872
    • http://www.cdbc.dk
Re: P.I.S.S. a PlugIn-framework / Service-locator Solution
« Reply #32 on: June 11, 2026, 11:35:42 am »
Helllooooo \ö/
Right, so I've finished the retro-fitting of P.I.S.S. onto THIS "Demo-project", namely the contents of directory 'fpg-logviewer-with-piss'...
I haven't written the article yet, but you should have a 'LookSee' for yourselves, to see if it's even necessary with an article for this  %)
As always, got questions, just ask them here  ;D Otherwise have fun out there 8-)
Regards Benny

edit: Added a screenshot...
« Last Edit: June 11, 2026, 07:52:38 pm by cdbc »
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

cdbc

  • Hero Member
  • *****
  • Posts: 2872
    • http://www.cdbc.dk
Re: P.I.S.S. a PlugIn-framework / Service-locator Solution
« Reply #33 on: June 20, 2026, 09:15:56 am »
Hi
Right, so here's a little something to all of you patient guys, that use the LCL  ;D
Yesterday I sat down and created a 'lcl_logviewerP' demo-app, featuring "Pixie" as the viewing component, (you don't have to install Pixie in the ide, the app just needs to know where the sources are), as pixie renders html5, I had to put together a new demo-plugin, that parses log-files to exactly that... See attached screenshot... The demo-project resides HERE  :D
I've chosen to add the services to the repo, instead of 'per-app-service', because this is something we all get a use for sooner or later  8)
In the hope you'll find it interesting and useful...  8-)
Regards Benny
« Last Edit: June 20, 2026, 09:18:11 am by cdbc »
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

cdbc

  • Hero Member
  • *****
  • Posts: 2872
    • http://www.cdbc.dk
Re: P.I.S.S. a PlugIn-framework / Service-locator Solution
« Reply #34 on: June 21, 2026, 12:40:43 pm »
Hi
Ok, so 'Pixie' doesn't compile in FPC 3.2.2 "out of the box", but luckily there's an easy fix for that:
· Put the following 5 lines of code in 'Pixie.HtmlView.Base.pas' @ line 23:
Code: Pascal  [Select][+][-]
  1. {$IF FPC_FULLVERSION < 30301}
  2. const
  3.   { ADDED 21.06.26 by cdbc -- FOR PIXIE COMPILING in FPC 3.2.2 }
  4.   LM_IM_QUERY = LMessages.LM_IM_COMPOSITION + 1;
  5. {$ENDIF}
Hahaha... Ok, so much for copy/paste, you can ofc. skip my note to self  :D
I've made a post in the 'Pixie'-thread here in the forum, hopefully @Retrofoxed sees it  8-)
Right, that was it... Time for some weekend  8)
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

cdbc

  • Hero Member
  • *****
  • Posts: 2872
    • http://www.cdbc.dk
Re: P.I.S.S. a PlugIn-framework / Service-locator Solution
« Reply #35 on: July 04, 2026, 06:16:01 pm »
Hellllooooo :)
Right, so I'm in the process of updating MVP-Setup, so that it'll be able to utilize P.I.S.S. /Out-of-the-box/, by just flipping a compiler-define, in the generated project/platform  ...Nifty huh \o/\ö/\o/
In my MVP-Setup, there are 2 mandatory building blocks:
· cdbc.istrlist.pas
· obs.prosu.pas
Without which, it'd be a lot harder to bring the mechanisms to life  ;)
The stringlist interface is a 'Built-In' /primary citizen/ of P.I.S.S., but up until now, the 'Observer Engine' was absent... Last night I shared the services & the implementation of the 'libobserver-xxx-26.0703.8.so' plugin, the xxx denotes the compiler that built it, e.g. 331, 324 or 322, trust me, this makes it a lot easier, in the file-explorer, when you are copying plugins to your app  :D Swing by HERE to have a "LookSee"  8)
It's located in "/demoes/demo-plugins/libobserver" & "Services"
This was an important step on the way... Because I've updated 'obs.prosu.pas' to mirror the plugin services.
· IobsProvider
· IobsConsumer
· IPublisher
· ISubscriber
As always, in the hope you may find it useful  8-)
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

cdbc

  • Hero Member
  • *****
  • Posts: 2872
    • http://www.cdbc.dk
Re: P.I.S.S. a PlugIn-framework / Service-locator Solution
« Reply #36 on: July 07, 2026, 03:00:31 am »
Hi
Right, so I've finished the update to MVP-Setup and in the process, made an article on how to recompile the projects to use "Service-Architecture" & plugins  .../not/ rewrite  ;D The article is also available in the p.i.s.s-repo... 8)
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

cdbc

  • Hero Member
  • *****
  • Posts: 2872
    • http://www.cdbc.dk
Re: P.I.S.S. a PlugIn-framework / Service-locator Solution
« Reply #37 on: July 13, 2026, 06:38:27 am »
Hi
Right, so I've just fixed a bug in'svc.base.pas', that had dodged the 'release-cleanup', here it is for you to swap in place for the old one in 'services':
Code: Pascal  [Select][+][-]
  1. {$Region 'BSD3 license' -fold}
  2. { <begin bsd 3 clause license>
  3.   Copyright (c) 2023-2026, Benny Christensen a.k.a. cdbc
  4.  
  5. All rights reserved.
  6.  
  7. Redistribution and use in source and binary forms, with or without modification,
  8. are permitted provided that the following conditions are met:
  9.  
  10.     * Redistributions of source code must retain the above copyright notice,
  11.       this list of conditions and the following disclaimer.
  12.     * Redistributions in binary form must reproduce the above copyright notice,
  13.       this list of conditions and the following disclaimer in the documentation
  14.       and/or other materials provided with the distribution.
  15.     * Neither the name of "P.I.S.S" or "svc.base" nor the names
  16.       of its contributors may be used to endorse or promote products derived
  17.       from this software without specific prior written permission.
  18.  
  19. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  20. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  22. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  23. CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  24. EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  25. PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  26. PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  27. LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  28. NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  29. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30. <end of bsd 3 license> }
  31. {$EndRegion 'BSD3 license'}
  32. unit svc.base;
  33. {$mode ObjFPC}{$H+}                  /// TODO ///
  34. {$WARN 5024 off : Parameter "$1" not used}
  35. {-$define regsvc} { defined = registers with included SvcMgr, undefined = NO SvcMgr ~ lighter :o) }
  36. {$define usepli} { defined = depends on "bc_pluginapih.pas", undefined = depends on "bc_bomintf.pas" }
  37. interface        { regsvc is not necessary, when developing plugin-libraries, }
  38. uses             { as it includes ALL the svcmgr! }
  39.   Classes, SysUtils, cdbc.pluginapih; /// {$ifdef usepli} {$endif}
  40. const
  41.   { ©2023-2026 Benny Christensen a.k.a. cdbc }
  42.   bcoVersion = '26.0502.1'; { second commit, now ready as plugins }
  43.   bcoDescription = '"IbcCorba" is a direct descendant of ICorba! ';
  44.  
  45.   ///// includes shared consts when not used in plugin /////  {$ifdef usepli}
  46.   {$i svc.baseconsts.inc} /// {$ifndef usepli}  {$endif}
  47. type
  48.   { useful event for cli-programming }
  49.   TbcNotifyCallback = procedure(aSender: TObject;Userdata: pointer);
  50.   { useful event for gui-programming }
  51.   TbcNotifyEvent = procedure(aSender: TObject;Userdata: pointer) of object;
  52.   ///// includes shared types when not used in plugin /////  {$ifdef usepli}
  53.   {$i svc.basetypes.inc} /// {$ifndef usepli}  {$endif}
  54.  
  55.  
  56. implementation
  57.  
  58. end.
  59.  
  60.  
My bad -- Sorry  :-X
A big Thank You goes to @Hansvb on this forum, for testing and checking \o/
Regards Benny

edit: Of course the repo itself has been updated too, this was for those with zips  ;D
« Last Edit: July 13, 2026, 11:49:51 am by cdbc »
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

 

TinyPortal © 2005-2018