summaryrefslogtreecommitdiff
path: root/apps/plugins/helloworld.lua
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/helloworld.lua')
0 files changed, 0 insertions, 0 deletions
>53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172
/***************************************************************************
 *             __________               __   ___.
 *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
 *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
 *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
 *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
 *                     \/            \/     \/    \/            \/
 * $Id$
 *
 * Copyright (C) 2010 Robert Bieber
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
 * KIND, either express or implied.
 *
 ****************************************************************************/

#include "skinhighlighter.h"

#include <QSettings>

SkinHighlighter::SkinHighlighter(QTextDocument* doc)
    :QSyntaxHighlighter(doc)
{
    loadSettings();
}

SkinHighlighter::~SkinHighlighter()
{

}

void SkinHighlighter::highlightBlock(const QString& text)
{
    for(int i = 0; i < text.length(); i++)
    {
        QChar c = text[i];

        /* Checking for delimiters */
        if(c == ARGLISTOPENSYM
           || c == ARGLISTCLOSESYM
           || c == ARGLISTSEPERATESYM)
            setFormat(i, 1, tag);

        if(c == ENUMLISTOPENSYM
           || c == ENUMLISTCLOSESYM
           || c == ENUMLISTSEPERATESYM)
            setFormat(i, 1, conditional);

        /* Checking for comments */
        if(c == COMMENTSYM)
        {
            setFormat(i, text.length() - i, comment);
            return;
        }

        if(c == TAGSYM)
        {
            if(text.length() - i < 2)
                return;

            if(find_escape_character(text[i + 1].toAscii()))
            {
                /* Checking for escaped characters */

                setFormat(i, 2, escaped);
                i++;
            }
            else if(text[i + 1] != CONDITIONSYM)
            {
                /* Checking for normal tags */

                char lookup[3];
                struct tag_info* found = 0;