Update of /cvsroot/popfile/engine
In directory sc8-pr-cvs1:/tmp/cvs-serv17538
Modified Files:
popfile.pl
Added Files:
popfile.ico
Log Message:
First commit of code to detect and load platform specific extensions; first commit of Windows platform module that adds an icon to the system tray (does nothing right now---in fact can cause a nasty crash if you click on it)
Index: popfile.pl
===================================================================
RCS file: /cvsroot/popfile/engine/popfile.pl,v
retrieving revision 1.206
retrieving revision 1.207
diff -C2 -d -r1.206 -r1.207
*** popfile.pl 3 Mar 2003 22:01:27 -0000 1.206
--- popfile.pl 14 Mar 2003 23:12:48 -0000 1.207
***************
*** 21,29 ****
my %components;
- # This is the A PIECE OF PLATFORM SPECIFIC CODE and all it does is force Windows users to have
- # v5.8.0 because that's the version with good fork() support everyone else can use whatever they
- # want. This is probably only temporary because at some point I am going to force 5.8.0 for
- # everyone because of the better Unicode support
-
my $on_windows = 0;
--- 21,24 ----
***************
*** 246,249 ****
--- 241,260 ----
print " Loading... ";
+ # Look for a module called Platform::<platform> where <platform> is the value of $^O
+ # and if it exists then load it as a component of POPFile. IN this way we can have
+ # platform specific code (or not) encapsulated. Note that such a module needs to be
+ # a POPFile Loadable Module and a subclass of POPFile::Module to operate correctly
+
+ my $platform = $^O;
+
+ if ( -e "Platform/$platform.pm" ) {
+ require "Platform/$platform.pm";
+ $platform = "Platform::$platform";
+ my $mod = new $platform;
+ my $name = $mod->name();
+ $components{core}{$name} = $mod;
+ print " {$name}";
+ }
+
load_modules( 'POPFile', 'core' );
load_modules( 'Classifier', 'classifier' );
***************
*** 254,259 ****
$components{core}{config}->{major_version} = 0;
! $components{core}{config}->{minor_version} = 18;
! $components{core}{config}->{build_version} = 1;
print "\nPOPFile Engine v$components{core}{config}->{major_version}.$components{core}{config}->{minor_version}.$components{core}{config}->{build_version} starting";
--- 265,270 ----
$components{core}{config}->{major_version} = 0;
! $components{core}{config}->{minor_version} = 19;
! $components{core}{config}->{build_version} = 0;
print "\nPOPFile Engine v$components{core}{config}->{major_version}.$components{core}{config}->{minor_version}.$components{core}{config}->{build_version} starting";
|