Esempio n. 1
0
    def frame(self, screen, dt):
        screen(color(0x00, 0x00, 0x00))

        root = self.file0.render(self.layout_hook)

        ngin = engine()
        ngin.guide(root.left == 50)
        ngin.guide(root.top == 50)
        root.configure(ngin)
        root.render(screen)

        self.highlight(screen, self.selection)

        # should be bound to mode
        caption, iconname = pygame.display.get_caption()
        if self.selection.buffer.title != caption:
            pygame.display.set_caption(self.file0.title, 'upi')
Esempio n. 2
0
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with EERP.  If not, see <http://www.gnu.org/licenses/>.
from essence import require_api_version
require_api_version(major=0, minor=0)
from essence import string, image, xglue, yglue, group, expando, delimit
from essence.ui import composite, color, empty

precedence = {
    'mul': 20,
    'add': 10,
}

red = color(0xFF, 0x00, 0x00)
blue = color(0x00, 0x00, 0xFF)
gray = color(0x80, 0x80, 0x80)


#def parent_precedence(sel, ):

class TestPlugin(object):
    priority = 1
    def __init__(self, editor):
        self.font = editor.font
#        self.add_spacer = editor.font('+')
#        self.mul_spacer = editor.font('*')
#        self.lparen = editor.font('(')
#        self.rparen = editor.font(')')
Esempio n. 3
0
# You should have received a copy of the GNU General Public License
# along with EERP.  If not, see <http://www.gnu.org/licenses/>.
from essence.ui import color, window, get, eventloop, empty
from essence import star, dot, element, iselement, empty_template, filled_template, copy, copyList, makelist, pull, push, holepartial, dotmarker, starmarker
from essence.document import dotmarker, starmarker
from essence.layout import string, image, xglue, yglue, group, expando, engine
from essence.buffer import Buffer
from essence.selection import Selection
from essence.pluginmanager import default_plugin_directory, load_all_plugins
from essence.util import delimit
from random import randint, choice
from sys import argv, exit
from pygame import scrap
import os

black = color(0x00, 0x00, 0x00)
red = color(0xFF, 0x00, 0x00)
yellow = color(0xFF, 0xFF, 0x00)
green = color(0x00, 0xFF, 0x00)
cyan = color(0x00, 0xFF, 0xFF)
blue = color(0x00, 0x00, 0xFF)
white = color(0xFF, 0xFF, 0xFF)
gray = color(0x80, 0x80, 0x80)
dark_gray = color(0x10, 0x10, 0x10)
light_gray = color(0xE0, 0xE0, 0xE0)

black = color(0x00, 0x00, 0x00)
dark_gray = color(0x20, 0x20, 0x10)
#dark_gray = color(0x10, 0x10, 0x10)
white = color(0xFF, 0xFF, 0xFF)
transparent_white = color(0xFF, 0xFF, 0xFF, 0x80)
Esempio n. 4
0
# You should have received a copy of the GNU General Public License
# along with EERP.  If not, see <http://www.gnu.org/licenses/>.
from essence import require_api_version
require_api_version(major=3, minor=0)
from essence import string, image, xglue, yglue, group, expando, delimit, isstring, push
from essence.ui import composite, color, empty
from essence import empty_template, dot, star

operator = dict(
    mul = 20, add = 10, sub = 10, let = 1, set = 1, equal = 1,
)
operator_symbol = dict(
    mul = '*', add = '+', sub = '-', let = '=', set = ":=", equal = '==',
)

orange = color(0xff, 0x80, 0x00)
gray = color(0x80, 0x80, 0x80)
blue = color(0, 0, 0xff)
dark = color(0x70, 0x70, 0x70)

purple = color(0xFF, 0x80, 0xFF)


class CoffeeSipper(object):
    priority = 1
    def __init__(self, editor):
        self.parens = (
            editor.font('(').mul(gray),
            editor.font(')').mul(gray),
        )
    def wrap(self, parent, this, data):