Add your Feature Requests

Discussion of features and help with problems encountered while using libRocket

Re: Add your Feature Requests

Postby mooflu on Fri Jul 22, 2011 10:31 pm

I think it would be good to add a Length API to FileInterface.
Getting the file length via seek-to-end & tell can be expensive for compressed streams and archive wrappers like PHYSFS. Unless you cache, you'll end up decompressing twice (to get the length and then to get contents).
mooflu
 
Posts: 25
Joined: Fri Mar 25, 2011 8:04 pm

Re: Add your Feature Requests

Postby lloydw on Thu Jul 28, 2011 1:52 am

fromwithin wrote:I am yet to send you patch information for the RTTI changes. What is the best way to do that considering that the repository version has various differences now to 1.2.1? I'm sure it would be worth me sending our modified headers too.


The best way would be to a git checkout of the 1.2.1 code, put your changes into that and then submit a pull request via github. That way git will know about the common ancestor.
lloydw
Rocket Engineer
Rocket Engineer
 
Posts: 380
Joined: Tue Jan 15, 2008 10:56 pm

Re: Add your Feature Requests

Postby lloydw on Thu Jul 28, 2011 1:53 am

fromwithin wrote:I would like to be able to mark specific elements in the rml as volatile so that they get rendered as temporary objects instead of compiled objects.


This is a nice idea, I guess the best way to do it would be to make it a stylesheet property.
lloydw
Rocket Engineer
Rocket Engineer
 
Posts: 380
Joined: Tue Jan 15, 2008 10:56 pm

Re: Add your Feature Requests

Postby Liberator on Fri Dec 16, 2011 2:49 am

I'd like to be able to request all registered/loaded font names. There are functions to load an asset and define the font purely based on the asset, but subsequently there is no way to get the name under which the font was registered. This sort of thing is useful for integration with other libraries and pretty trivial to add.
Liberator
 
Posts: 3
Joined: Fri Dec 16, 2011 2:41 am

Re: Add your Feature Requests

Postby Liberator on Fri Dec 16, 2011 9:21 pm

I'd also like to request the ability to compile libRocket such that the RenderInterface passes a short* array for the indices instead of an int*. GLES does not support GL_UNSIGNED_INT, the biggest is GL_UNSIGNED_SHORT. If you made the pointer type a typdef'ed type which is altered based on a preprocessor define (LIBROCKET_USE_SHORT_INDICES or something) then people building for Android can just specify that flag and get a Android GLES compatible interface. Right now I'm just reallocating a short array and copying the values which is of course very detrimental for performance.
Would you consider making such a change?
Liberator
 
Posts: 3
Joined: Fri Dec 16, 2011 2:41 am

Re: Add your Feature Requests

Postby morgul on Mon Jan 30, 2012 4:39 pm

Just to throw something out that I'd love to see:

Django-like templates.

Most of the templating system django has, I don't think rocket needs, but here's a great example of where I think it could benefit from it:

window.rml template
Code: Select all
<rml>
   <head>
      <link type="text/rcss" href="rkt.rcss"/>
      <link type="text/rcss" href="invader.rcss"/>
      {% block head %}{% endblock %}
   </head>
   <body class="window">
      <div id="title_bar">
         <handle move_target="#document">
         {% block titlebar %}
            <div id="icon"></div>
            <span id="title">Title</span>
         {% endblock %}
         </handle>
      </div>
      <div id="window">
         <div id="content">
         {% block content %}
         {% endblock %}
         </div>
      </div>
      <handle size_target="#document" style="position: absolute; width: 16px; height: 16px; bottom: 0px; right: 0px;">
      {% block resize %}
      {% endblock %}
      </handle>
   </body>
</rml>


demo.rml
Code: Select all
{% extends "window.rml" %}

{% block head %}
<title>Demo</title>
<style>
   body
   {
      width: 300px;
      height: 225px;
      background-color: green;
      margin: auto;
   }
         
   div#title_bar div#icon
   {
      display: none;
   }
         
   div#content
   {
      text-align: left;
   }
</style>
{% endblock %}

{% block content %}
This is a sample.
{% endblock %}


First, we remove duplicate code by allowing templates to define a structure, and all we do is plug in the contents. Also, this solves the problem of only being able to replace a single 'block' in templates, like they are currently. It makes templates much more powerful, and imho, much more useful.

As far as implementation goes, there's this project: https://github.com/fawek/cjango , which is a C++ based parser for django styled templates, and MIT licensed. The code could be pulled in as either a plugin, or possibly integrated directly.

As an alternative, we could turn the block syntax into valid XML:

window.rml template
Code: Select all
<template>
   <head>
      <link type="text/rcss" href="rkt.rcss"/>
      <link type="text/rcss" href="invader.rcss"/>
      <block name='head"/>
   </head>
   <body class="window">
      <div id="title_bar">
         <handle move_target="#document">
         <block name="titlebar">
            <div id="icon"></div>
            <span id="title">Title</span>
         </block>
         </handle>
      </div>
      <div id="window">
         <div id="content">
         <block name="content">
         </block>
         </div>
      </div>
      <handle size_target="#document" style="position: absolute; width: 16px; height: 16px; bottom: 0px; right: 0px;">
      <block name="resize">
      </block>
      </handle>
   </body>
</template>


demo.rml
Code: Select all
<rml extends="window.rml">

<block name="head">
<title>Demo</title>
<style>
   body
   {
      width: 300px;
      height: 225px;
      background-color: green;
      margin: auto;
   }
         
   div#title_bar div#icon
   {
      display: none;
   }
         
   div#content
   {
      text-align: left;
   }
</style>
</block>

<block name="content">
This is a sample.
</block>
</rml>


Personally, I don't like that as much... though it'd be better than nothing. Right now, I just really find myself missing a good templating system when I work with rocket.

If you're interested, and want to provide feedback, I'm interested in working out an initial implementation, and submitting patches.
morgul
 
Posts: 5
Joined: Fri Jan 06, 2012 4:01 pm

Re: Add your Feature Requests

Postby lloydw on Thu Feb 16, 2012 3:50 am

Sounds to me like you want to put cdjango in front of libRocket. Let it parse the templates and then inject the final RML into libRocket.
lloydw
Rocket Engineer
Rocket Engineer
 
Posts: 380
Joined: Tue Jan 15, 2008 10:56 pm

Re: Add your Feature Requests

Postby halsafar on Fri Mar 09, 2012 4:01 am

I know this has been requested but it must be requested again. Please go through the API and convert indices everywhere to short. I can't imagine libRocket ever requiring more indices than a short can support. Until this is done essentially everyone using this on mobile has to have a for loop in their render method to convert to short.
halsafar
 
Posts: 9
Joined: Thu Mar 08, 2012 3:20 am

Re: Add your Feature Requests

Postby lloydw on Tue Mar 20, 2012 11:07 pm

I totally agree, I actually look at doing this awhile ago, but then realised the problem goes a LOT deeper than just the renderer, so put it on the backlog :)
lloydw
Rocket Engineer
Rocket Engineer
 
Posts: 380
Joined: Tue Jan 15, 2008 10:56 pm

Re: Add your Feature Requests

Postby powerpup118 on Fri May 25, 2012 6:19 pm

I'd like to see the Python API have a way to grab the currently selected text in an input.text or textarea widget, that way I could impliment copy+paste in my Python code.

Great library btw,
~powerpup118
powerpup118
 
Posts: 2
Joined: Fri May 25, 2012 6:17 pm

PreviousNext

Return to Using libRocket