PrusaSlicer-NonPlainar/lib/Slic3r/Config.pm

33 lines
843 B
Perl
Raw Permalink Normal View History

2016-09-13 11:24:55 +02:00
# Extends C++ class Slic3r::DynamicPrintConfig
# This perl class does not keep any perl class variables,
# all the storage is handled by the underlying C++ code.
2011-10-03 11:55:32 +02:00
package Slic3r::Config;
use strict;
use warnings;
use utf8;
2011-10-03 11:55:32 +02:00
use List::Util qw(first max);
2016-09-13 11:24:55 +02:00
# C++ Slic3r::PrintConfigDef exported as a Perl hash of hashes.
# The C++ counterpart is a constant singleton.
our $Options = print_config_def();
# Generate accessors.
{
2011-10-05 18:13:47 +02:00
no strict 'refs';
for my $opt_key (keys %$Options) {
*{$opt_key} = sub {
#print "Slic3r::Config::accessor $opt_key\n";
$_[0]->get($opt_key)
};
}
2011-10-05 18:13:47 +02:00
}
2015-12-16 12:33:19 +01:00
package Slic3r::Config::Static;
use parent 'Slic3r::Config';
2015-12-16 12:33:19 +01:00
sub Slic3r::Config::GCode::new { Slic3r::Config::Static::new_GCodeConfig }
sub Slic3r::Config::Print::new { Slic3r::Config::Static::new_PrintConfig }
2014-01-02 10:44:54 +01:00
2011-10-03 11:55:32 +02:00
1;