Register renderer

@param \ViKon\Parser\Renderer\Renderer $renderer
4626
public function register(Renderer $renderer) {
        $this->registerTokenRenderer(LinkInlineRule::NAME, 'renderInline', $renderer);
        $this->registerTokenRenderer(LinkReferenceRule::NAME, 'renderReference', $renderer);
        $this->registerTokenRenderer(LinkAutoRule::NAME, 'renderAuto', $renderer);
    }
1245421
public function render($renderer)
    {
        if ($this->x1 === ReportBaseElement::CURRENT_POSITION) {
            $this->x1 = $renderer->getX();
        }
        if ($this->y1 === ReportBaseElement::CURRENT_POSITION) {
            $this->y1 = $renderer->getY();
        }
        if ($this->x2 === ReportBaseElement::CURRENT_POSITION) {
            $this->x2 = $renderer->getRemainingWidth();
        }
        if ($this->y2 === ReportBaseElement::CURRENT_POSITION) {
            $this->y2 = $renderer->getY();
        }
        // Vertical line
        if ($this->x1 == $this->x2) {
            echo '<div style="position:absolute;overflow:hidden;border-', $renderer->alignRTL, ':solid black 1pt;', $renderer->alignRTL, ':', $this->x1, 'pt;top:', $this->y1 + 1, 'pt;width:1pt;height:', $this->y2 - $this->y1, "pt;\"> </div>\n";
        }
        // Horizontal line
        if ($this->y1 == $this->y2) {
            echo '<div style="position:absolute;overflow:hidden;border-top:solid black 1pt;', $renderer->alignRTL, ':', $this->x1, 'pt;top:', $this->y1 + 1, 'pt;width:', $this->x2 - $this->x1, "pt;height:1pt;\"> </div>\n";
        }
        // Keep max Y updated
        // One or the other will be higher... lasy mans way...
        $renderer->addMaxY($this->y1);
        $renderer->addMaxY($this->y2);
    }
716675
public function register(PregDateLexerInterface $lexer)
    {
        $this->regexp .= $lexer->getExpression();
        $this->lexers[] = $lexer;
    }
1268622
public function registerTplEngine($resolver)
    {
        $app = $this->app;

        $resolver->register('tpl', function() use ($app)
        {
            $cache = $app['path.storage'].'/views';

            // The Compiler engine requires an instance of the CompilerInterface, which in
            // this case will be the Blade compiler, so we'll first create the compiler
            // instance to pass into the engine so it can compile the views properly.
            $compiler = new TplCompiler($app['files'], $cache);


            return new CompilerEngine($compiler, $app['files']);
        });
    }
306044
public function render( RendererInterface $renderer )
    {
        return $renderer->translate(
            'default.' . ( $this->successful ? 'success' : 'failed' ),
            'default'
        ) . ( empty( $this->loginWith ) ? '' : ', ' . sprintf(
            $renderer->translate( 'user.action.loginWith.%s', 'user' ),
            $renderer->translate( 'user.loginWith.' . $this->loginWith, 'user' )
        ) );
    }
285385
@Override
	public void registerLayerRenderer(Layer layer, LayerRenderer layerRenderer) {
		if (layerRenderers.containsKey(layer)) {
			layerRenderers.remove(layer);
		}
		layerRenderers.put(layer, layerRenderer);
	}
808713
protected function registerDispatcher()
    {
        $this->app->singleton(Dispatcher::class, function() {
            return new Dispatcher(
                $this->app->make('files'), $this->app->make('html'), $this->app->make('antares.asset.resolver'), $this->app->make('path.public')
            );
        });

        $this->app->alias(Dispatcher::class, 'antares.asset.dispatcher');
    }
1065621
public function registerBladeEngine($resolver)
    {
        $me = $this;
        $app = $this->container;

        // The Compiler engine requires an instance of the CompilerInterface, which in
        // this case will be the Blade compiler, so we'll first create the compiler
        // instance to pass into the engine so it can compile the views properly.
        $this->container->singleton('blade.compiler', function($app) use ($me)
        {
            $cache = $me->cachePath;

            return new BladeCompiler($app['files'], $cache);
        });

        $resolver->register('blade', function() use ($app)
        {
            return new CompilerEngine($app['blade.compiler'], $app['files']);
        });
    }
176282
public function register(WritableInterface $container)
    {
        $config = $container->get(self::CONFIG);

        $paths = $config->get('app.views', $this->paths);

        $renderer = new Renderer((array) $paths);

        return $container->set(self::RENDERER, $renderer);
    }
