Module *m_frame* ***************** Documentation for the modules-m_frame module in */std/modules/m_frame.c*. Module Information ================== This module creates fancy and colourful frames using unicode characters and 256 colour based from XTERM256_D. .. TAGS: RST Functions ========= .. c:function:: int colour_strlen(string str) Gives the length of the visible portion of s. Colour codes (e.g. %^GREEN%^ <123>) are ignored. .. c:function:: string use_colour(string *cols, int position, int width) Returns the colour in the colour array, cols, to use given the position out of the width (typically screen width). .. c:function:: string query_style() Returns the current frame style. .. c:function:: void set_style(string t) Set a specific style if it exists. .. c:function:: string *query_frame_colour_themes() Returns a list of the frame colour themes available. The list is sorted alphabetically. .. c:function:: int valid_theme(string t) Checks if string ``t`` is a valid theme, and returns 1 if it is, otherwise 0. .. c:function:: string *query_frame_styles() Returns all the implemented frame styles. .. c:function:: void set_frame_left_header() Sets the frame into a mode where the header is not shown at the top, but shown at the left side. .. c:function:: nomask int frame_simplify() Returns TRUE if the current user (not the object receiving the message!) has simplify turned on. .. c:function:: string title(mixed t) Sets the title of the frame. .. c:function:: string accent(mixed t) Takes a string and applies the accent colour to it. .. c:function:: string raw_accent() Returns the raw accent colour, i.e. the XXX number triplet. .. c:function:: string raw_title() Returns the raw title colour, i.e. the XXX number triplet. .. c:function:: string warning(mixed t) Takes a string and applies the warning colour to it. .. c:function:: void set_frame_title(string s) Sets the frame title. Big surprise. .. c:function:: void set_width(int w) Sets the width of the frame. Minimum is 10, maximum is 1000. Other values will be capped. .. c:function:: int query_width() Returns the width of the frame. .. c:function:: void set_title_margin(int hm) Sets the margin for the title. It's the space between the frame and the title. .. c:function:: void set_text_margin(int tm) Set the text margin. .. c:function:: void frame_init_user() Init the frame based on the user settings. This is normally always called before the rendering to set the frame up correctly. See most commands using frames. .. c:function:: void set_frame_header(string hc) Set the frame header, works both vertically and horizontally. .. c:function:: void set_frame_footer(string fc) Sets the frame footer. .. c:function:: void set_frame_content(mixed c) This is the main function to call for the main content of the frame. Content must either be an array of strings or a single string. .. c:function:: void set_frame_hcolours(string *hc) Inject the colour array raw into the frame. Don't call this unless you've read the source code for M_FRAME. .. c:function:: void set_theme(string t) Sets the frame theme. .. c:function:: string query_frame_title(string theme) Returns the frame title. .. c:function:: string query_frame_accent(string theme) Returns the frame accent colour given ``theme``. .. c:function:: string query_frame_warning(string theme) Returns the frame warning colour given ``theme``. .. c:function:: string frame_demo_string(string style, int w) Returns a simple demo string. .. c:function:: string frame_colour_demo(string style, string colour, int w) Do a frame colour demo using ``style`` using ``colour`` in width ``w``. .. c:function:: string menu_render() Produces a render of the current menu. .. c:function:: string frame_render() Renders the final frame into a string for printing. .. c:function:: varargs void frame_add_column(string name, mixed *data, function colour_function, int max_width) Adds a column with a name, and an array of strings or integers to be shown. This can only be rendered if all contents are columns. Use ``frame_render_columns()`` to render. Call ``frame_init_user()`` before adding columns. If max_width is not specified, it will be calculated based on the longest string in the column. Important: Frame header and frame content should not be called as they are calculated automatically. .. c:function:: string frame_render_columns() Render the columns added via ``frame_add_column()``. Important: Frame header and frame content should not be called as they are calculated automatically. *File generated by Lima 1.1a4 reStructured Text daemon.*