+++ /dev/null
-Plain English Copyright Notice
-
-This file is not intended to be the actual License. The reason this file
-exists is that we here are programmers and engineers. We aren't lawyers. We
-provide licenses that we THINK say the right things, but we have our own
-intentions at heart. This is a plain-english explanation of what those
-intentions are, and if you follow them you will be within the "spirit" of
-the license.
-
-The intent is for us to enjoy writing software that is useful to us (the
-AUTHORS) and allow others to use it freely and also benefit from the work we
-put into making it. We don't want to restrict others using it. They should
-not *HAVE* to make the source code of the applications they write that
-simply link to these libraries (be that statically or dynamically), or for
-them to be limited as to what license they choose to use (be it open, closed
-or anything else). But we would like to know you are using these libraries.
-We simply would like to know that it has been useful to someone. This is why
-we ask for acknowledgement of some sort.
-
-You can do what you want with the source of this software - it doesn't
-matter. We still have it here for ourselves and it is open and free to use
-and download and play with. It can't be taken away. We don't really mind what
-you do with the source to your software. We would simply like to know that
-you are using it - especially if it makes it to a commerical product. If you
-simply e-mail all the AUTHORS (see COPYING and AUTHORS files) telling us, and
-then make sure you include a paragraph or page in the manual for the product
-with the copyright notice and state that you used this software, we will be
-very happy. If you want to contribute back modifications and fixes you may have
-made we will welcome those too with open arms (generally). If you want help
-with changes needed, ports needed or features to be added, arrangements can
-be easily made with some dialogue.
-
-Carsten Haitzler <raster@rasterman.com>
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
-AC_INIT([edje], [v_ver.beta2], [enlightenment-devel@lists.sourceforge.net])
+AC_INIT([edje], [v_ver.beta3], [enlightenment-devel@lists.sourceforge.net])
AC_PREREQ([2.52])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
+++ /dev/null
-" Vimball Archiver by Charles E. Campbell, Jr., Ph.D.
-UseVimball
-finish
-ftplugin/edc.vim [[[1
-24
-" Vim filetype plugin file
-" Language: EDC
-" Maintainer: Viktor Kojouharov
-" Latest Revision: 2006-10-29
-
-if exists("b:did_ftplugin")
- finish
-endif
-let b:did_ftplugin = 1
-
-let b:undo_ftplugin = "setl com< cms< inc< fo< efm< mp<"
-
-setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
-setlocal commentstring=/*%s*/
-setlocal formatoptions-=t formatoptions+=croql
-setlocal include=^\s*#\s*include
-setlocal efm=edje_cc:%s.\ %f:%l\ %m
-setlocal mp=edje_cc\ %
-
-if exists('&ofu')
- setlocal ofu=edccomplete#Complete
- setlocal cfu=edccomplete#Complete
-endif
-
-syntax/edc.vim [[[1
-235
-" Vim syntax file
-" Language: EDC
-" Maintainer: Viktor Kojouharov
-" Last Change: 2007 02 24
-
-" For version 5.x: Clear all syntax items
-" For version 6.x: Quit when a syntax file was already loaded
-if version < 600
- syntax clear
-elseif exists("b:current_syntax")
- finish
-endif
-
-" A bunch of useful keywords
-syn keyword edcBlock images data fonts collections group contained
-syn keyword edcBlock part parts dragable description contained
-syn keyword edcBlock text font fill origin size image contained
-syn keyword edcBlock programs program styles style contained
-syn keyword edcBlock gradient spectra spectrum contained
-syn keyword edcBlock color_classes color_class rel1 rel2 contained
-syn keyword edcBlock items item file params externals contained
-syn keyword edcBlock map rotation perspective script lua_script contained
-
-syn keyword edcLabel item name alias min max type effect contained
-syn keyword edcLabel mouse_events repeat_events clip_to contained
-syn keyword edcLabel x y z confine events scale contained
-syn keyword edcLabel ignore_flags precise_is_inside contained
-syn keyword edcLabel use_alternate_font_metrics entry_mode contained
-syn keyword edcLabel source source2 source3 source4 contained
-syn keyword edcLabel source5 source6 multiline pointer_mode contained
-syn keyword edcLabel state visible step aspect fixed middle contained
-syn keyword edcLabel aspect_preference elipsis image contained
-syn keyword edcLabel relative offset to to_x to_y contained
-syn keyword edcLabel border border_scale scale_hint color color2 color3 font size contained
-syn keyword edcLabel signal action transition in filter contained
-syn keyword edcLabel target after fit align contained
-syn keyword edcLabel text smooth inherit tag base style contained
-syn keyword edcLabel text_source color_class text_class contained
-syn keyword edcLabel spectrum angle spread normal tween contained
-syn keyword edcLabel padding prefer weight aspect_mode contained
-syn keyword edcLabel options layout position span contained
-syn keyword edcLabel homogeneous contained
-syn keyword edcLabel on perspective light perspective_on contained
-syn keyword edcLabel backface_cull alpha center focus zplane contained
-syn keyword edcLabel int double string external script_only contained
-
-syn keyword edcConstant COMP RAW LOSSY NONE ON_HOLD AUTOGRAB NOGRAB
-syn keyword edcConstant TEXT IMAGE RECT TEXTBLOCK SWALLOW GRADIENT GROUP
-syn keyword edcConstant NONE PLAIN OUTLINE SOFT_OUTLINE SHADOW
-syn keyword edcConstant SOFT_SHADOW OUTLINE_SHADOW OUTLINE_SOFT_SHADOW
-syn keyword edcConstant GLOW FAR_SHADOW FAR_SOFT_SHADOW
-syn keyword edcConstant STATE_SET ACTION_STOP SIGNAL_EMIT FOCUS_SET
-syn keyword edcConstant DRAG_VAL_SET DRAG_VAL_STEP DRAG_VAL_PAGE
-syn keyword edcConstant LINEAR SINUSOIDAL ACCELERATE DECELERATE
-syn keyword edcConstant VERTICAL HORIZONTAL BOTH BOX TABLE
-syn keyword edcConstant EDITABLE PASSWORD "default"
-
-syn keyword edcTodo contained TODO FIXME XXX
-
-syn match edcLabelMatch "\w\+:" contains=edcLabel
-syn match edcBlockMatch "\w\+\_s*{" contains=edcBlock
-syn match edcBlockMatch "\w\+\.\a"me=e-2 contains=edcBlock
-" edcCommentGroup allows adding matches for special things in comments
-syn cluster edcCommentGroup contains=edcTodo
-
-" String and Character constants
-" Highlight special characters (those which have a backslash) differently
-syn match edcSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
-syn region edcString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=edcSpecial
-syn match edcFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([diuoxXfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
-syn match edcFormat display "%%" contained
-syn region edcString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat
-
-syn match edcCharacter "L\='[^\\]'"
-syn match edcCharacter "L'[^']*'" contains=edcSpecial
-syn match edcSpecialError "L\='\\[^'\"?\\abfnrtv]'"
-syn match edcSpecialCharacter "L\='\\['\"?\\abfnrtv]'"
-syn match edcSpecialCharacter display "L\='\\\o\{1,3}'"
-syn match edcSpecialCharacter display "'\\x\x\{1,2}'"
-syn match edcSpecialCharacter display "L'\\x\x\+'"
-
-"when wanted, highlight trailing white space
-if exists("edc_space_errors")
- if !exists("edc_no_trail_space_error")
- syn match edcSpaceError display excludenl "\s\+$"
- endif
- if !exists("edc_no_tab_space_error")
- syn match edcSpaceError display " \+\t"me=e-1
- endif
-endif
-
-"catch errors caused by wrong parenthesis and brackets
-syn cluster edcParenGroup contains=edcParenError,edcIncluded,edcSpecial,edcCommentSkip,edcCommentString,edcComment2String,@edcCommentGroup,edcCommentStartError,edcUserCont,edcUserLabel,edcBitField,edcCommentSkip,edcOctalZero,edcFormat,edcNumber,edcFloat,edcOctal,edcOctalError,edcNumbersCom
-if exists("edc_no_bracket_error")
- syn region edcParen transparent start='(' end=')' contains=ALLBUT,@edcParenGroup
- syn match edcParenError display ")"
- syn match edcErrInParen display contained "[{}]"
-else
- syn region edcParen transparent start='(' end=')' contains=ALLBUT,@edcParenGroup,edcErrInBracket
- syn match edcParenError display "[\])]"
- syn match edcErrInParen display contained "[\]{}]"
- syn region edcBracket transparent start='\[' end=']' contains=ALLBUT,@edcParenGroup,edcErrInParen
- syn match edcErrInBracket display contained "[);{}]"
-endif
-
-"integer number, or floating point number without a dot and with "f".
-syn case ignore
-syn match edcNumbers display transparent "\<\d\|\.\d" contains=edcNumber,edcFloat,edcOctalError,edcOctal
-" Same, but without octal error (for comments)
-syn match edcNumbersCom display contained transparent "\<\d\|\.\d" contains=edcNumber,edcFloat,edcOctal
-syn match edcNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
-"hex number
-syn match edcNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
-" Flag the first zero of an octal number as something special
-syn match edcOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=edcOctalZero
-syn match edcOctalZero display contained "\<0"
-syn match edcFloat display contained "\d\+f"
-"floating point number, with dot, optional exponent
-syn match edcFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
-"floating point number, starting with a dot, optional exponent
-syn match edcFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
-"floating point number, without dot, with exponent
-syn match edcFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>"
-" flag an octal number with wrong digits
-syn match edcOctalError display contained "0\o*[89]\d*"
-syn case match
-
-if exists("edc_comment_strings")
- " A comment can contain edcString, edcCharacter and edcNumber.
- " But a "*/" inside a edcString in a edcComment DOES end the comment! So we
- " need to use a special type of edcString: edcCommentString, which also ends
- " on "*/", and sees a "*" at the start of the line as comment again.
- " Unfortunately this doesn't very well work for // type of comments :-(
- syntax match edcCommentSkip contained "^\s*\*\($\|\s\+\)"
- syntax region edcCommentString contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=edcSpecial,edcCommentSkip
- syntax region edcComment2String contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=edcSpecial
- syntax region edcCommentL start="//" skip="\\$" end="$" keepend contains=@edcCommentGroup,edcComment2String,edcCharacter,edcNumbersCom,edcSpaceError
- syntax region edcComment matchgroup=edcCommentStart start="/\*" matchgroup=NONE end="\*/" contains=@edcCommentGroup,edcCommentStartError,edcCommentString,edcCharacter,edcNumbersCom,edcSpaceError
-else
- syn region edcCommentL start="//" skip="\\$" end="$" keepend contains=@edcCommentGroup,edcSpaceError
- syn region edcComment matchgroup=edcCommentStart start="/\*" matchgroup=NONE end="\*/" contains=@edcCommentGroup,edcCommentStartError,edcSpaceError
-endif
-" keep a // comment separately, it terminates a preproc. conditional
-syntax match edcCommentError display "\*/"
-syntax match edcCommentStartError display "/\*"me=e-1 contained
-
-syn region edcPreCondit start="^\s*#\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=edcComment,edcCharacter,edcParenError,edcNumbers,edcCommentError,edcSpaceError
-syn match edcPreCondit display "^\s*#\s*\(else\|endif\)\>"
-syn region edcIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
-syn match edcIncluded display contained "<[^>]*>"
-syn match edcInclude display "^\s*#\s*include\>\s*["<]" contains=edcIncluded
-syn cluster edcPreProcGroup contains=edcPreCondit,edcIncluded,edcInclude,edcDefine,edcErrInParen,edcErrInBracket,edcCommentSkip,edcCommentString,edcComment2String,@edcCommentGroup,edcCommentStartError,edcParen,edcBracket,edcMulti,edcUserLabel
-syn cluster edcAlphaNum contains=edcSpecial,edcOctalZero,edcFormat,edcNumber,edcFloat,edcOctal,edcOctalError,edcNumbersCom,edcString
-syn region edcDefine start="^\s*#\s*\(define\|undef\)\>" skip="\\$" end="$" end="//"me=s-1 contains=ALLBUT,@edcPreProcGroup
-syn region edcPreProc start="^\s*#\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@edcPreProcGroup
-
-syn match edcUserLabel display "\I\i*" contained
-
-syn include @edcEmbryo syntax/embryo.vim
-unlet b:current_syntax
-syn region edcScript matchgroup=edcScriptTag start="\<script\_s*{" end="}" contains=@edcEmbryo,edcScriptTag
-syn keyword edcScriptTag contained script
-
-syn include @edcLua syntax/lua.vim
-unlet b:current_syntax
-syn region edcLuaScript matchgroup=edcLuaScriptTag start="\<lua_script\_s*{" end="}" contains=@edcLua,edcLuaScriptTag
-syn keyword edcLuaScriptTag contained script
-
-if exists("edc_minlines")
- let b:edc_minlines = edc_minlines
-else
- let b:edc_minlines = 50 " #if 0 constructs can be long
-endif
-exec "syn sync ccomment edcComment minlines=" . b:edc_minlines
-"syn sync fromstart
-
-" Define the default highlighting.
-" For version 5.7 and earlier: only when not done already
-" For version 5.8 and later: only when an item doesn't have highlighting yet
-if version >= 508 || !exists("did_edc_syn_inits")
- if version < 508
- let did_edc_syn_inits = 1
- command -nargs=+ HiLink hi link <args>
- else
- command -nargs=+ HiLink hi def link <args>
- endif
-
- HiLink edcFormat edcSpecial
- HiLink edcCommentL edcComment
- HiLink edcCommentStart edcComment
- HiLink edcLabel Label
- HiLink edcUserLabel Label
- HiLink edcConditional Conditional
- HiLink edcRepeat Repeat
- HiLink edcCharacter Character
- HiLink edcSpecialCharacter cSpecial
- HiLink edcNumber Number
- HiLink edcOctal Number
- HiLink edcOctalZero PreProc " link this to Error if you want
- HiLink edcFloat Float
- HiLink edcOctalError edcError
- HiLink edcParenError edcError
- HiLink edcErrInParen edcError
- HiLink edcErrInBracket edcError
- HiLink edcCommentError edcError
- HiLink edcCommentStartError edcError
- HiLink edcSpaceError edcError
- HiLink edcSpecialError edcError
- HiLink edcOperator Operator
- HiLink edcStructure Structure
- HiLink edcStorageClass StorageClass
- HiLink edcInclude Include
- HiLink edcPreProc PreProc
- HiLink edcDefine Macro
- HiLink edcIncluded edcString
- HiLink edcError Error
- HiLink edcBlock Function
- HiLink edcScriptTag Function
- HiLink edcLuaScriptTag Function
- HiLink edcPreCondit PreCondit
- HiLink edcConstant Constant
- HiLink edcCommentString edcString
- HiLink edcComment2String edcString
- HiLink edcCommentSkip edcComment
- HiLink edcString String
- HiLink edcComment Comment
- HiLink edcSpecial SpecialChar
- HiLink edcTodo Todo
-
- delcommand HiLink
-endif
-
-let b:current_syntax = "edc"
-
-" vim: ts=8
-indent/edc.vim [[[1
-83
-" Vim indent file
-" Language: EDC
-" Maintainer: Viktor Kojouharov
-" Latest Revision: 2007 02 24
-
-if exists("b:did_indent")
- finish
-endif
-let b:did_indent = 1
-
-setlocal indentexpr=GetEDCIndent()
-setlocal indentkeys=0{,0},!^F,o,O
-
-if exists("*GetEDCIndent")
- finish
-endif
-
-function s:prevnonblanknoncomment(lnum)
- let lnum = a:lnum
- while lnum > 1
- let lnum = prevnonblank(lnum)
- let line = getline(lnum)
- if line =~ '\*/'
- while lnum > 1 && line !~ '/\*'
- let lnum -= 1
- endwhile
- if line =~ '^\s*/\*'
- let lnum -= 1
- else
- break
- endif
- elseif line =~ '^\s*//'
- let lnum -= 1
- else
- break
- endif
- endwhile
- return lnum
-endfunction
-
-function s:count_braces(lnum, count_open)
- let n_open = 0
- let n_close = 0
- let line = getline(a:lnum)
- let pattern = '[{}]'
- let i = match(line, pattern)
- while i != -1
- if synIDattr(synID(a:lnum, i + 1, 0), 'name') !~ 'c\%(CommentL\|Comment\|StringQ\{1,2}\)'
- if line[i] == '{'
- let n_open += 1
- elseif line[i] == '}'
- if n_open > 0
- let n_open -= 1
- else
- let n_close += 1
- endif
- endif
- endif
- let i = match(line, pattern, i + 1)
- endwhile
- return a:count_open ? n_open : n_close
-endfunction
-
-function GetEDCIndent()
- let line = getline(v:lnum)
- if line =~ '^\s*\*' || line =~ '^\s*//' || line =~ '^\s*}'
- return cindent(v:lnum)
- endif
-
- let pnum = s:prevnonblanknoncomment(v:lnum - 1)
- if pnum == 0
- return 0
- endif
-
- let ind = indent(pnum) + s:count_braces(pnum, 1) * &sw
-
- let pline = getline(pnum)
- if pline =~ '}\s*$'
- let ind -= (s:count_braces(pnum, 0) - (pline =~ '^\s*}' ? 1 : 0)) * &sw
- endif
-
- return ind
-endfunction
-ftdetect/edc.vim [[[1
-3
-au BufRead,BufNewFile *.edc set filetype=edc
-au BufRead,BufNewFile *.sma set filetype=embryo
-au BufRead,BufNewFile *.embryo set filetype=embryo
-autoload/edccomplete.vim [[[1
-892
-" Vim completion script
-" Language: EDC
-" Maintainer: Viktor Kojouharov
-" Last Change: 2007 02 24
-
-function! edccomplete#Complete(findstart, base)
- if a:findstart
- " locate the start of the word
- let line = getline('.')
- let start = col('.') - 1
- let compl_begin = col('.') - 2
- let lastword = -1
- if line =~ ':' && line !~ '\.'
- while start > 0 && (line[start - 1] =~ '\k' || line[start - 1] =~ '"')
- let start -= 1
- endwhile
- else
- while start > 0
- if line[start - 1] =~ '\k'
- let start -= 1
- elseif line[start - 1] =~ '\.'
- if lastword == -1
- let lastword = start - 2
- endif
- let start -= 1
- else
- break
- endif
- endwhile
- endif
- let b:compl_context = getline('.')[0:compl_begin]
-
- if lastword == -1
- let ppe = searchpos('\.', 'bcn')
- let pps = searchpos('\w\+\.', 'bcn')
- let b:sparent = ''
- if ppe != [0, 0] && pps[0] == ppe[0] && pps[1] <= ppe[1] && pps[0] == line('.')
- let b:scontext = line[pps[1] -1 : ppe[1] - 2]
- call edccomplete#FindParent(pps[0], pps[1])
- return start
- endif
-
- let startpos = searchpair('{', '', '}', 'bnW')
- let lnum = startpos
- let line = getline(lnum)
-
- if line !~ '\a\+'
- let lnum = prevnonblank(lnum - 1)
- let line = getline(lnum)
- endif
-
- call edccomplete#FindParent(lnum, 1)
- let b:scontext = matchstr(line, '\w\+')
-
- return start
- else
- let b:scontext = line[start : lastword]
-
- return lastword + 2
- endif
- else
- " find months matching with "a:base"
- let res = []
- if exists("b:compl_context")
- let line = b:compl_context
- unlet! b:compl_context
- else
- let line = a:base
- endif
-
- if b:scontext == 'part'
- call edccomplete#AddLabel(res, line, a:base, s:partLabel)
- call edccomplete#AddStatement(res, line, a:base, s:partStatement)
- if line =~ 'type:\s*'
- call edccomplete#AddKeyword(res, a:base, s:partTypes)
- elseif line =~ 'effect:\s*'
- call edccomplete#AddKeyword(res, a:base, s:partEffects)
- elseif line =~ 'select_mode:\s*'
- call edccomplete#AddKeyword(res, a:base, s:partSelectMode)
- elseif line =~ 'ignore_flags:\s*'
- call edccomplete#AddKeyword(res, a:base, s:partIgnoreFlags)
- elseif line =~ 'pointer_mode:\s*'
- call edccomplete#AddKeyword(res, a:base, s:partPointerMode)
- elseif line =~ 'editable_mode:\s*'
- call edccomplete#AddKeyword(res, a:base, s:partEditableMode)
- endif
- if line =~ 'image:\s*".\{-}"'
- call edccomplete#AddKeyword(res, a:base, s:imageStorageMethod)
- endif
-
- elseif b:scontext == 'dragable'
- call edccomplete#AddLabel(res, line, a:base, s:dragableLabel)
-
- elseif b:scontext == 'description'
- call edccomplete#AddLabel(res, line, a:base, s:descriptionLabel)
- call edccomplete#AddStatement(res, line, a:base, s:descriptionStatement)
- if line =~ 'aspect_preference:\s*'
- call edccomplete#AddKeyword(res, a:base, s:aspectPrefTypes)
- elseif line =~ 'inherit:\s*"\?'
- call edccomplete#FindStates(res, a:base, 1)
- endif
-
- elseif b:scontext == 'rel1' || b:scontext == 'rel2'
- call edccomplete#AddLabel(res, line, a:base, s:relLabel)
- if line =~ 'to\%(_[xy]\)\?:\s*"\?'
- call edccomplete#FindNamesIn(res, a:base, 'parts')
- endif
-
- elseif b:scontext == 'map'
- call edccomplete#AddLabel(res, line, a:base, s:mapLabel)
- call edccomplete#AddStatement(res, line, a:base, s:mapStatement)
-
- elseif b:scontext == 'rotation'
- call edccomplete#AddLabel(res, line, a:base, s:rotationLabel)
-
- elseif b:scontext == 'perspective'
- call edccomplete#AddLabel(res, line, a:base, s:perspectiveLabel)
-
- elseif b:scontext == 'params'
- call edccomplete#AddLabel(res, line, a:base, s:paramsLabel)
-
- elseif b:scontext == 'image'
- call edccomplete#AddLabel(res, line, a:base, s:imageLabel)
- if line =~ 'image:\s*".\{-}"'
- call edccomplete#AddKeyword(res, a:base, s:imageStorageMethod)
- elseif line =~ 'middle:\s*'
- call edccomplete#AddKeyword(res, a:base, s:imageMiddleTypes)
- elseif line =~ 'scale_hint:\s*'
- call edccomplete#AddKeyword(res, a:base, s:imageScaleHint)
- endif
-
- elseif b:scontext == 'fill'
- call edccomplete#AddLabel(res, line, a:base, s:fillLabel)
- call edccomplete#AddStatement(res, line, a:base, s:fillStatement)
- if line =~ 'type:\s*'
- call edccomplete#AddKeyword(res, a:base, s:fillTypes)
- endif
-
- elseif b:scontext == 'origin' || b:scontext == 'size'
- call edccomplete#AddLabel(res, line, a:base, s:fillInnerStatement)
-
- elseif b:scontext == 'text'
- call edccomplete#AddLabel(res, line, a:base, s:textLabel)
- call edccomplete#AddStatement(res, line, a:base, s:textStatement)
-
- elseif b:scontext == 'program'
- call edccomplete#AddLabel(res, line, a:base, s:programLabel)
- call edccomplete#AddStatement(res, line, a:base, s:programStatement)
- if line =~ 'transition:\s*'
- call edccomplete#AddKeyword(res, a:base, s:transitionTypes)
- elseif line =~ 'STATE_SET\s*"\?'
- call edccomplete#FindStates(res, a:base, 0)
- elseif line =~ 'action:\s*'
- call edccomplete#AddKeyword(res, a:base, s:actionTypes)
- elseif line =~ 'target:\s*"\?'
- call edccomplete#FindNamesIn(res, a:base, 'parts')
- elseif line =~ 'after:\s*"\?'
- call edccomplete#FindNamesIn(res, a:base, 'programs')
- endif
-
- elseif b:scontext == 'programs'
- call edccomplete#AddLabel(res, line, a:base, s:programsLabel)
- call edccomplete#AddStatement(res, line, a:base, s:programsStatement)
- if line =~ 'image:\s*".\{-}"'
- call edccomplete#AddKeyword(res, a:base, s:imageStorageMethod)
- endif
-
- elseif b:scontext == 'box' && b:sparent == 'part'
- call edccomplete#AddStatement(res, line, a:base, s:boxStatement)
-
- elseif b:scontext == 'items'
- call edccomplete#AddStatement(res, line, a:base, s:boxItemsStatement)
-
- elseif b:scontext == 'item'
- call edccomplete#AddLabel(res, line, a:base, s:boxItemLabel)
- if line =~ 'type:\s*'
- call edccomplete#AddKeyword(res, a:base, s:boxItemTypes)
- elseif line =~ 'aspect_mode:\s*"\?'
- call edccomplete#AddKeyword(res, a:base, s:boxItemAspectMode)
- endif
-
- elseif b:scontext == 'box' && b:sparent == 'description'
- call edccomplete#AddLabel(res, line, a:base, s:boxDescLabel)
- if line =~ 'layout:\s*'
- call edccomplete#AddKeyword(res, a:base, s:boxLayout)
- endif
-
- elseif b:scontext == 'table' && b:sparent == 'description'
- call edccomplete#AddLabel(res, line, a:base, s:tableDescLabel)
- if line =~ 'homogeneous:\s*'
- call edccomplete#AddKeyword(res, a:base, s:tableHomogeneousMode)
- endif
-
- elseif b:scontext == 'group'
- call edccomplete#AddLabel(res, line, a:base, s:groupLabel)
- call edccomplete#AddStatement(res, line, a:base, s:groupStatement)
- if line =~ 'image:\s*".\{-}"'
- call edccomplete#AddKeyword(res, a:base, s:imageStorageMethod)
- endif
-
- elseif b:scontext == 'parts'
- call edccomplete#AddLabel(res, line, a:base, s:partsLabel)
- call edccomplete#AddStatement(res, line, a:base, s:partsStatement)
- if line =~ 'image:\s*".\{-}"'
- call edccomplete#AddKeyword(res, a:base, s:imageStorageMethod)
- endif
-
- elseif b:scontext == 'data'
- call edccomplete#AddLabel(res, line, a:base, s:dataLabel)
-
- elseif b:scontext == 'fonts'
- call edccomplete#AddLabel(res, line, a:base, s:fontsLabel)
-
- elseif b:scontext == 'spectra'
- call edccomplete#AddStatement(res, line, a:base, s:spectraStatement)
-
- elseif b:scontext == 'spectrum'
- call edccomplete#AddLabel(res, line, a:base, s:spectrumLabel)
-
- elseif b:scontext == 'gradient'
- call edccomplete#AddLabel(res, line, a:base, s:gradientLabel)
- call edccomplete#AddStatement(res, line, a:base, s:gradientStatement)
- if line =~ 'type:\s*'
- call edccomplete#AddKeyword(res, a:base, s:gradientTypes)
- endif
-
- elseif b:scontext == 'styles'
- call edccomplete#AddStatement(res, line, a:base, s:stylesStatement)
-
- elseif b:scontext == 'style'
- call edccomplete#AddLabel(res, line, a:base, s:styleLabel)
-
- elseif b:scontext == 'color_classes'
- call edccomplete#AddStatement(res, line, a:base, s:color_classesStatement)
-
- elseif b:scontext == 'color_class'
- call edccomplete#AddLabel(res, line, a:base, s:color_classLabel)
-
- elseif b:scontext == 'images'
- call edccomplete#AddLabel(res, line, a:base, s:imagesLabel)
- if line =~ 'image:\s*".\{-}"'
- call edccomplete#AddKeyword(res, a:base, s:imageStorageMethod)
- endif
-
- elseif b:scontext == 'collections'
- call edccomplete#AddLabel(res, line, a:base, s:collectionsLabel)
- call edccomplete#AddStatement(res, line, a:base, s:collectionsStatement)
- if line =~ 'image:\s*".\{-}"'
- call edccomplete#AddKeyword(res, a:base, s:imageStorageMethod)
- endif
-
- elseif b:scontext == 'externals'
- call edccomplete#AddLabel(res, line, a:base, s:externalsLabel)
-
- elseif strlen(b:scontext) == 0
- call edccomplete#AddStatement(res, line, a:base, s:topStatement)
- endif
-
- unlet! b:scontext
-
- return res
- endif
-endfunction
-
-function! edccomplete#AddLabel(res, line, base, label)
- if a:line =~ ':'
- return
- endif
-
- for m in sort(keys(a:label))
- if m =~ '^' . a:base
- call add(a:res, {'word': m . ':', 'menu': a:label[m]})
- endif
- endfor
-endfunction
-
-function! edccomplete#AddKeyword(res, base, label)
- for m in sort(keys(a:label))
- if m =~ '^' . a:base
- call add(a:res, {'word': m, 'menu': a:label[m]})
- endif
- endfor
-endfunction
-
-function! edccomplete#AddStatement(res, line, base, statement)
- if a:line =~ ':'
- return
- endif
-
- for m in sort(a:statement)
- if m =~ '^' . a:base
- call add(a:res, m . ' {')
- endif
- endfor
-endfunction
-
-function! edccomplete#FindStates(res, base, in_part)
- let curpos = getpos('.')
- call remove(curpos, 0, 0)
-
- let states_list = []
- if a:in_part == 1 " in the current part only
- let part_start = search('^[ \t}]*\<part\>[ \t{]*$', 'bnW')
- if part_start != 0 " found it
- let line = getline(part_start)
- if line !~ '{'
- let part_start = nextnonblank(part_start)
- endif
- call cursor(part_start, 0)
- let part_end = searchpair('{', '', '}', 'nW')
- endif
- else " in the current parts group
- let part_start = search('^[ \t}]*\<parts\>[ \t{]*$', 'bnW')
- if part_start != 0 " found it
- let line = getline(part_start)
- if line !~ '{'
- let part_start = nextnonblank(part_start)
- endif
- call cursor(part_start, 0)
- let part_end = searchpair('{', '', '}', 'nW')
- endif
- endif
-
- let state_num = search('\%(state:\s*\)"\w\+"', 'W', part_end)
- while state_num
- let state = matchstr(getline(state_num), '\%(state:\s*\)\@<="\w\+"')
- call extend(states_list, [state])
- let state_num = search('\%(state:\s*\)"\w\+"', 'W', part_end)
- endwhile
- call cursor(curpos)
-
- for m in sort(states_list)
- if m =~ '^' . a:base
- call add(a:res, m)
- endif
- endfor
-endfunction
-
-function! edccomplete#FindNamesIn(res, base, str)
- let curpos = getpos('.')
- call remove(curpos, 0, 0)
-
- let names_list = []
- let part_start = search('^[ \t}]*\<' . a:str . '\>[ \t{]*$', 'bnW')
- if part_start != 0 " found it
- let line = getline(part_start)
- if line !~ '{'
- let part_start = nextnonblank(part_start)
- endif
- call cursor(part_start, 0)
- let part_end = searchpair('{', '', '}', 'nW')
- endif
-
- let name_num = search('\%(name:\s*\)"\w\+"', 'W', part_end)
- while name_num
- let name = matchstr(getline(name_num), '\%(name:\s*\)\@<="\w\+"')
- call extend(names_list, [name])
- let name_num = search('\%(name:\s*\)"\w\+"', 'W', part_end)
- endwhile
- call cursor(curpos)
-
- for m in sort(names_list)
- if m =~ '^' . a:base
- call add(a:res, m)
- endif
- endfor
-endfunction
-
-function! edccomplete#FindParent(lnum, cnum)
- call setpos('.', [0, a:lnum, a:cnum, 0])
- let ppe = searchpos('\.', 'bcn')
- let pps = searchpos('\w\+\.', 'bcn')
- if ppe != [0, 0] && pps[0] == ppe[0] && pps[1] <= ppe[1] && pps[0] == line('.')
- let b:sparent = line[pps[1] -1 : ppe[1] - 2]
- return
- endif
-
- let startpos = searchpair('{', '', '}', 'bnW')
- let lnum = startpos
- let line = getline(lnum)
-
- if line !~ '\a\+'
- let line = getline(prevnonblank(lnum - 1))
- endif
-
- let b:sparent = matchstr(line, '\w\+')
-endfunction
-
-" part
-let s:partLabel = {
- \ 'name': '"name"',
- \ 'type': 'keyword',
- \ 'effect': 'keyword',
- \ 'clip_to': '"part_name"',
- \ 'scale': '0-1',
- \ 'mouse_events': '0-1',
- \ 'repeat_events': '0-1',
- \ 'ignore_flags': 'keyword ...',
- \ 'pointer_mode': 'keyword',
- \ 'select_mode': 'keyword',
- \ 'precise_is_inside': '0-1',
- \ 'use_alternate_font_metrics': '0-1',
- \ 'image': '"filename" keyword',
- \ 'font': '"filename" "name"',
- \ 'entry_mode': 'keyword',
- \ 'multiline': '0-1 (TEXTBLOCK only)',
- \ 'source': '"group_name" (GROUP or TEXTBLOCK only)',
- \ 'source2': '"group_name" (TEXTBLOCK only)',
- \ 'source3': '"group_name" (TEXTBLOCK only)',
- \ 'source4': '"group_name" (TEXTBLOCK only)',
- \ 'source5': '"group_name" (TEXTBLOCK only)',
- \ 'source6': '"group_name" (TEXTBLOCK only)',
- \ 'source7': '"group_name" (GROUP or TEXTBLOCK only)',
- \ }
-let s:partStatement = [
- \ 'dragable',
- \ 'images',
- \ 'fonts',
- \ 'description',
- \ 'styles',
- \ 'color_classes',
- \ 'program',
- \ 'programs',
- \ 'box',
- \ ]
-
-" dragable
-let s:dragableLabel = {
- \ 'x': '0-1 int int',
- \ 'y': '0-1 int int',
- \ 'confine': '"part_name"',
- \ 'events': '"draggable_part_name"',
- \ }
-
-" description
-let s:descriptionLabel = {
- \ 'state': '"name" index (float)',
- \ 'inherit': '"description" index (float)',
- \ 'visible': '0-1',
- \ 'align': 'x y (float)',
- \ 'fixed': 'width height (0-1)',
- \ 'min': 'width height (int)',
- \ 'max': 'width height (int)',
- \ 'step': 'width height (int)',
- \ 'aspect': 'min max (float)',
- \ 'aspect_preference': 'keyword',
- \ 'color_class': '"name"',
- \ 'color': '0-255 0-255 0-255 0-255',
- \ 'color2': '0-255 0-255 0-255 0-255',
- \ 'color3': '0-255 0-255 0-255 0-255',
- \ 'font': '"filename" "name"',
- \ }
-let s:descriptionStatement = [
- \ 'rel1',
- \ 'rel2',
- \ 'image',
- \ 'fill',
- \ 'text',
- \ 'gradient',
- \ 'images',
- \ 'fonts',
- \ 'styles',
- \ 'color_classes',
- \ 'program',
- \ 'programs',
- \ 'box',
- \ 'map',
- \ ]
-
-" rel
-let s:relLabel = {
- \ 'relative': 'x y (float)',
- \ 'offset': 'x y (int)',
- \ 'to': '"part_name"',
- \ 'to_x': '"part_name"',
- \ 'to_y': '"part_name"',
- \ }
-" map
-let s:mapLabel = {
- \ 'on': '0-1',
- \ 'perspective': '"part_name"',
- \ 'light': '"part_name"',
- \ 'smooth': '0-1',
- \ 'pespective_on':'0-1',
- \ 'backface_cull':'0-1',
- \ 'alpha': '0-1',
- \ }
-let s:mapStatement = [
- \ 'rotation',
- \ ]
-
-let s:rotationLabel = {
- \ 'center': '"part_name"',
- \ 'x': '"degrees (float)"',
- \ 'y': '"degrees (float)"',
- \ 'z': '"degrees (float)"',
- \ }
-
-" params
-let s:paramsLabel = {
- \ 'int': '"name" int',
- \ 'double': '"name" double',
- \ 'string': '"name" "string"',
- \ }
-
-" perspective
-let s:perspectiveLabel = {
- \ 'zplane': 'int',
- \ 'focal': 'int',
- \ }
-
-
-" image
-let s:imageLabel = {
- \ 'image': '"filename" keyword',
- \ 'normal': '"filename"',
- \ 'tween': '"filename"',
- \ 'border': 'left right top bottom (int)',
- \ 'middle': 'keyword',
- \ 'border_scale': '0-1',
- \ 'scale_hint': 'keyword',
- \ }
-
-" fill
-let s:fillLabel = {
- \ 'smooth': '0-1',
- \ 'angle': '0-360 (GRADIENT)',
- \ 'spread': '0-1',
- \ 'type': 'keyword',
- \ }
-let s:fillStatement = [
- \ 'origin',
- \ 'size',
- \ ]
-" fill origin/size
-let s:fillInnerStatement = {
- \ 'relative': 'width height (float)',
- \ 'offset': 'x y (int)',
- \ }
-" fill types
-let s:fillTypes = {
- \ 'SCALE': '',
- \ 'TILE': '',
- \ }
-
-" text
-let s:textLabel = {
- \ 'text': '"string"',
- \ 'font': '"font_name"',
- \ 'size': 'size (int)',
- \ 'text_class': '"class_name"',
- \ 'fit': 'x y (0-1)',
- \ 'min': 'x y (0-1)',
- \ 'max': 'x y (0-1)',
- \ 'align': 'x y (float)',
- \ 'source': '"part_name"',
- \ 'text_source': '"text_part_name"',
- \ 'style': '"style_name"',
- \ 'elipsis': '0.0-1.0',
- \ 'repch': '"string" (PASSWORD mode)',
- \ }
-let s:textStatement = [
- \ 'fonts',
- \ ]
-
-" program
-let s:programLabel = {
- \ 'name': '"name"',
- \ 'signal': '"signal_name"',
- \ 'source': '"part_name"',
- \ 'action': 'keyword ...',
- \ 'transition': 'keyword time (float)',
- \ 'filter': '"part_name" "state_name"',
- \ 'in': 'from range (float)',
- \ 'target': '"part_name"',
- \ 'after': '"program_name"',
- \ }
-let s:programStatement = [
- \ 'script',
- \ 'lua_script',
- \ ]
-
-
-" programs
-let s:programsLabel = {
- \ 'image': '"filename" keyword',
- \ 'font': '"filename" "name"',
- \ }
-let s:programsStatement = [
- \ 'images',
- \ 'fonts',
- \ 'program',
- \ ]
-
-" box and table
-let s:boxStatement = [
- \ 'items',
- \ ]
-let s:boxItemsStatement = [
- \ 'item',
- \ ]
-let s:boxItemLabel = {
- \ 'type': 'keyword',
- \ 'name': '"name"',
- \ 'source': '"group_name"',
- \ 'min': 'width height (int)',
- \ 'prefer': 'width height (int)',
- \ 'max': 'width height (int)',
- \ 'padding': 'left right top bottom (int)',
- \ 'align': 'x y (float)',
- \ 'weight': 'x y (float)',
- \ 'aspect': 'w h (float)',
- \ 'aspect_mode': 'keyword',
- \ 'options': '"extra options"',
- \ }
-let s:boxDescLabel = {
- \ 'layout': '"string" ["string"]',
- \ 'align': 'float float',
- \ 'padding': 'int int',
- \ }
-let s:tableItemLabel = {
- \ 'position': 'col row (int)',
- \ 'span': 'col row (int)',
- \ }
-let s:tableDescLabel = {
- \ 'homogeneous': 'keyword',
- \ 'align': 'float float',
- \ 'padding': 'int int',
- \ }
-
-" group
-let s:groupLabel = {
- \ 'name': '"name"',
- \ 'alias': '"alias"',
- \ 'min': 'width height',
- \ 'max': 'width height',
- \ 'image': '"filename" keyword',
- \ 'font': '"filename" "name"',
- \ 'script_only': '0-1',
- \ }
-let s:groupStatement = [
- \ 'data',
- \ 'script',
- \ 'lua_script',
- \ 'parts',
- \ 'images',
- \ 'fonts',
- \ 'styles',
- \ 'color_classes',
- \ 'program',
- \ 'programs',
- \ 'externals',
- \ ]
-
-" parts
-let s:partsStatement = [
- \ 'images',
- \ 'fonts',
- \ 'part',
- \ 'styles',
- \ 'color_classes',
- \ 'program',
- \ 'programs',
- \ ]
-let s:partsLabel = {
- \ 'image': '"filename" keyword',
- \ 'font': '"filename" "name"',
- \ }
-
-" data
-let s:dataLabel = {
- \ 'item': '"key" "value"',
- \ 'file': '"key" "filename"',
- \ }
-
-" fonts
-let s:fontsLabel = {
- \ 'font': '"filename" "name"',
- \ }
-
-"images
-let s:imagesLabel = {
- \ 'image': '"filename" keyword',
- \ }
-
-"collections
-let s:collectionsStatement = [
- \ 'group',
- \ 'images',
- \ 'fonts',
- \ 'styles',
- \ 'color_classes',
- \ 'externals',
- \ ]
-let s:collectionsLabel = {
- \ 'image': '"filename" keyword',
- \ 'font': '"filename" "name"',
- \ }
-
-" externals
-let s:externalsLabel = {
- \ 'external': '"name"',
- \ }
-
-" spectra
-let s:spectraStatement = [
- \ 'spectrum',
- \ ]
-" spectrum
-let s:spectrumLabel = {
- \ 'name': '"name"',
- \ 'color': '0-255 0-255 0-255 0-255',
- \ }
-" gradient
-let s:gradientLabel = {
- \ 'type': '"keyword"',
- \ 'spectrum': '"spectrum_name"',
- \ }
-let s:gradientStatement = [
- \ 'rel1',
- \ 'rel2',
- \ ]
-" gradient types
-let s:gradientTypes = {
- \ '"linear"': '',
- \ '"radial"': '',
- \ '"rectangular"': '',
- \ '"angular"': '',
- \ '"sinusoidal"': '',
- \ }
-
-" styles
-let s:stylesStatement = [
- \ 'style',
- \ ]
-" style
-let s:styleLabel = {
- \ 'name': '"name"',
- \ 'base': '".. default style properties .."',
- \ 'tag': '"tagname" "style properties"',
- \ }
-
-" color_classes
-let s:color_classesStatement = [
- \ 'color_class',
- \ ]
-" color_class
-let s:color_classLabel = {
- \ 'name': '"name"',
- \ 'color': '0-255 0-255 0-255 0-255',
- \ 'color2': '0-255 0-255 0-255 0-255',
- \ 'color3': '0-255 0-255 0-255 0-255',
- \ }
-
-" toplevel
-let s:topStatement = [
- \ 'fonts',
- \ 'images',
- \ 'data',
- \ 'collections',
- \ 'spectra',
- \ 'styles',
- \ 'color_classes',
- \ 'externals',
- \ ]
-
-" images image storage method
-let s:imageStorageMethod = {
- \ 'COMP': '',
- \ 'RAW': '',
- \ 'USER': '',
- \ 'LOSSY': '0-100',
- \ }
-" image middle types
-let s:imageMiddleTypes = {
- \ '0': '',
- \ '1': '',
- \ 'NONE': '',
- \ 'DEFAULT': '',
- \ 'SOLID': '',
- \ }
-" image scale hint
-let s:imageScaleHint = {
- \ '0': '',
- \ 'NONE': '',
- \ 'DYNAMIC': '',
- \ 'STATIC': '',
- \ }
-
-" part types
-let s:partTypes = {
- \ 'TEXT': '',
- \ 'IMAGE': '',
- \ 'RECT': '',
- \ 'TEXTBLOCK': '',
- \ 'SWALLOW': '',
- \ 'GRADIENT': '',
- \ 'GROUP': '',
- \ 'BOX': '',
- \ 'TABLE': '',
- \ 'EXTERNAL': '',
- \ }
-" part effects
-let s:partEffects = {
- \ 'NONE': '',
- \ 'PLAIN': '',
- \ 'OUTLINE': '',
- \ 'SOFT_OUTLINE': '',
- \ 'SHADOW': '',
- \ 'SOFT_SHADOW': '',
- \ 'OUTLINE_SHADOW': '',
- \ 'OUTLINE_SOFT_SHADOW': '',
- \ 'FAR_SHADOW': '',
- \ 'FAR_SOFT_SHADOW': '',
- \ 'GLOW': '',
- \ }
-" part select_mode
-let s:partSelectMode = {
- \ 'DEFAULT': '',
- \ 'EXPLICIT': '',
- \ }
-" part ignore flags
-let s:partIgnoreFlags = {
- \ 'NONE': '',
- \ 'ON_HOLD': '',
- \ }
-" part pointer mode
-let s:partPointerMode = {
- \ 'AUTOGRAB': '',
- \ 'NOGRAB': '',
- \ }
-" part editable_mode
-let s:partEditableMode = {
- \ 'NONE': '',
- \ 'PLAIN': '',
- \ 'EDITABLE': '',
- \ 'PASSWORD': '',
- \ }
-
-" aspect_preference types
-let s:aspectPrefTypes = {
- \ 'VERTICAL': '',
- \ 'HORIZONTAL': '',
- \ 'BOTH': '',
- \ }
-
-" program transition types
-let s:transitionTypes = {
- \ 'LINEAR': '0.0 - 1.0',
- \ 'SINUSOIDAL': '0.0 - 1.0',
- \ 'ACCELERATE': '0.0 - 1.0',
- \ 'DECELERATE': '0.0 - 1.0',
- \ }
-" program action types
-let s:actionTypes = {
- \ 'STATE_SET': '"string" "0.0 - 1.0"',
- \ 'ACTION_STOP': '',
- \ 'SIGNAL_EMIT': '"string" "string"',
- \ 'DRAG_VAL_SET': 'float float',
- \ 'DRAG_VAL_STEP': 'float float',
- \ 'DRAG_VAL_PAGE': 'float float',
- \ 'FOCUS_SET': '',
- \ }
-" box item types
-let s:boxItemTypes = {
- \ 'GROUP': '',
- \ }
-" box item aspect mode
-let s:boxItemAspectMode = {
- \ 'NONE': '',
- \ 'NEITHER': '',
- \ 'VERTICAL': '',
- \ 'HORIZONTAL': '',
- \ 'BOTH': '',
- \ }
-" box layout
-let s:boxLayout = {
- \ '"horizontal"': '',
- \ '"horizontal_homogeneous"': '',
- \ '"horizontal_max"': '',
- \ '"horizontal_flow"': '',
- \ '"vertical"': '',
- \ '"vertical_homogeneous"': '',
- \ '"vertical_max"': '',
- \ '"vertical_flow"': '',
- \ '"stack"': '',
- \ }
-" table homogeneous mode
-let s:tableHomogeneousMode = {
- \ 'NONE': '',
- \ 'TABLE': '',
- \ 'ITEM': '',
- \ }
-syntax/embryo.vim [[[1
-195
-" Vim syntax file
-" Language: Embryo
-" Maintainer: Viktor Kojouharov
-" Last Change: 2006 10 06
-
-" For version 5.x: Clear all syntax items
-" For version 6.x: Quit when a syntax file was already loaded
-if version < 600
- syntax clear
-elseif exists("b:current_syntax")
- finish
-endif
-
-" A bunch of useful keywords
-syn keyword embryoConditional if else switch
-syn keyword embryoRepeat while for do in
-syn keyword embryoBranch break continue
-syn keyword embryoOperator new
-syn keyword embryoType Float State_Param Msg_Type enum
-syn keyword embryoStatement return with native stock forward
-syn keyword embryoLabel case default
-syn keyword embryoReserved public
-syn keyword embryoEdjeKey PART PROGRAM
-
-syn keyword embryoTodo contained TODO FIXME XXX
-
-" embryoCommentGroup allows adding matches for special things in comments
-syn cluster embryoCommentGroup contains=embryoTodo
-
-" String and Character constants
-" Highlight special characters (those which have a backslash) differently
-syn match embryoSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
-syn region embryoString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=embryoSpecial
-syn match embryoFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([diuoxXfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
-syn match embryoFormat display "%%" contained
-syn region embryoString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat
-
-syn match embryoCharacter "L\='[^\\]'"
-syn match embryoCharacter "L'[^']*'" contains=embryoSpecial
-syn match embryoSpecialError "L\='\\[^'\"?\\abfnrtv]'"
-syn match embryoSpecialCharacter "L\='\\['\"?\\abfnrtv]'"
-syn match embryoSpecialCharacter display "L\='\\\o\{1,3}'"
-syn match embryoSpecialCharacter display "'\\x\x\{1,2}'"
-syn match embryoSpecialCharacter display "L'\\x\x\+'"
-
-"when wanted, highlight trailing white space
-if exists("embryo_space_errors")
- if !exists("embryo_no_trail_space_error")
- syn match embryoSpaceError display excludenl "\s\+$"
- endif
- if !exists("embryo_no_tab_space_error")
- syn match embryoSpaceError display " \+\t"me=e-1
- endif
-endif
-
-"catch errors caused by wrong parenthesis and brackets
-syn cluster embryoParenGroup contains=embryoParenError,embryoIncluded,embryoSpecial,embryoCommentSkip,embryoCommentString,embryoComment2String,@embryoCommentGroup,embryoCommentStartErr,embryoUserCont,embryoUserLabel,embryoBitField,embryoCommentSkip,embryoOctalZero,embryoFormat,embryoNumber,embryoFloat,embryoOctal,embryoOctalError,embryoNumbersCom
-if exists("embryo_no_bracket_error")
- syn region embryoParen transparent start='(' end=')' contains=ALLBUT,@embryoParenGroup
- syn match embryoParenError display ")"
- syn match embryoErrInParen display contained "[{}]"
-else
- syn region embryoParen transparent start='(' end=')' contains=ALLBUT,@embryoParenGroup,embryoErrInBracket
- syn match embryoParenError display "[\])]"
- syn match embryoErrInParen display contained "[\]{}]"
- syn region embryoBracket transparent start='\[' end=']' contains=ALLBUT,@embryoParenGroup,embryoErrInParen
- syn match embryoErrInBracket display contained "[);{}]"
-endif
-
-syn region embryoBrace start='{' end='}' transparent keepend
-"integer number, or floating point number without a dot and with "f".
-syn case ignore
-syn match embryoNumbers display transparent "\<\d\|\.\d" contains=embryoNumber,embryoFloat,embryoOctalError,embryoOctal
-" Same, but without octal error (for comments)
-syn match embryoNumbersCom display contained transparent "\<\d\|\.\d" contains=embryoNumber,embryoFloat,embryoOctal
-syn match embryoNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
-"hex number
-syn match embryoNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
-" Flag the first zero of an octal number as something special
-syn match embryoOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=embryoOctalZero
-syn match embryoOctalZero display contained "\<0"
-syn match embryoFloat display contained "\d\+f"
-"floating point number, with dot, optional exponent
-syn match embryoFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
-"floating point number, starting with a dot, optional exponent
-syn match embryoFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
-"floating point number, without dot, with exponent
-syn match embryoFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>"
-" flag an octal number with wrong digits
-syn match embryoOctalError display contained "0\o*[89]\d*"
-syn case match
-
-if exists("embryo_comment_strings")
- " A comment can contain embryoString, embryoCharacter and embryoNumber.
- " But a "*/" inside a embryoString in a embryoComment DOES end the comment! So we
- " need to use a special type of embryoString: embryoCommentString, which also ends
- " on "*/", and sees a "*" at the start of the line as comment again.
- " Unfortunately this doesn't very well work for // type of comments :-(
- syntax match embryoCommentSkip contained "^\s*\*\($\|\s\+\)"
- syntax region embryoCommentString contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=embryoSpecial,embryoCommentSkip
- syntax region embryoComment2String contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=embryoSpecial
- syntax region embryoCommentL start="//" skip="\\$" end="$" keepend contains=@embryoCommentGroup,embryoComment2String,embryoCharacter,embryoNumbersCom,embryoSpaceError
- syntax region embryoComment matchgroup=embryoCommentStart start="/\*" matchgroup=NONE end="\*/" contains=@embryoCommentGroup,embryoCommentStartErr,embryoCommentString,embryoCharacter,embryoNumbersCom,embryoSpaceError
-else
- syn region embryoCommentL start="//" skip="\\$" end="$" keepend contains=@embryoCommentGroup,embryoSpaceError
- syn region embryoComment matchgroup=embryoCommentStart start="/\*" matchgroup=NONE end="\*/" contains=@embryoCommentGroup,embryoCommentStartErr,embryoSpaceError
-endif
-" keep a // comment separately, it terminates a preproc. conditional
-syntax match embryoCommentError display "\*/"
-syntax match embryoCommentStartErr display "/\*"me=e-1 contained
-
-syn region embryoPreCondit start="^\s*#\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=embryoComment,embryoCharacter,embryoParenError,embryoNumbers,embryoCommentError,embryoSpaceError
-syn match embryoPreCondit display "^\s*#\s*\(else\|endif\)\>"
-syn region embryoIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
-syn match embryoIncluded display contained "<[^>]*>"
-syn match embryoInclude display "^\s*#\s*include\>\s*["<]" contains=embryoIncluded
-syn cluster embryoPreProcGroup contains=embryoPreCondit,embryoIncluded,embryoInclude,embryoDefine,embryoErrInParen,embryoErrInBracket,embryoCommentSkip,embryoCommentString,embryoComment2String,@embryoCommentGroup,embryoCommentStartErr,embryoParen,embryoBracket,embryoMulti,embryoUserLabel
-syn cluster embryoAlphaNum contains=embryoSpecial,embryoOctalZero,embryoFormat,embryoNumber,embryoFloat,embryoOctal,embryoOctalError,embryoNumbersCom,embryoString
-syn region embryoDefine start="^\s*#\s*\(define\|undef\)\>" skip="\\$" end="$" end="//"me=s-1 contains=ALLBUT,@embryoPreProcGroup
-syn region embryoPreProc start="^\s*#\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@embryoPreProcGroup
-
-syn match embryoUserLabel display "\I\i*" contained
-
-syn match embryoFunctionName "\h\w*\s*\%((\@=\)"
-
-if exists("embryo_minlines")
- let b:embryo_minlines = embryo_minlines
-else
- let b:embryo_minlines = 50 " #if 0 constructs can be long
-endif
-exec "syn sync ccomment embryoComment minlines=" . b:embryo_minlines
-"syn sync fromstart
-
-" Define the default highlighting.
-" For version 5.7 and earlier: only when not done already
-" For version 5.8 and later: only when an item doesn't have highlighting yet
-if version >= 508 || !exists("did_embryo_syn_inits")
- if version < 508
- let did_embryo_syn_inits = 1
- command -nargs=+ HiLink hi link <args>
- else
- command -nargs=+ HiLink hi def link <args>
- endif
-
- HiLink embryoFormat embryoSpecial
- HiLink embryoCommentL embryoComment
- HiLink embryoCommentStart embryoComment
- HiLink embryoLabel Label
- HiLink embryoUserLabel Label
- HiLink embryoConditional Conditional
- HiLink embryoRepeat Repeat
- HiLink embryoBranch Conditional
- HiLink embryoReserved Keyword
- HiLink embryoCharacter Character
- HiLink embryoSpecialCharacter cSpecial
- HiLink embryoNumber Number
- HiLink embryoOctal Number
- HiLink embryoOctalZero PreProc " link this to Error if you want
- HiLink embryoFloat Float
- HiLink embryoOctalError embryoError
- HiLink embryoParenError embryoError
- HiLink embryoErrInParen embryoError
- HiLink embryoErrInBracket embryoError
- HiLink embryoCommentError embryoError
- HiLink embryoCommentStartErr embryoError
- HiLink embryoSpaceError embryoError
- HiLink embryoSpecialError embryoError
- HiLink embryoOperator Operator
- HiLink embryoStructure Structure
- HiLink embryoEdjeKey Structure
- HiLink embryoStorageClass StorageClass
- HiLink embryoInclude Include
- HiLink embryoPreProc PreProc
- HiLink embryoDefine Macro
- HiLink embryoIncluded embryoString
- HiLink embryoError Error
- HiLink embryoStatement Statement
- HiLink embryoPreCondit PreCondit
- HiLink embryoType Type
- HiLink embryoConstant Constant
- HiLink embryoCommentString embryoString
- HiLink embryoComment2String embryoString
- HiLink embryoCommentSkip embryoComment
- HiLink embryoString String
- HiLink embryoComment Comment
- HiLink embryoSpecial SpecialChar
- HiLink embryoTodo Todo
- HiLink embryoFunctionName Function
-
- delcommand HiLink
-endif
-
-let b:current_syntax = "embryo"
-
-" vim: ts=8
+++ /dev/null
-collections {
- group { name: "main";
- parts {
- part { name: "bg";
- type: RECT;
- description { state: "default" 0.0;
- color: 255 255 255 255;
- }
- }
- part { name: "label";
- type: TEXT;
- description { state: "default" 0.0;
- color: 0 0 0 255;
- text {
- text: "Click me.";
- font: "Sans";
- size: 12;
- align: 0.0 0.7;
- }
- }
- }
- part { name: "red_rect";
- type: RECT;
- description { state: "default" 0.0;
- color: 255 0 0 255;
- max: 30 30;
- align: 0.1 0.2;
- }
- description { state: "default" 1.0;
- inherit: "default" 0.0;
- color: 0 0 255 255;
- align: 0.9 0.2;
- }
- }
- }
- programs {
- program {
- signal: "mouse,down,1";
- source: "label";
- lua_script {
- ed.red_rect.state = { "default", 1.0}
- }
- }
- }
- }
-}
+++ /dev/null
-collections {
- group { name: "main";
- parts {
- part { name: "bg";
- type: RECT;
- description { state: "default" 0.0;
- color: 255 255 255 255;
- }
- }
- part { name: "label";
- type: TEXT;
- description { state: "default" 0.0;
- color: 0 0 0 255;
- text {
- text: "Click me.";
- font: "Sans";
- size: 12;
- }
- }
- }
- }
- programs {
- program {
- signal: "mouse,down,1";
- source: "label";
- lua_script {
- ed.label.text = "Clicked!"
- }
- }
- program {
- signal: "mouse,up,1";
- source: "label";
- lua_script {
- ed.label.text = "Click me."
- }
- }
- }
- }
-}
+++ /dev/null
-collections {
- group { name: "main";
- parts {
- part { name: "bg";
- type: RECT;
- description { state: "default" 0.0;
- color: 255 255 255 255;
- }
- }
- part { name: "label1";
- type: TEXT;
- description { state: "default" 0.0;
- color: 0 0 0 255;
- text {
- text: "Timer delayed...";
- font: "Sans";
- size: 12;
- align: 0.0 0.7;
- }
- }
- }
- part { name: "label2";
- type: TEXT;
- description { state: "default" 0.0;
- color: 0 0 0 255;
- text {
- font: "Sans";
- size: 12;
- align: 0.0 0.8;
- }
- }
- }
- part { name: "label3";
- type: TEXT;
- description { state: "default" 0.0;
- color: 0 0 0 255;
- text {
- font: "Sans";
- size: 12;
- align: 0.0 0.9;
- }
- }
- }
- part { name: "red_rect";
- type: RECT;
- description { state: "default" 0.0;
- color: 255 0 0 255;
- max: 30 30;
- align: 0.1 0.2;
- }
- description { state: "default" 1.0;
- inherit: "default" 0.0;
- color: 0 0 255 255;
- align: 0.9 0.2;
- }
- }
- }
- programs {
- /* Move the red rect back an forth in a loop */
- program { name: "init";
- signal: "load";
- source: "";
- action: STATE_SET "default" 1.0;
- transition: SINUSOIDAL 1.0;
- target: "red_rect";
- after: "loop";
- }
- program { name: "loop";
- action: STATE_SET "default" 0.0;
- transition: SINUSOIDAL 1.0;
- target: "red_rect";
- after: "init";
- }
- program { name: "lua_init";
- signal: "load";
- source: "";
- lua_script {
- function timer_cb()
- /* Print Timer attributes */
- print("## timer_cb")
- print(" timer.pending:", timer.pending)
- print(" timer.precision:", timer.precision)
- print(" timer.interval:", timer.interval)
-
- /* Slow down the timer */
- timer.interval = timer.interval + 0.005
-
- /* Set labels with object info */
- ed.label1.text = "timer interval: " .. timer.interval
- ed.label2.text = "object x: " .. ed.red_rect.geometry[1]
- r, g, b, a = unpack(ed.red_rect.color)
- ed.label3.text = "object color: "..r.." "..g.." ".. b
-
- /* or return CALLBACK_CANCEL to stop the timer*/
- return CALLBACK_RENEW
- end
-
- /* Start a new timer that will call timer_cb every 0.01s */
- timer = ed:timer(0.01, timer_cb)
-
- /* Delay the timer execution by 2s */
- timer:delay(2)
- }
- }
- }
- }
-}
%{_libdir}/*.la
%{_libdir}/*.a
%{_libdir}/pkgconfig/*
-%{_includedir}/*.h
+%{_includedir}/edje-1/*.h
%files bin
%defattr(-, root, root)
%{_bindir}/edje_cc
+%{_bindir}/edje_convert
%{_bindir}/edje_decc
%{_bindir}/edje_recc
%{_bindir}/edje_player
+%{_bindir}/edje_external_inspector
+%{_bindir}/edje_inspector
%{_bindir}/inkscape2edc
%{_datadir}/edje/include/edje.inc
%{_datadir}/mime/packages/edje.xml
+++ /dev/null
-EFL:edje repo for SLP2
static void st_collections_group_parts_part_source6(void);
static void st_collections_group_parts_part_entry_mode(void);
static void st_collections_group_parts_part_select_mode(void);
-static void st_collections_group_parts_part_cursor_mode(void);
static void st_collections_group_parts_part_multiline(void);
static void st_collections_group_parts_part_dragable_x(void);
static void st_collections_group_parts_part_dragable_y(void);
{"collections.group.parts.part.dragable.events", st_collections_group_parts_part_dragable_events},
{"collections.group.parts.part.entry_mode", st_collections_group_parts_part_entry_mode},
{"collections.group.parts.part.select_mode", st_collections_group_parts_part_select_mode},
- {"collections.group.parts.part.cursor_mode", st_collections_group_parts_part_cursor_mode},
{"collections.group.parts.part.multiline", st_collections_group_parts_part_multiline},
{"collections.group.parts.part.image", st_images_image}, /* dup */
{"collections.group.parts.part.set.name", st_images_set_name},
/**
@page edcref
@property
- cursor_mode
- @parameters
- [MODE]
- @effect
- Sets the cursor mode for a textblock part to one of:
- @li UNDER
- @li BEFORE
- UNDER cursor mode means the cursor will draw below the character pointed
- at. That's the default.
- BEFORE cursor mode means the cursor is drawn as a vertical line before
- the current character, just like many other GUI toolkits handle it.
- @endproperty
-*/
-static void
-st_collections_group_parts_part_cursor_mode(void)
-{
- Edje_Part_Collection *pc;
- Edje_Part *ep;
-
- check_arg_count(1);
-
- pc = eina_list_data_get(eina_list_last(edje_collections));
- ep = pc->parts[pc->parts_count - 1];
- ep->cursor_mode = parse_enum(0,
- "UNDER", EDJE_ENTRY_CURSOR_MODE_UNDER,
- "BEFORE", EDJE_ENTRY_CURSOR_MODE_BEFORE,
- NULL);
-}
-
-/**
- @page edcref
- @property
multiline
@parameters
[1 or 0]
}
}
}
- /*
- * On some BSD based systems (MacOS, OpenBSD), the default cpp
- * in the path is a wrapper script that chokes on the -o option.
- * If the preprocessor is invoked via gcc -E, it will treat
- * file_in as a linker file. The safest route seems to be to
- * run cpp with the output as the second non-option argument.
- *
- * Redirecting the output is required for MacOS 10.3, and works fine
- * on other systems.
- *
- * Also, the MacOS preprocessor is not managing C++ comments, so pass gcc
- * preprocessor just after. Linux gcc seems to not like it, so guard the
- * code so that it is compiled only on MacOS
- *
- */
+
+ /* Trying gcc and other syntax */
if (ret != 0)
{
- snprintf(buf, sizeof(buf), "cat %s | cpp -I%s %s > %s",
- file_in, inc, def, tmpn);
+ snprintf(buf, sizeof(buf), "%s -I%s %s -E -o %s -std=c99 - < %s",
+ getenv("CC") ? getenv("CC") : "cc",
+ inc, def, tmpn, file_in);
ret = system(buf);
-#if defined (__MacOSX__) || ( defined (__MACH__) && defined (__APPLE__) ) || defined (__OpenBSD__)
- if (ret == 0)
- {
- static char tmpn2[4096];
-
- snprintf (tmpn2, PATH_MAX, "%s/edje_cc.edc-tmp-XXXXXX", tmp_dir);
- fd = mkstemp(tmpn2);
- if (fd >= 0)
- {
- close(fd);
- snprintf (buf, 4096, "gcc -xc -I%s %s -E -o %s %s",
- inc, def, tmpn2, tmpn);
- ret = system(buf);
- snprintf(tmpn, 4096, "%s", tmpn2);
- }
- }
-#endif
}
+ /* Trying suncc syntax */
if (ret != 0)
{
- snprintf(buf, sizeof(buf), "gcc -I%s %s -E -o %s %s",
+ snprintf(buf, sizeof(buf), "%s -I%s %s -E -o %s -xc99 - < %s",
+ getenv("CC") ? getenv("CC") : "cc",
inc, def, tmpn, file_in);
ret = system(buf);
}
EDJE_EDIT_IMAGE_COMP_LOSSY
} Edje_Edit_Image_Comp;
+struct _Edje_Edit_Script_Error
+{
+ const char *program_name; /* null == group shared script */
+ int line;
+ const char *error_str;
+};
+typedef struct _Edje_Edit_Script_Error Edje_Edit_Script_Error;
+
/**
* @file
* @brief Functions to deal with edje internal object. Don't use in standard
*/ //@{
/**
- * Get the script for the given object,
+ * Get the Embryo script for the group of the given object.
+ *
+ * Get the shared script for the group under edition. Shared script means
+ * the script {} block for the group, not counting what's in each program.
+ * It returns a malloc'd duplicate of the code, so users are free to modify
+ * the contents directly and they should remember to free() it when done.
+ * NULL will be returned if there's no script or an error occurred.
*
* @param obj Object being edited.
*
- * @return The script name.
+ * @return The shared script code for this group.
+ */
+EAPI char *edje_edit_script_get(Evas_Object *obj);
+
+/**
+ * Set the code for the group script.
+ *
+ * Set the Embryo source code for the shared script of the edited group.
+ * Note that changing the code itself will not update the running VM, you
+ * need to call edje_edit_script_compile for it to get updated.
+ *
+ * @param obj The object being edited
+ * @param code The Embryo source
+ */
+EAPI void edje_edit_script_set(Evas_Object *obj, const char *code);
+
+/**
+ * Get the Embryo script for the given program.
+ *
+ * Get the script code for the given program. Like the group script, this
+ * function returns a duplicate of the code that the user can modify at will
+ * and must free when done using it.
+ * NULL will be returned if the program doesn't exist, doesn't have any
+ * script or is not of type script.
+ *
+ * @param obj Object being edited
+ * @param prog Program name
+ *
+ * @return The program script code
+ */
+EAPI char *edje_edit_script_program_get(Evas_Object *obj, const char *prog);
+
+/**
+ * Set the Embryo script for the given program.
+ *
+ * Set the Embryo source code for the program @p prog. It must be an
+ * existing program of type EDJE_ACTION_TYPE_SCRIPT, or the function
+ * will fail and do nothing.
+ * Note that changing the code itself will not update the running VM, you
+ * need to call edje_edit_script_compile for it to get updated.
+ *
+ * @param obj The object being edited
+ * @param prog The program name.
+ * @param code The Embryo source
*/
-EAPI const char * edje_edit_script_get(Evas_Object *obj);
+EAPI void edje_edit_script_program_set(Evas_Object *obj, const char *prog, const char *code);
+/**
+ * Compile the Embryo script for the given object
+ *
+ * If required, this function will process all script code for the group and
+ * build the bytecode, updating the running Embryo VM Program if the build
+ * is succesful.
+ *
+ * @param obj The object being edited
+ *
+ */
+EAPI Eina_Bool edje_edit_script_compile(Evas_Object *obj);
+
+/**
+ * Get the list of errors resulting from the last script build
+ *
+ * Get the list of errors that resulted from the last attempt to rebuild
+ * the Embryo script for the edited group. This will be a standard Eina_List
+ * with Edje_Edit_Script_Error pointers as its data.
+ * The user should not do anything else but read the contents of this list.
+ * These errors can be the output of the embryo compiler, or internal errors
+ * generated by Edje_Edit if the preprocessing of the scripts failed.
+ *
+ * @param obj The object being edited
+ *
+ * @return A constant list of Edje_Edit_Script_Error, or NULL if there are none
+ */
+EAPI const Eina_List *edje_edit_script_error_list_get(Evas_Object *obj);
//@}
/******************************************************************************/
+++ /dev/null
-#ifndef _EDJE_MULTISENSE_UI_MODULE_H_
-#define _EDJE_MULTISENSE_UI_MODULE_H_
-
-#include <Edje.h>
-
-/**
- *
- * @file Edje_Multisense_Ui_Module.h
- * @brief The header file comprises of API's to be implemented by Edje Multisense Module for providing the sound/haptic play functionality .
- * For a reference of what all parameter means
- * look at the complete @ref edcref
- *
- * /
-
- /**
- * Play the sound data being send by edje.
- *
- * @param sinfo address of the sound definition structure as defined in edc
- * @param sdata comprises of address of buffer having the sound data and size of buffer
- * @param iterations number of iterations of the sound to be played
- *
- * @return EINA_TRUE on success EINA_FALSE on failure
- * */
-EAPI Eina_Bool ems_ui_sound_play( Edje_Sound_Info* sinfo, Edje_Sound_Data* sdata, unsigned int iterations );
-
-/**
- * Play the haptic definition as send by edje
- *
- * @param haptic holds the address of haptic definition as defined in edc
- * @param iterations number of iterations of the haptic to be played
- *
- * @return EINA_TRUE on success EINA_FALSE on failure
- * */
-EAPI Eina_Bool ems_ui_haptic_play( Edje_Haptic_Info *haptic, unsigned int iterations );
-
-#endif /* _EDJE_MULTISENSE_UI_MODULE_H_ */
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "pointer_mode", pointer_mode, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "entry_mode", entry_mode, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "select_mode", select_mode, EET_T_UCHAR);
- EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "cursor_mode", cursor_mode, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "multiline", multiline, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "api.name", api.name, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "api.description", api.description, EET_T_STRING);
struct _Edje_Edit
{
Edje base;
+
+ void *bytecode;
+ int bytecode_size;
+
+ char *embryo_source;
+ char *embryo_processed;
+ Eina_Hash *program_scripts;
+
+ Eina_List *errors;
+
+ Eina_Bool bytecode_dirty:1;
+ Eina_Bool embryo_source_dirty:1;
+ Eina_Bool all_dirty:1;
+ Eina_Bool script_need_recompile:1;
+};
+
+typedef struct _Program_Script Program_Script;
+struct _Program_Script
+{
+ int id;
+ char *code;
+ char *processed;
+ Eina_Bool dirty:1;
+ Eina_Bool delete_me:1;
};
static void _edje_edit_smart_add(Evas_Object *obj);
}
static void
+_edje_edit_data_clean(Edje_Edit *eed)
+{
+ Edje_Edit_Script_Error *se;
+
+ free(eed->bytecode);
+ free(eed->embryo_source);
+ free(eed->embryo_processed);
+
+ if (eed->program_scripts)
+ eina_hash_free(eed->program_scripts);
+
+ EINA_LIST_FREE(eed->errors, se)
+ {
+ eina_stringshare_del(se->program_name);
+ eina_stringshare_del(se->error_str);
+ free(se);
+ }
+
+ eed->bytecode = NULL;
+ eed->embryo_source = NULL;
+ eed->embryo_processed = NULL;
+ eed->program_scripts = NULL;
+ eed->bytecode_size = 0;
+ eed->bytecode_dirty = EINA_FALSE;
+ eed->embryo_source_dirty = EINA_FALSE;
+ eed->all_dirty = EINA_FALSE;
+ eed->script_need_recompile = EINA_FALSE;
+}
+
+static void
_edje_edit_smart_del(Evas_Object *obj)
{
-// Edje_Edit *eed;
+ Edje_Edit *eed;
+
+ eed = evas_object_smart_data_get(obj);
+
+ _edje_edit_data_clean(eed);
-// eed = evas_object_smart_data_get(obj);
_edje_edit_parent_sc->base.del(obj);
}
+static void
+_edje_edit_program_script_free(Program_Script *ps)
+{
+ free(ps->code);
+ free(ps->processed);
+ free(ps);
+}
+
static Eina_Bool
_edje_edit_smart_file_set(Evas_Object *obj, const char *file, const char *group)
{
-// Edje_Edit *eed;
+ Edje_Edit *eed;
+ Eet_File *ef;
+ char **keys, buf[64];
+ int count, i;
+ int len = strlen("edje/scripts/embryo/source/");
+
+ eed = evas_object_smart_data_get(obj);
-// eed = evas_object_smart_data_get(obj);
- /* Nothing custom here yet, so we just call the parent function.
- * TODO and maybes:
+ _edje_edit_data_clean(eed);
+
+ /* TODO and maybes:
* * The whole point of this thing is keep track of stuff such as
* strings to free and who knows what, so we need to take care
* of those if the file/group changes.
* (GROUP parts or BOX/TABLE items pointing to non-existent/renamed
* groups).
*/
- return _edje_edit_parent_sc->file_set(obj, file, group);
+ if (!_edje_edit_parent_sc->file_set(obj, file, group))
+ return EINA_FALSE;
+
+ eed->program_scripts = eina_hash_int32_new((Eina_Free_Cb)_edje_edit_program_script_free);
+
+ ef = eet_open(file, EET_FILE_MODE_READ);
+
+ snprintf(buf, sizeof(buf), "edje/scripts/embryo/source/%i",
+ eed->base.collection->id);
+ eed->embryo_source = eet_read(ef, buf, &count);
+
+ snprintf(buf, sizeof(buf), "edje/scripts/embryo/source/%i/*",
+ eed->base.collection->id);
+ keys = eet_list(ef, buf, &count);
+ for (i = 0; i < count; i++)
+ {
+ Program_Script *ps;
+ int size;
+
+ ps = calloc(1, sizeof(Program_Script));
+
+ sscanf(keys[i] + len, "%*i/%i", &ps->id);
+ ps->code = eet_read(ef, keys[i], &size);
+ eina_hash_add(eed->program_scripts, &ps->id, ps);
+ }
+
+ return EINA_TRUE;
}
static void
}
static int
-_edje_image_id_find(Evas_Object *obj, const char *image_name)
+_edje_image_id_find(Edje_Edit *eed, const char *image_name)
{
unsigned int i;
- GET_ED_OR_RETURN(-1);
-
- if (!ed->file) return -1;
- if (!ed->file->image_dir) return -1;
+ if (!eed->base.file) return -1;
+ if (!eed->base.file->image_dir) return -1;
//printf("SEARCH IMAGE %s\n", image_name);
- for (i = 0; i < ed->file->image_dir->entries_count; ++i)
- if (ed->file->image_dir->entries[i].entry
- && !strcmp(image_name, ed->file->image_dir->entries[i].entry))
+ for (i = 0; i < eed->base.file->image_dir->entries_count; ++i)
+ if (eed->base.file->image_dir->entries[i].entry
+ && !strcmp(image_name, eed->base.file->image_dir->entries[i].entry))
return i;
return -1;
}
static const char *
-_edje_image_name_find(Evas_Object *obj, int image_id)
+_edje_image_name_find(Edje_Edit *eed, int image_id)
{
- GET_ED_OR_RETURN(NULL);
-
- if (!ed->file) return NULL;
- if (!ed->file->image_dir) return NULL;
+ if (!eed->base.file) return NULL;
+ if (!eed->base.file->image_dir) return NULL;
/* Special case for external image */
if (image_id < 0) image_id = -image_id - 1;
//printf("SEARCH IMAGE ID %d\n", image_id);
- if ((unsigned int) image_id >= ed->file->image_dir->entries_count) return NULL;
- return ed->file->image_dir->entries[image_id].entry;
+ if ((unsigned int) image_id >= eed->base.file->image_dir->entries_count)
+ return NULL;
+ return eed->base.file->image_dir->entries[image_id].entry;
}
static void
evas_object_del(part_obj);
}
+static void
+_edje_edit_flag_script_dirty(Edje_Edit *eed, Eina_Bool all)
+{
+ eed->script_need_recompile = EINA_TRUE;
+ if (all)
+ eed->all_dirty = EINA_TRUE;
+}
+
/*****************/
/* GENERAL API */
/*****************/
Edje_Part_Collection *g;
Eina_List *l;
Eet_File *eetf;
- char buf[32];
+ char buf[64], **keys;
+ int count;
eina_error_set(0);
"for writing output", ed->file->path);
return EINA_FALSE;
}
- snprintf(buf, sizeof(buf), "collections/%d", e->id);
+ snprintf(buf, sizeof(buf), "edje/collections/%d", e->id);
+ eet_delete(eetf, buf);
+ snprintf(buf, sizeof(buf), "edje/scripts/embryo/compiled/%d", e->id);
+ eet_delete(eetf, buf);
+ snprintf(buf, sizeof(buf), "edje/scripts/embryo/source/%d", e->id);
eet_delete(eetf, buf);
+ snprintf(buf, sizeof(buf), "edje/scripts/embryo/source/%d/*", e->id);
+ keys = eet_list(eetf, buf, &count);
+ if (keys)
+ do {
+ count--;
+ eet_delete(eetf, keys[count]);
+ } while(count);
eet_close(eetf);
/* Free Group */
_edje_if_string_free(ed, rp->part->name);
rp->part->name = (char *)eina_stringshare_add(new_name);
+ _edje_edit_flag_script_dirty(eed, EINA_TRUE);
+
return EINA_TRUE;
}
ce->count.part--;
+ _edje_edit_flag_script_dirty(eed, EINA_TRUE);
+
return EINA_TRUE;
}
if (rp->swallowed_object)
evas_object_stack_above(rp->swallowed_object, rp->object);
+ _edje_edit_flag_script_dirty(eed, EINA_TRUE);
+
return EINA_TRUE;
}
if (rp->swallowed_object)
evas_object_stack_above(rp->swallowed_object, rp->object);
+ _edje_edit_flag_script_dirty(eed, EINA_TRUE);
+
return EINA_TRUE;
}
_edje_if_string_free(ed, de->entry);
de->entry = NULL;
+ _edje_edit_flag_script_dirty(eed, EINA_TRUE);
+
return EINA_TRUE;
invalid_image:
{
eina_error_set(0);
- return _edje_image_id_find(obj, image_name);
+ GET_ED_OR_RETURN(-1);
+
+ return _edje_image_id_find(eed, image_name);
}
EAPI Edje_Edit_Image_Comp
edje_edit_state_image_get(Evas_Object *obj, const char *part, const char *state, double value)
{
Edje_Part_Description_Image *img;
- char *image;
+ const char *image;
eina_error_set(0);
img = (Edje_Part_Description_Image *) pd;
- image = (char *)_edje_image_name_find(obj, img->image.id);
+ image = _edje_image_name_find(eed, img->image.id);
if (!image) return NULL;
//printf("GET IMAGE for %s [%s]\n", state, image);
if (rp->part->type != EDJE_PART_TYPE_IMAGE)
return;
- id = _edje_image_id_find(obj, image);
+ id = _edje_image_id_find(eed, image);
//printf("SET IMAGE for %s [%s]\n", state, image);
img = (Edje_Part_Description_Image *) pd;
for (i = 0; i < img->image.tweens_count; ++i)
{
- name = _edje_image_name_find(obj, img->image.tweens[i]->id);
+ name = _edje_image_name_find(eed, img->image.tweens[i]->id);
//printf(" t: %s\n", name);
tweens = eina_list_append(tweens, eina_stringshare_add(name));
}
if (rp->part->type != EDJE_PART_TYPE_IMAGE)
return EINA_FALSE;
- id = _edje_image_id_find(obj, tween);
+ id = _edje_image_id_find(eed, tween);
if (id < EINA_FALSE) return 0;
/* alloc Edje_Part_Image_Id */
if (!img->image.tweens_count) return EINA_FALSE;
- search = _edje_image_id_find(obj, tween);
+ search = _edje_image_id_find(eed, tween);
if (search < 0) return EINA_FALSE;
for (i = 0; i < img->image.tweens_count; ++i)
/******************/
/* PROGRAMS API */
/******************/
+static int
+_edje_program_id_find(Edje_Edit *eed, const char *program)
+{
+ Edje_Program *epr;
+ int i;
+
+ for (i = 0; i < eed->base.table_programs_size; i++)
+ {
+ epr = eed->base.table_programs[i];
+ if (epr->name && !strcmp(epr->name, program))
+ return epr->id;
+ }
+ return -1;
+}
+
static Edje_Program *
_edje_program_get_byname(Evas_Object *obj, const char *prog_name)
{
Edje_Program_After *pa;
Edje_Part_Collection *pc;
Edje_Program *p;
+ Program_Script *ps, *old_ps;
int id, i;
int old_id = -1;
ed->table_programs[epr->id]->id = epr->id;
}
+ ps = eina_hash_find(eed->program_scripts, &id);
+ old_ps = eina_hash_find(eed->program_scripts, &old_id);
+ if (old_ps)
+ {
+ if (!ps)
+ {
+ ps = _alloc(sizeof(Program_Script));
+ ps->id = id;
+ eina_hash_add(eed->program_scripts, &id, ps);
+ }
+ else
+ {
+ free(ps->code);
+ free(ps->processed);
+ ps->processed = NULL;
+ ps->delete_me = EINA_FALSE;
+ }
+ ps->code = old_ps->code;
+ old_ps->code = NULL;
+ free(old_ps->processed);
+ old_ps->processed = NULL;
+ ps->dirty = EINA_TRUE;
+ old_ps->dirty = EINA_FALSE;
+ old_ps->delete_me = EINA_TRUE;
+ }
+ else if (ps)
+ {
+ ps->dirty = EINA_FALSE;
+ ps->delete_me = EINA_TRUE;
+ }
+
//Free Edje_Program
_edje_if_string_free(ed, epr->name);
_edje_if_string_free(ed, epr->signal);
if (pa->id == old_id)
pa->id = id;
else if (pa->id == id)
- p->after = eina_list_remove_list(p->after, l);
+ {
+ p->after = eina_list_remove_list(p->after, l);
+ free(pa);
+ }
}
/* check in targets */
if (p->action == EDJE_ACTION_TYPE_ACTION_STOP)
if (pt->id == old_id)
pt->id = id;
else if (pt->id == id)
- p->targets = eina_list_remove_list(p->targets, l);
+ {
+ p->targets = eina_list_remove_list(p->targets, l);
+ free(pt);
+ }
}
}
}
+ _edje_edit_flag_script_dirty(eed, EINA_TRUE);
+
return EINA_TRUE;
}
_edje_if_string_free(ed, epr->name);
epr->name = eina_stringshare_add(new_name);
+ _edje_edit_flag_script_dirty(eed, EINA_TRUE);
+
return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_program_action_set(Evas_Object *obj, const char *prog, Edje_Action_Type action)
{
+ Program_Script *ps;
+
eina_error_set(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
GET_EPR_OR_RETURN(EINA_FALSE);
//printf("SET ACTION for program: %s [%d]\n", prog, action);
if (action >= EDJE_ACTION_TYPE_LAST) return EINA_FALSE;
+ if ((Edje_Action_Type)epr->action == action)
+ return EINA_TRUE;
+
+ if (action == EDJE_ACTION_TYPE_SCRIPT)
+ {
+ ps = eina_hash_find(eed->program_scripts, &epr->id);
+ if (!ps)
+ {
+ ps = _alloc(sizeof(Program_Script));
+ if (!ps)
+ return EINA_FALSE;
+ }
+ ps->id = epr->id;
+ ps->code = strdup("");
+ ps->dirty = EINA_TRUE;
+ ps->delete_me = EINA_FALSE;
+ eina_hash_set(eed->program_scripts, &ps->id, ps);
+ _edje_edit_flag_script_dirty(eed, EINA_FALSE);
+ }
+ if (epr->action == EDJE_ACTION_TYPE_SCRIPT)
+ {
+ ps = eina_hash_find(eed->program_scripts, &epr->id);
+ if (ps)
+ {
+ free(ps->code);
+ free(ps->processed);
+ ps->code = ps->processed = NULL;
+ ps->dirty = EINA_FALSE;
+ ps->delete_me = EINA_TRUE;
+ _edje_edit_flag_script_dirty(eed, EINA_FALSE);
+ }
+ }
+
epr->action = action;
return EINA_TRUE;
}
/*************************/
/* EMBRYO SCRIPTS API */
/*************************/
-EAPI const char *
+EAPI char *
edje_edit_script_get(Evas_Object *obj)
{
- Embryo_Program *script = NULL;
-
eina_error_set(0);
GET_ED_OR_RETURN(NULL);
if (!ed->collection) return NULL;
- if (!ed->collection->script) return NULL;
+ if (!eed->embryo_source) return NULL;
+
+ return strdup(eed->embryo_source);
+}
+
+EAPI void
+edje_edit_script_set(Evas_Object *obj, const char *code)
+{
+ eina_error_set(0);
+
+ GET_ED_OR_RETURN();
+
+ free(eed->embryo_source);
+ free(eed->embryo_processed);
+
+ if (code)
+ eed->embryo_source = strdup(code);
+ else
+ eed->embryo_source = NULL;
+ eed->embryo_processed = NULL;
+
+ eed->embryo_source_dirty = EINA_TRUE;
- script = ed->collection->script;
+ _edje_edit_flag_script_dirty(eed, EINA_FALSE);
+}
+
+EAPI char *
+edje_edit_script_program_get(Evas_Object *obj, const char *prog)
+{
+ Program_Script *ps;
+
+ eina_error_set(0);
+
+ GET_ED_OR_RETURN(NULL);
+ GET_EPR_OR_RETURN(NULL);
+
+ if (epr->action != EDJE_ACTION_TYPE_SCRIPT)
+ return NULL;
+
+ ps = eina_hash_find(eed->program_scripts, prog);
+ if (!ps) /* mmm? it should be there, even if empty */
+ return NULL;
+
+ return ps->code ? strdup(ps->code) : NULL;
+}
+
+EAPI void
+edje_edit_script_program_set(Evas_Object *obj, const char *prog, const char *code)
+{
+ Program_Script *ps;
+
+ eina_error_set(0);
- printf("Get Script [%p] %d\n", script, embryo_program_recursion_get(script));
+ GET_ED_OR_RETURN();
+ GET_EPR_OR_RETURN();
+
+ if (epr->action != EDJE_ACTION_TYPE_SCRIPT)
+ return;
+
+ ps = eina_hash_find(eed->program_scripts, prog);
+ if (!ps) /* ???? how so? */
+ return;
- return "Not yet complete...";
+ free(ps->code);
+ free(ps->processed);
+
+ if (code)
+ ps->code = strdup(code);
+ else
+ ps->code = NULL;
+ ps->processed = NULL;
+ ps->dirty = EINA_TRUE;
+
+ _edje_edit_flag_script_dirty(eed, EINA_FALSE);
}
+static int
+__part_replace(Edje_Edit *eed, char *pcode, char *name)
+{
+ int id;
+
+ id = _edje_part_id_find((Edje *)eed, name);
+ if (id < 0)
+ return 0;
+ return eina_convert_itoa(id, pcode);
+}
+
+static int
+__program_replace(Edje_Edit *eed, char *pcode, char *name)
+{
+ int id;
+
+ id = _edje_program_id_find(eed, name);
+ if (id < 0)
+ return 0;
+ return eina_convert_itoa(id, pcode);
+}
+
+static int
+__group_replace(Edje_Edit *eed __UNUSED__, char *pcode, char *name)
+{
+ strcpy(pcode, name);
+ return strlen(name) + 1;
+}
+
+static int
+__image_replace(Edje_Edit *eed, char *pcode, char *name)
+{
+ int id;
+
+ id = _edje_image_id_find(eed, name);
+ if (id < 0)
+ return 0;
+ return eina_convert_itoa(id, pcode);
+}
+
+static char *
+_edje_edit_script_process(Edje_Edit *eed, const char *progname, char *code)
+{
+ char *pcode, *psrc, *pdst;
+ int codesize, pcodesize;
+ int quoted = 0, escaped = 0;
+ int line = 1;
+ Eina_Bool success = EINA_TRUE;
+
+ codesize = strlen(code);
+ pcode = malloc(codesize + 1);
+ if (!pcode)
+ return NULL;
+
+ pcodesize = 0;
+ psrc = code;
+ pdst = pcode;
+ while (*psrc)
+ {
+ if (!quoted)
+ {
+ char *ptr = NULL;
+ const char *what = NULL;
+ int (*func)(Edje_Edit *, char *, char *);
+
+ if (*psrc == 'P')
+ {
+ if (!strncmp(psrc, "PART:\"", 6))
+ {
+ psrc += 6;
+ ptr = psrc;
+ func = __part_replace;
+ what = "part";
+ }
+ else if (!strncmp(psrc, "PROGRAM:\"", 9))
+ {
+ psrc += 9;
+ ptr = psrc;
+ func = __program_replace;
+ what = "program";
+ }
+ }
+ else if (*psrc == 'G')
+ {
+ if (!strncmp(psrc, "GROUP:\"", 7))
+ {
+ psrc += 7;
+ ptr = psrc;
+ func = __group_replace;
+ what = "group";
+ }
+ }
+ else if (*psrc == 'I')
+ {
+ if (!strncmp(psrc, "IMAGE:\"", 7))
+ {
+ psrc += 7;
+ ptr = psrc;
+ func = __image_replace;
+ what = "image";
+ }
+ }
+ else if (*psrc == '#')
+ {
+ while (*psrc)
+ if (*psrc == '\n')
+ break;
+ line++;
+ continue;
+ }
+ else if (*psrc == '\"')
+ quoted = 1;
+ else if (*psrc == '\n')
+ line++;
+
+ if (ptr)
+ {
+ int i = 0, inesc = 0;
+ char *name;
+ while (*psrc)
+ {
+ if (!inesc)
+ {
+ if (*psrc == '\\')
+ inesc = 1;
+ else if (*psrc == '\"')
+ {
+ /* string concatenation as in "foo""bar" */
+ if (*(psrc + 1) != '\"')
+ {
+ psrc++;
+ break;
+ }
+ else
+ psrc++;
+ }
+ }
+ else
+ inesc = 0;
+ psrc++;
+ }
+ name = alloca(psrc - ptr);
+ inesc = 0;
+ while (*ptr)
+ {
+ if (!inesc)
+ {
+ if (*ptr == '\\')
+ inesc = 1;
+ else if (*ptr == '\"')
+ {
+ if (*(ptr + 1) == '\"')
+ ptr++;
+ else
+ {
+ name[i] = 0;
+ break;
+ }
+ }
+ else
+ {
+ name[i] = *ptr;
+ name[i + 1] = 0;
+ i++;
+ }
+ }
+ else
+ inesc = 0;
+ ptr++;
+ }
+ i = func(eed, pdst, name);
+ if (!i)
+ {
+ Edje_Edit_Script_Error *se;
+ se = malloc(sizeof(Edje_Edit_Script_Error));
+ se->program_name = progname ?
+ eina_stringshare_add(progname) : NULL;
+ se->line = line;
+ se->error_str = eina_stringshare_printf(
+ "Referenced %s '%s' could not be found in object.",
+ what, name);
+ eed->errors = eina_list_append(eed->errors, se);
+ success = EINA_FALSE;
+ }
+ else
+ {
+ pcodesize += i;
+ pdst += i;
+ }
+ /* replaced reference for the right value, now go
+ * to the next iteration */
+ continue;
+ }
+ }
+ else
+ {
+ if (!escaped)
+ {
+ if (*psrc == '\"')
+ quoted = 0;
+ else if (*psrc == '\\')
+ escaped = 1;
+ }
+ else if (escaped)
+ escaped = 0;
+ }
+ *pdst = *psrc;
+ pdst++;
+ psrc++;
+ pcodesize++;
+ }
+
+ if (!success)
+ {
+ free(pcode);
+ return NULL;
+ }
+
+ if (pcodesize < codesize)
+ pcode = realloc(pcode, pcodesize + 1);
+ pcode[pcodesize] = 0;
+
+ return pcode;
+}
+
+static Eina_Bool
+_edje_edit_embryo_rebuild(Edje_Edit *eed)
+{
+ FILE *f;
+ int fd, size, ret;
+ const char *tmp_dir;
+ char tmp_in[PATH_MAX];
+ char tmp_out[PATH_MAX];
+ char buf[4096];
+ Eina_Iterator *it;
+ Program_Script *ps;
+ Edje_Part_Collection *edc;
+ Eina_Bool success = EINA_TRUE; /* we are optimists! */
+ Edje_Edit_Script_Error *se;
+
+ EINA_LIST_FREE(eed->errors, se)
+ {
+ eina_stringshare_del(se->program_name);
+ eina_stringshare_del(se->error_str);
+ free(se);
+ }
+
+#ifdef HAVE_EVIL
+ tmp_dir = evil_tmpdir_get();
+#else
+ tmp_dir = "/tmp";
+#endif
+
+ snprintf(tmp_in, sizeof(tmp_in), "%s/edje_edit.sma-tmp-XXXXXX", tmp_dir);
+ snprintf(tmp_out, sizeof(tmp_out), "%s/edje_edit.amx-tmp-XXXXXX", tmp_dir);
+
+ fd = mkstemp(tmp_in);
+ if (fd < 0)
+ return EINA_FALSE; /* FIXME: report something */
+
+ f = fdopen(fd, "w");
+ if (!f)
+ {
+ close(fd);
+ unlink(tmp_in);
+ return EINA_FALSE;
+ }
+
+ fprintf(f, "#include <edje>\n");
+ if (eed->embryo_source)
+ {
+ if (eed->all_dirty)
+ {
+ free(eed->embryo_processed);
+ eed->embryo_processed = NULL;
+ }
+ if (!eed->embryo_processed)
+ eed->embryo_processed = _edje_edit_script_process(eed, NULL,
+ eed->embryo_source);
+ if (!eed->embryo_processed)
+ {
+ /* oops.. an error finding references parts or something.
+ * we could flag it and do some lighter processing of the
+ * rest of the scripts, in order to find all the errors of
+ * this kind and report them at once, but knowing already
+ * that the script will not compile we can avoid some work
+ */
+ success = EINA_FALSE;
+ }
+ else
+ fprintf(f, "%s", eed->embryo_processed);
+ }
+
+ it = eina_hash_iterator_data_new(eed->program_scripts);
+ EINA_ITERATOR_FOREACH(it, ps)
+ {
+ Edje_Program *epr;
+
+ if (ps->delete_me)
+ continue;
+ if (eed->all_dirty)
+ {
+ free(ps->processed);
+ ps->processed = NULL;
+ }
+ epr = eed->base.table_programs[ps->id];
+ if (!ps->processed)
+ ps->processed = _edje_edit_script_process(eed, epr->name, ps->code);
+ if (!ps->processed)
+ {
+ /* oops.. an error finding references parts or something.
+ * we could flag it and do some lighter processing of the
+ * rest of the scripts, in order to find all the errors of
+ * this kind and report them at once, but knowing already
+ * that the script will not compile we can avoid some work
+ */
+ success = EINA_FALSE;
+ continue;
+ }
+ fprintf(f, "public _p%i(sig[], src[]) {\n", ps->id);
+ fprintf(f, "%s", ps->processed);
+ fprintf(f, "}\n");
+ }
+ eina_iterator_free(it);
+
+ fclose(f);
+
+ if (!success)
+ goto almost_out;
+
+ fd = mkstemp(tmp_out);
+ if (fd < 0)
+ {
+ success = EINA_FALSE;
+ goto almost_out;
+ }
+
+ snprintf(buf, sizeof(buf), "embryo_cc -i %s/include -o %s %s",
+ PACKAGE_DATA_DIR, tmp_out, tmp_in);
+ ret = system(buf);
+
+ if ((ret < 0) || (ret > 1))
+ {
+ success = EINA_FALSE;
+ close(fd);
+ goto the_doorway;
+ }
+
+ f = fdopen(fd, "rb");
+ if (!f)
+ {
+ success = EINA_FALSE;
+ close(fd);
+ goto the_doorway;
+ }
+
+ fseek(f, 0, SEEK_END);
+ size = ftell(f);
+ rewind(f);
+
+ free(eed->bytecode);
+ if (size > 0)
+ {
+ eed->bytecode = malloc(size);
+ if (!eed->bytecode)
+ {
+ success = EINA_FALSE;
+ goto the_way_out;
+ }
+ if (fread(eed->bytecode, size, 1, f) != 1)
+ {
+ success = EINA_FALSE;
+ goto the_way_out;
+ }
+ }
+ else
+ eed->bytecode = NULL; /* correctness mostly, I don't see why we
+ would get a 0 sized program */
+
+ eed->bytecode_size = size;
+ eed->bytecode_dirty = EINA_TRUE;
+ eed->script_need_recompile = EINA_FALSE;
+ eed->all_dirty = EINA_FALSE;
+
+ edc = eed->base.collection;
+ embryo_program_free(edc->script);
+ edc->script = embryo_program_new(eed->bytecode, eed->bytecode_size);
+ _edje_embryo_script_init(edc);
+ _edje_var_init((Edje *)eed);
+
+the_way_out:
+ fclose(f);
+the_doorway:
+ unlink(tmp_out);
+almost_out:
+ unlink(tmp_in);
+
+ return success;
+}
+
+EAPI Eina_Bool
+edje_edit_script_compile(Evas_Object *obj)
+{
+ GET_ED_OR_RETURN(EINA_FALSE);
+
+ if (!eed->script_need_recompile)
+ return EINA_TRUE;
+
+ return _edje_edit_embryo_rebuild(eed);
+}
+
+EAPI const Eina_List *
+edje_edit_script_error_list_get(Evas_Object *obj)
+{
+ GET_ED_OR_RETURN(NULL);
+ return eed->errors;
+}
/***************************/
/* EDC SOURCE GENERATION */
char *data;
Eina_Bool ret = EINA_TRUE;
const char *api_name, *api_description;
+ Edje_Program *epr;
GET_ED_OR_RETURN(EINA_FALSE);
+ epr = _edje_program_get_byname(obj, program);
+
BUF_APPENDF(I3"program { name: \"%s\";\n", program);
/* Signal */
edje_edit_string_free(s2);
}
break;
+ case EDJE_ACTION_TYPE_SCRIPT:
+ {
+ Program_Script *ps;
+
+ ps = eina_hash_find(eed->program_scripts, &epr->id);
+ if (ps && !ps->delete_me)
+ {
+ BUF_APPEND(I4"script {\n");
+ BUF_APPEND(ps->code);
+ BUF_APPEND(I4"}\n");
+ }
+ }
+ break;
//TODO Support Drag
//~ case EDJE_ACTION_TYPE_DRAG_VAL_SET:
//~ eina_strbuf_append(buf, I4"action: DRAG_VAL_SET TODO;\n");
BUF_APPEND(I5"image {\n");
- image_name = _edje_image_name_find(obj, img->image.id);
+ image_name = _edje_image_name_find(eed, img->image.id);
if (image_name)
BUF_APPENDF(I6"normal: \"%s\";\n", image_name);
static Eina_Bool
_edje_generate_source_of_group(Edje *ed, Edje_Part_Collection_Directory_Entry *pce, Eina_Strbuf *buf)
{
+ Edje_Edit *eed;
+ Eet_File *ef;
Evas_Object *obj;
Eina_List *l, *ll;
unsigned int i;
int w, h;
char *data;
const char *group = pce->entry;
+ Edje_Part_Collection *pc;
Eina_Bool ret = EINA_TRUE;
obj = edje_edit_object_add(ed->evas);
if (!edje_object_file_set(obj, ed->file->path, group)) return EINA_FALSE;
+ ef = eet_open(ed->file->path, EET_FILE_MODE_READ);
+ if (!ef)
+ {
+ evas_object_del(obj);
+ return EINA_FALSE;
+ }
+
+ eed = evas_object_smart_data_get(obj);
+ pc = eed->base.collection;
+
BUF_APPENDF(I1"group { name: \"%s\";\n", group);
//TODO Support alias:
w = edje_edit_group_min_w_get(obj);
BUF_APPENDF(I2"max: %d %d;\n", w, h);
/* Data */
- if (pce->ref->data)
+ if (pc->data)
{
Eina_Iterator *it;
Eina_Hash_Tuple *tuple;
BUF_APPEND(I2"data {\n");
- it = eina_hash_iterator_tuple_new(pce->ref->data);
+ it = eina_hash_iterator_tuple_new(pc->data);
if (!it)
{
BUF_APPEND(I2"}\n");
}
- //TODO Support script
+ if (eed->embryo_source)
+ {
+ BUF_APPEND(I2"script {\n");
+ BUF_APPEND(eed->embryo_source);
+ BUF_APPEND(I2"}\n");
+ }
/* Parts */
BUF_APPEND(I2"parts {\n");
- for (i = 0; i < pce->ref->parts_count; i++)
+ for (i = 0; i < pc->parts_count; i++)
{
Edje_Part *ep;
- ep = pce->ref->parts[i];
+ ep = pc->parts[i];
ret &= _edje_generate_source_of_part(obj, ep, buf);
}
BUF_APPEND(I2"}\n");//parts
BUF_APPEND(I2 "}\n");
edje_edit_string_list_free(ll);
}
- BUF_APPEND(" }\n");//group
+ BUF_APPEND(I1"}\n");//group
if (!ret)
{
return EINA_FALSE;
}
+ eet_close(ef);
evas_object_del(obj);
return ret;
}
}
}
+ if (eed->bytecode_dirty || eed->script_need_recompile)
+ {
+ char buf[64];
+ Eina_Iterator *it;
+ Program_Script *ps;
+ Eina_List *deathnote = NULL;
+
+ if (eed->bytecode_dirty)
+ {
+ snprintf(buf, sizeof(buf), "edje/scripts/embryo/compiled/%i",
+ ed->collection->id);
+ eet_write(eetf, buf, eed->bytecode, eed->bytecode_size, 1);
+ free(eed->bytecode);
+ eed->bytecode = NULL;
+ eed->bytecode_size = 0;
+ eed->bytecode_dirty = EINA_FALSE;
+ }
+
+ if (eed->embryo_source_dirty)
+ {
+ snprintf(buf, sizeof(buf), "edje/scripts/embryo/source/%i",
+ ed->collection->id);
+ eet_write(eetf, buf, eed->embryo_source,
+ strlen(eed->embryo_source) +1, 1);
+ eed->embryo_source_dirty = EINA_FALSE;
+ }
+
+ it = eina_hash_iterator_data_new(eed->program_scripts);
+ EINA_ITERATOR_FOREACH(it, ps)
+ {
+ if (ps->dirty)
+ {
+ snprintf(buf, sizeof(buf), "edje/scripts/embryo/source/%i/%i",
+ ed->collection->id, ps->id);
+ eet_write(eetf, buf, ps->code, strlen(ps->code) + 1, 1);
+ ps->dirty = EINA_FALSE;
+ }
+ else if (ps->delete_me)
+ {
+ snprintf(buf, sizeof(buf), "edje/scripts/embryo/source/%i/%i",
+ ed->collection->id, ps->id);
+ eet_delete(eetf, buf);
+ deathnote = eina_list_append(deathnote, ps);
+ }
+ }
+ eina_iterator_free(it);
+
+ EINA_LIST_FREE(deathnote, ps)
+ eina_hash_del(eed->program_scripts, &ps->id, ps);
+ }
+
if (!_edje_edit_source_save(eetf, obj))
{
eet_close(eetf);
tc = evas_object_textblock_cursor_new(en->rp->object);
evas_textblock_cursor_copy(en->cursor, tc);
- if (!evas_textblock_cursor_char_prev(tc))
+ if (!evas_textblock_cursor_char_prev(tc))
{
ret = EINA_TRUE;
goto done;
}
else
{
- if (evas_textblock_cursor_char_prev(tc))
+ if (evas_textblock_cursor_char_prev(tc))
{
str = evas_textblock_cursor_range_text_get(tc, en->cursor, EVAS_TEXTBLOCK_TEXT_MARKUP);
if (!str) goto done;
return ECORE_CALLBACK_CANCEL;
}
-static void
+static void
_input_panel_hide_timer_start(void *data)
{
if (hide_timer)
evas_textblock_cursor_range_delete(en->preedit_start, en->preedit_end);
}
-static void
+static void
_edje_entry_focus_in_cb(void *data, Evas_Object *o __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
{
Edje_Real_Part *rp;
_curs_update_from_curs(Evas_Textblock_Cursor *c, Evas_Object *o __UNUSED__, Entry *en)
{
Evas_Coord cx, cy, cw, ch;
- Evas_Textblock_Cursor_Type cur_type;
if (c != en->cursor) return;
- switch (en->rp->part->cursor_mode)
- {
- case EDJE_ENTRY_CURSOR_MODE_BEFORE:
- cur_type = EVAS_TEXTBLOCK_CURSOR_BEFORE;
- break;
- case EDJE_ENTRY_CURSOR_MODE_UNDER:
- /* no break for a resaon */
- default:
- cur_type = EVAS_TEXTBLOCK_CURSOR_UNDER;
- }
- evas_textblock_cursor_geometry_get(c, &cx, &cy, &cw, &ch, NULL, cur_type);
+ evas_textblock_cursor_geometry_get(c, &cx, &cy, &cw, &ch, NULL, EVAS_TEXTBLOCK_CURSOR_UNDER);
en->cx = cx + (cw / 2);
en->cy = cy + (ch / 2);
}
_curs_jump_line_by(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en, int by)
{
int ln;
-
+
ln = evas_textblock_cursor_line_geometry_get(c, NULL, NULL, NULL, NULL) + by;
_curs_jump_line(c, o, en, ln);
}
en->selection = NULL;
}
_edje_emit(en->rp->edje, "selection,changed", en->rp->part->name);
-
+
#ifdef HAVE_ECORE_IMF
if (!en->imf_context) return;
ecore_imf_context_reset(en->imf_context);
list_cnt = eina_list_count(en->sel);
list_idx = 0;
-
+
evas_object_hide(en->cursor_fg);
evas_object_hide(en->cursor_bg);
evas_object_move(en->block_handler_btm, x + r->x + r->w, y + r->y + r->h);
evas_object_show(en->block_handler_btm);
}
- }
+ }
*(&(sel->rect)) = *r;
range = eina_list_remove_list(range, range);
free(r);
for (ll = range; ll; ll = eina_list_next(ll))
{
Evas_Object *ob;
-
+
sel = calloc(1, sizeof(Sel));
an->sel = eina_list_append(an->sel, sel);
ob = edje_object_add(en->rp->edje->evas);
evas_object_show(ob);
sel->obj_bg = ob;
en->rp->edje->subobjs = eina_list_append(en->rp->edje->subobjs, sel->obj_bg);
-
+
ob = edje_object_add(en->rp->edje->evas);
edje_object_file_set(ob, en->rp->edje->path, en->rp->part->source6);
evas_object_smart_member_add(ob, smart);
evas_object_show(ob);
sel->obj_fg = ob;
en->rp->edje->subobjs = eina_list_append(en->rp->edje->subobjs, sel->obj_fg);
-
+
ob = evas_object_rectangle_add(en->rp->edje->evas);
evas_object_color_set(ob, 0, 0, 0, 0);
evas_object_smart_member_add(ob, smart);
if (an->item)
{
Evas_Coord cx, cy, cw, ch;
-
+
if (!evas_textblock_cursor_format_item_geometry_get
(an->start, &cx, &cy, &cw, &ch))
continue;
else
{
Evas_Textblock_Rectangle *r;
-
+
r = range->data;
*(&(sel->rect)) = *r;
if (sel->obj_bg)
}
}
}
- _edje_entry_real_part_configure(rp);
+ _edje_entry_real_part_configure(rp);
_edje_emit(rp->edje, "entry,changed", rp->part->name);
}
-static Eina_Bool
+static Eina_Bool
_password_timer_cb(void *data)
{
Entry *en = (Entry *)data;
// cut
}
else
- {
+ {
if (en->have_selection)
_range_del(en->cursor, rp->object, en);
else
{
_delete(en->cursor, rp->object, en);
- /*count characters*/
+ /*count characters*/
if (en->func)
en->func(en->data, NULL);
}
_caps_mode_check(en);
}
else if ((!strcmp(ev->key, "ISO_Left_Tab")) && (multiline))
- {
+ {
// remove a tab
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
_caps_mode_check(en);
}
_edje_emit(ed, "entry,key,enter", rp->part->name);
- /*count characters*/
+ /*count characters*/
if (en->func)
en->func(en->data, NULL);
}
_range_del(en->cursor, rp->object, en);
_sel_clear(en->cursor, rp->object, en);
if (rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD_SHOW_LAST_CHARACTER)
- {
- _edje_entry_hide_visible_password(en->rp);
+ {
+ _edje_entry_hide_visible_password(en->rp);
/*if inputtin text is not allowed, dont allow text input*/
if (en->func)
if (en->func(en->data, (void *)ev->string))
ecore_timer_del(en->pw_timer);
en->pw_timer = NULL;
}
- en->pw_timer = ecore_timer_add(2.0, _password_timer_cb, en);
+ en->pw_timer = ecore_timer_add(2.0, _password_timer_cb, en);
}
else
{
_text_filter_text_prepend(en, en->cursor, ev->string);
/*count characters*/
- if (en->func) en->func(en->data, NULL);
+ if (en->func) en->func(en->data, NULL);
#if 0
// evas_textblock_cursor_text_prepend(en->cursor, ev->string);
_text_filter_text_prepend(en, en->cursor, ev->string);
do /* move cursor to the end point of the words */
{
ct = _edje_entry_cursor_content_get(rp, EDJE_CURSOR_MAIN);
- if (block_type != _get_char_type(ct))
+ if (block_type != _get_char_type(ct))
{
//_edje_entry_cursor_prev(rp, EDJE_CURSOR_MAIN);
break;
en->select_allow = EINA_TRUE;
en->had_sel = EINA_TRUE;
en->selecting = EINA_FALSE;
-
+
//printf("string : %s \n", eina_strbuf_string_get(str));
eina_strbuf_free(str);
}
{
Edje_Real_Part *rp = data;
Entry *en;
- if (!rp) return ECORE_CALLBACK_CANCEL;
+ if (!rp) return;
en = rp->entry_data;
if (en->longpress_timer)
{
ecore_timer_del(en->longpress_timer);
en->longpress_timer = NULL;
- }
-
+ }
+
en->long_pressed = EINA_TRUE;
en->longpress_timer = NULL;
- return ECORE_CALLBACK_CANCEL;
}
static void
en = rp->entry_data;
en->double_clicked = EINA_FALSE;
en->long_pressed = EINA_FALSE;
-
+
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
return;
return;
}
#endif
-
+
en->select_mod_start = EINA_FALSE;
en->select_mod_end = EINA_FALSE;
if (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_DEFAULT)
evas_object_geometry_get(rp->object, &x, &y, &w, &h);
en->cx = ev->canvas.x - x;
en->cy = ev->canvas.y - y;
-
+
if (en->rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_BLOCK_HANDLE)
{
evas_textblock_cursor_char_coord_set(en->cursor, en->cx, en->cy);
}
_edje_entry_real_part_configure(rp);
-
+
_edje_emit(en->rp->edje, "handler,moving", en->rp->part->name);
}
}
done:
en->cursor = (Evas_Textblock_Cursor *)evas_object_textblock_cursor_get(rp->object);
-
+
edje_object_signal_callback_add(rp->edje->obj, "mouse,down,1,double", rp->part->name, _edje_entry_mouse_double_clicked, rp);
}
{
Evas_Coord x, y, w, h, xx, yy, ww, hh;
Entry *en = rp->entry_data;
- Evas_Textblock_Cursor_Type cur_type;
if (!en) return;
- switch (rp->part->cursor_mode)
- {
- case EDJE_ENTRY_CURSOR_MODE_BEFORE:
- cur_type = EVAS_TEXTBLOCK_CURSOR_BEFORE;
- break;
- case EDJE_ENTRY_CURSOR_MODE_UNDER:
- /* no break for a resaon */
- default:
- cur_type = EVAS_TEXTBLOCK_CURSOR_UNDER;
- }
_sel_update(en->cursor, rp->object, en);
_anchors_update(en->cursor, rp->object, en);
x = y = w = h = -1;
xx = yy = ww = hh = -1;
evas_object_geometry_get(rp->object, &x, &y, &w, &h);
- evas_textblock_cursor_geometry_get(en->cursor, &xx, &yy, &ww, &hh, NULL, cur_type);
+ evas_textblock_cursor_geometry_get(en->cursor, &xx, &yy, &ww, &hh, NULL, EVAS_TEXTBLOCK_CURSOR_UNDER);
if (ww < 1) ww = 1;
if (hh < 1) ww = 1;
if (en->cursor_bg)
if (!en) return;
// set text as markup
_sel_clear(en->cursor, rp->object, en);
- evas_object_textblock_text_markup_set(rp->object, text);
+ evas_object_textblock_text_markup_set(rp->object, text);
_anchors_get(en->cursor, rp->object, en);
_edje_emit(rp->edje, "entry,changed", rp->part->name);
#endif
_edje_entry_real_part_configure(rp);
-
+
en->select_allow = EINA_TRUE;
en->had_sel = EINA_TRUE;
}
{
Evas_Coord x, y, w, h, xx, yy, ww, hh;
Entry *en = rp->entry_data;
- Evas_Textblock_Cursor_Type cur_type;
if (!en) return;
- switch (rp->part->cursor_mode)
- {
- case EDJE_ENTRY_CURSOR_MODE_BEFORE:
- cur_type = EVAS_TEXTBLOCK_CURSOR_BEFORE;
- break;
- case EDJE_ENTRY_CURSOR_MODE_UNDER:
- /* no break for a resaon */
- default:
- cur_type = EVAS_TEXTBLOCK_CURSOR_UNDER;
- }
x = y = w = h = -1;
xx = yy = ww = hh = -1;
evas_object_geometry_get(rp->object, &x, &y, &w, &h);
- evas_textblock_cursor_geometry_get(en->cursor, &xx, &yy, &ww, &hh, NULL, cur_type);
+ evas_textblock_cursor_geometry_get(en->cursor, &xx, &yy, &ww, &hh, NULL, EVAS_TEXTBLOCK_CURSOR_UNDER);
if (ww < 1) ww = 1;
if (hh < 1) ww = 1;
if (cx) *cx = x + xx;
return;
en->select_allow = allow;
-
+
if ((allow) && (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_BLOCK_HANDLE))
{
_edje_entry_select_word(rp);
{
Entry *en = rp->entry_data;
if (!en) return;
-
+
en->func = func;
en->data = data;
}
_edje_entry_autoperiod_set(Edje_Real_Part *rp, Eina_Bool autoperiod)
{
Entry *en = rp->entry_data;
- if (!en) return;
+ if (!en) return;
en->autoperiod = autoperiod;
}
if (en->have_selection)
{
- if (strcmp(ev->str, ""))
+ if (strcmp(ev->str, ""))
{
/* delete selected characters */
_range_del(en->cursor, rp->object, en);
if (rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD_SHOW_LAST_CHARACTER)
{
- _edje_entry_hide_visible_password(en->rp);
+ _edje_entry_hide_visible_password(en->rp);
/* if inputtin text is not allowed, dont allow text input */
if (en->func)
{
Eina_List *attrs = NULL;
Ecore_IMF_Preedit_Attr *attr;
Eina_List *l;
- Eina_Strbuf *buf;
+ Eina_Strbuf *buf;
if (!rp) return ECORE_CALLBACK_PASS_ON;
/* insert preedit character(s) */
//xx
- if (strlen(preedit_string) > 0)
+ if (strlen(preedit_string) > 0)
{
buf = eina_strbuf_new();
if (attrs)
{
- EINA_LIST_FOREACH(attrs, l, attr)
+ EINA_LIST_FOREACH(attrs, l, attr)
{
if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB1)
{
eina_strbuf_append(buf, "</>");
}
}
- }
+ }
// evas_object_textblock_text_markup_prepend(en->cursor, eina_strbuf_string_get(buf));
_text_filter_markup_prepend(en, en->cursor, eina_strbuf_string_get(buf));
eina_strbuf_free(buf);
if (!preedit_end_state)
{
- /* set preedit start cursor */
+ /* set preedit start cursor */
if (!en->preedit_start)
en->preedit_start = evas_object_textblock_cursor_new(rp->object);
evas_textblock_cursor_copy(en->cursor, en->preedit_start);
evas_textblock_cursor_pos_set(en->cursor, preedit_start_pos + cursor_pos);
}
- /* count characters*/
+ /* count characters*/
if (en->func)
en->func(en->data, NULL);
Edje_File *edf;
int error_ret = 0;
Eina_Bool succeed = EINA_FALSE;
+ Eina_Bool is_glob = EINA_FALSE;
+ const char *p;
if ((!file) || (!*file))
return EINA_FALSE;
edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL);
if (!edf)
return EINA_FALSE;
-
- if (!edf->collection_patterns)
+
+ for (p = glob; *p; p++)
{
- Edje_Part_Collection_Directory_Entry *ce;
- Eina_Iterator *i;
- Eina_List *l = NULL;
-
- i = eina_hash_iterator_data_new(edf->collection);
-
- EINA_ITERATOR_FOREACH(i, ce)
- l = eina_list_append(l, ce);
-
- eina_iterator_free(i);
-
- edf->collection_patterns = edje_match_collection_dir_init(l);
- eina_list_free(l);
+ if ((*p == '*') || (*p == '?') || (*p == '['))
+ {
+ is_glob = EINA_TRUE;
+ break;
+ }
+ }
+
+ if (is_glob)
+ {
+ if (!edf->collection_patterns)
+ {
+ Edje_Part_Collection_Directory_Entry *ce;
+ Eina_Iterator *i;
+ Eina_List *l = NULL;
+
+ i = eina_hash_iterator_data_new(edf->collection);
+
+ EINA_ITERATOR_FOREACH(i, ce)
+ l = eina_list_append(l, ce);
+
+ eina_iterator_free(i);
+
+ edf->collection_patterns = edje_match_collection_dir_init(l);
+ eina_list_free(l);
+ }
+
+ succeed = edje_match_collection_dir_exec(edf->collection_patterns, glob);
+ if (edf->collection_patterns)
+ {
+ edje_match_patterns_free(edf->collection_patterns);
+ edf->collection_patterns = NULL;
+ }
+ }
+ else
+ {
+ if (eina_hash_find(edf->collection, glob)) succeed = EINA_TRUE;
}
-
- succeed = edje_match_collection_dir_exec(edf->collection_patterns, glob);
_edje_cache_file_unref(edf);
return succeed;
}
if (ed->table_programs) free(ed->table_programs);
ed->table_programs = NULL;
ed->table_programs_size = 0;
+ ed->focused_part = NULL;
}
void
+++ /dev/null
-#include <string.h>
-#include <Edje.h>
-#include "edje_private.h"
-
-#define EMS_SOUND_PLAY_PLUGIN_API "ems_ui_sound_play"
-#define EMS_HAPTIC_PLAY_PLUGIN_API "ems_ui_haptic_play"
-
-static Eina_Bool ems_ui_module_loaded = EINA_FALSE;
-
-static Eina_Bool (*ems_ui_sound_play) (Edje_Sound_Info* , Edje_Sound_Data*, unsigned int ) = NULL;
-static Eina_Bool (*ems_ui_haptic_play) (Edje_Haptic_Info* , unsigned int ) = NULL;
-
-Eina_Bool _edje_multisense_ui_init()
-{
- if (!ems_ui_module_loaded )
- {
- char *ems_ui_module_name = NULL ;
- Eina_Module *m = NULL;
- ems_ui_module_name = getenv("EDJE_MULTISENSE_UI_MODULE");
- if(!ems_ui_module_name) return EINA_FALSE;
- m = edje_module_load(ems_ui_module_name);
- if(!m) return EINA_FALSE ;
- ems_ui_sound_play = eina_module_symbol_get(m, "ems_ui_sound_play");
- ems_ui_haptic_play = eina_module_symbol_get(m, "ems_ui_haptic_play" );
- ems_ui_module_loaded = EINA_TRUE;
- }
-
- return ems_ui_module_loaded;
-}
-
-EAPI Eina_Bool
-edje_multisense_ui_sound_play(Evas_Object *obj, const char* sound_name, unsigned int iterations )
-{
- Edje *ed;
- Edje_Sound_Info *snd_info ;
- char sound_eet_path[30];
- Eina_List *l;
- Eet_File *ef ;
- Edje_Sound_Data *sdata = NULL;
- Eina_Bool result = EINA_FALSE;
- ed = _edje_fetch(obj);
- if(!ems_ui_sound_play || !sound_name || !ed || !ed->file->sound_dir )
- return EINA_FALSE;
- if (ed->file)
- {
- //Locate the Sound Info
- EINA_LIST_FOREACH(ed->file->sound_dir->entries, l, snd_info)
- {
- if (!strcmp(snd_info->name, sound_name))
- {
- sdata = (Edje_Sound_Data*)malloc(sizeof(Edje_Sound_Data));
- snprintf(sound_eet_path, sizeof(sound_eet_path), "edje/sounds/%i", snd_info->id);
- if (ed->file->path )
- {
- ef = eet_open(ed->file->path, EET_FILE_MODE_READ);
- sdata->sound_data = eet_read(ef, sound_eet_path, &(sdata->sound_size));
- if (sdata->sound_data!=NULL)
- result = EINA_TRUE;
- break;
- }
- }
-
- }
- }
-
- if (result)
- {
- result = ((*(ems_ui_sound_play)) (snd_info, sdata, iterations ));
-
- }
- return result;
-}
-
-/**
- *
- */
-EAPI Eina_Bool
-edje_multisense_ui_haptic_play(Evas_Object *obj, const char* haptic_name, unsigned int iterations)
-{
- Edje *ed;
- Edje_Haptic_Info *hinfo;
- Eina_List *l ;
- Eina_Bool result = EINA_FALSE;
- ed = _edje_fetch(obj);
- if(!ems_ui_haptic_play || !haptic_name || !ed )
- return EINA_FALSE;
- EINA_LIST_FOREACH(ed->file->haptics, l, hinfo)
- {
- if (!strcmp(hinfo->name, haptic_name))
- {
- result = EINA_TRUE;
- break;
- }
- }
-
- if (result)
- {
- result = ((*(ems_ui_haptic_play)) (hinfo, iterations));
- }
- return result;
-}
-
#define EDJE_ENTRY_SELECTION_MODE_EXPLICIT 1
#define EDJE_ENTRY_SELECTION_MODE_BLOCK_HANDLE 2
-#define EDJE_ENTRY_CURSOR_MODE_UNDER 0
-#define EDJE_ENTRY_CURSOR_MODE_BEFORE 1
-
#define EDJE_ENTRY_DOUBLE_SPACE_TIME 0.6
#define EDJE_PART_PATH_SEPARATOR ':'
unsigned char pointer_mode;
unsigned char entry_mode;
unsigned char select_mode;
- unsigned char cursor_mode;
unsigned char multiline;
Edje_Part_Api api;
};
Edje_Calc_Params *params,
Edje_Part_Description_Text *chosen_desc)
{
- const char *text;
+ const char *text, *str;
const char *font;
char *font2 = NULL;
char *sfont = NULL;
text = _edje_text_fit_x(ed, ep, params, text, font, size, sw, &free_text);
}
+ str = eina_stringshare_add(text);
if (ep->text.cache.out_str) eina_stringshare_del(ep->text.cache.out_str);
- ep->text.cache.out_str = eina_stringshare_add(text);
+ ep->text.cache.out_str = str;
ep->text.cache.in_w = sw;
ep->text.cache.in_h = sh;
ep->text.cache.out_size = size;