139346
protected function registerCompiler()
    {
        $this->app->singleton('markdown.compiler', function (Container $app) {
            $markdown = $app['markdown'];
            $files = $app['files'];
            $storagePath = $app->config->get('view.compiled');

            return new MarkdownCompiler($markdown, $files, $storagePath);
        });

        $this->app->alias('markdown.compiler', MarkdownCompiler::class);
    }
104895
public function render($renderer)
    {
        if ($this->x1 === ReportBaseElement::CURRENT_POSITION) {
            $this->x1 = $renderer->GetX();
        }
        if ($this->y1 === ReportBaseElement::CURRENT_POSITION) {
            $this->y1 = $renderer->GetY();
        }
        if ($this->x2 === ReportBaseElement::CURRENT_POSITION) {
            $this->x2 = $renderer->getMaxLineWidth();
        }
        if ($this->y2 === ReportBaseElement::CURRENT_POSITION) {
            $this->y2 = $renderer->GetY();
        }
        if ($renderer->getRTL()) {
            $renderer->Line($renderer->getPageWidth() - $this->x1, $this->y1, $renderer->getPageWidth() - $this->x2, $this->y2);
        } else {
            $renderer->Line($this->x1, $this->y1, $this->x2, $this->y2);
        }
    }
902261
public function init(Parser $parser, Renderer $renderer) {
        foreach ($this->ruleRenderers as $ruleRenderer) {
            $renderer->registerRenderer($ruleRenderer, $this->name);
        }

        $parser->setRenderer($renderer);

        return $this;
    }
704909
public function register()
    {
        $this->mergeConfig();
        $this->app->singleton(RendererContainerInterface::class, function() {
            $default = $this->getDefaultRenderer();
            $container = new RendererContainer($default);
            $container->registerRenderers($this->getExceptionRenderers());
            return $container;
        });
    }
696025
public function registerBladeEngine($resolver)
    {
        // The Compiler engine requires an instance of the CompilerInterface, which in
        // this case will be the Blade compiler, so we'll first create the compiler
        // instance to pass into the engine so it can compile the views properly.
        $this->app->singleton('blade.compiler', function () {
            return new BladeCompiler(
                $this->app['files'], $this->app['config']['view.compiled']
            );
        });

        $resolver->register('blade', function () {
            return new CompilerEngine($this->app['blade.compiler']);
        });
    }
1107463
private function configureParser()
    {
        $renderer = $parser = null;
        $model = new \RunBB\Model\Admin\Parser();

        $configurator = new \s9e\TextFormatter\Configurator();
        $plugins = unserialize(User::get()->g_parser_plugins);

        $useSmilies = false;
        foreach ($plugins as $k => $plugin) {
            $configurator->plugins->load($plugin);
            if ($plugin === 'Emoticons') {
                $useSmilies = true;
            }
        }

        if ($useSmilies) {
            foreach ($model->getSmilies() as $k => $v) {
                $configurator->Emoticons->add($k, $v['html']);
            }
        }

        $configurator->registeredVars['cacheDir'] = ForumEnv::get('FORUM_CACHE_DIR');

        // Get an instance of the parser and the renderer
        extract($configurator->finalize());

        // We save the parser and the renderer to the disk for easy reuse
        Utils::checkDir($this->cacheDir);

        file_put_contents($this->cacheDir.'/'.User::get()->g_title.'Parser.php', serialize($parser));
        file_put_contents($this->cacheDir.'/'.User::get()->g_title.'Renderer.php', serialize($renderer));

        $this->parser = $parser;
        $this->renderer = $renderer;
    }
995252
public function registerBladeEngine($resolver)
    {
        $app = $this->app;

        // The Compiler engine requires an instance of the CompilerInterface, which in
        // this case will be the Blade compiler, so we'll first create the compiler
        // instance to pass into the engine so it can compile the views properly.
        $app->singleton('blade.compiler', function ($app) {
            $cache = $app['config']['view.compiled'];

            return new BladeCompiler($app['files'], $cache);
        });
    }
404647
public function addRendererAdapter(RendererAdapterInterface $rendererAdapter)
    {
        $key = $this->getRendererAdapterKey($rendererAdapter);
        if (!$this->rendererAdapters->has($key)) {
            $this->rendererAdapters->set($key, $rendererAdapter);
            $this->addManagedExtensions($rendererAdapter);
        }

        if (null === $this->defaultAdapter) {
            $this->defaultAdapter = $key;
        }
    }