summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-04 02:08:14 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-04 02:08:14 +0000
commit9ea2ce1041549c90f94062ce5ec145056e7fbdfa (patch)
tree3bcd3fb016bc498a72ff99c8d67c8b7ef2d91718 /data
parente2ce20e9a4dfd12bb383a1b60032f2ef7b507850 (diff)
efl: merge edje.
this is still in progress, mostly the multisense stuff is pending. it seems that when we merge ecore_audio in edje the libremix and similar are gone, at least from Edje, and will be in ecore_audio itself (or pulseaudio). Changes: * __UNUSED__ to EINA_UNUSED * binaries (epp, embryo_cc, edje_cc) now consider EFL_RUN_IN_TREE and will assume the binaries are still not installed, running from build tree location (needs more testing, maybe doesn't work with srcdir != builddir, still doesn't solve cross compile builds) SVN revision: 82139
Diffstat (limited to 'data')
-rw-r--r--data/Makefile.am18
-rw-r--r--data/edje/edc.vim368
-rw-r--r--data/edje/edje-mode.el512
-rw-r--r--data/edje/edje.xml11
-rw-r--r--data/edje/include/edje.inc272
-rw-r--r--data/edje/vim/autoload/edccomplete.vim892
-rw-r--r--data/edje/vim/ftdetect/edc.vim3
-rw-r--r--data/edje/vim/ftplugin/edc.vim23
-rw-r--r--data/edje/vim/indent/edc.vim83
-rw-r--r--data/edje/vim/plugin-info.txt8
-rw-r--r--data/edje/vim/snippets/edc.snippets99
-rw-r--r--data/edje/vim/syntax/edc.vim235
-rw-r--r--data/edje/vim/syntax/embryo.vim195
13 files changed, 2718 insertions, 1 deletions
diff --git a/data/Makefile.am b/data/Makefile.am
index f2d475397a..fc04b811c6 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,12 +1,28 @@
1MAINTAINERCLEANFILES = Makefile.in 1MAINTAINERCLEANFILES = Makefile.in
2 2
3EXTRA_DIST =
4
5########################################################################
6# Embryo
3embryofilesdir = $(datadir)/embryo/include 7embryofilesdir = $(datadir)/embryo/include
4embryofiles_DATA = embryo/default.inc 8embryofiles_DATA = embryo/default.inc
5 9
10########################################################################
11# Evas
6evasfilesdir = $(datadir)/evas 12evasfilesdir = $(datadir)/evas
7evasfiles_DATA = evas/checkme 13evasfiles_DATA = evas/checkme
8 14
15########################################################################
16# Eo
9eofilesdir = $(datadir)/eo 17eofilesdir = $(datadir)/eo
10eofiles_DATA = eo/eo_step.py 18eofiles_DATA = eo/eo_step.py
11 19
12EXTRA_DIST = embryo/default.inc evas/checkme eo/eo_step.py 20########################################################################
21# Edje
22edjefilesdir = $(datadir)/edje/include
23edjefiles_DATA = edje/include/edje.inc
24
25mimedir = $(datadir)/mime/packages
26mime_DATA = edje/edje.xml
27
28EXTRA_DIST += edje/edc.vim edje/edje-mode.el
diff --git a/data/edje/edc.vim b/data/edje/edc.vim
new file mode 100644
index 0000000000..6041dcf1fb
--- /dev/null
+++ b/data/edje/edc.vim
@@ -0,0 +1,368 @@
1" Vim syntax file
2" Language: EDC
3" Maintainer: billiob <billiob@gmail.com>
4" Last Change: 05/08/2011
5
6" For version 5.x: Clear all syntax items
7" For version 6.x: Quit when a syntax file was already loaded
8"
9" Usage:
10" 1) Copy this file to $HOME/.vim/syntax/
11" 2) Paste the following line to your $HOME/.vimrc file to load the syntax
12" automatically:
13"
14" au BufNewFile,BufRead *.edc set syntax=edc
15"
16if version < 600
17 syntax clear
18elseif exists("b:current_syntax")
19 finish
20endif
21
22" A bunch of useful C keywords
23syn keyword cStructure images data fonts collections group externals
24syn keyword cStructure part parts dragable description rel1 rel2
25syn keyword cStatement text image font fill origin size tag
26syn keyword cStructure programs program script script_only lua_script lua_script_only styles style base
27syn keyword cStructure spectra spectrum box
28syn keyword cStructure physics movement_freedom faces face world
29syn match cType "+ + +;" contained
30
31syn keyword cLabel item name min max type effect
32syn keyword cLabel mouse_events repeat_events clip_to
33syn keyword cLabel color_class text_class x y confine
34syn keyword cLabel state visible align step aspect aspect_preference fixed
35syn keyword cLabel relative offset to to_x to_y normal tween
36syn keyword cLabel border color color2 color3 font size fit align
37syn keyword cLabel signal source action transition in target after
38syn keyword cLabel text smooth inherit scale middle ignore_flags
39syn keyword cLabel alias events entry_mode select_mode multiline
40syn keyword cLabel source1 source2 source3 source4 source5 source6
41syn keyword cLabel text_source transitions layout padding
42syn keyword cLabel size_w size_h size_max_w size_max_h size_min_w size_min_w
43syn keyword cLabel spread scale_hint elipsis ellipsis pointer_mode prefer
44syn keyword cLabel precise_is_inside use_alternate_font_metrics options
45syn keyword cLabel aspect_mode position span angle repch api
46syn keyword cLabel external params size_range border_scale minmul
47
48syn keyword cLabel mass density material restitution friction
49syn keyword cLabel ignore_part_pos light_on damping sleep
50syn keyword cLabel physics_body hardness linear angular
51syn keyword cLabel backface_cull gravity rate z depth
52
53syn keyword cConditional if else switch
54syn keyword cRepeat while for do
55syn keyword cConstant COMP RAW LOSSY USER
56syn keyword cConstant RECT TEXT IMAGE SWALLOW TEXTBLOCK GRADIENT SPACER
57syn keyword cConstant GROUP BOX TABLE EXTERNAL ITEM
58syn keyword cConstant SOLID AUTOGRAB NOGRAB
59syn keyword cConstant NONE PLAIN OUTLINE SOFT_OUTLINE SHADOW
60syn keyword cConstant SOFT_SHADOW OUTLINE_SHADOW OUTLINE_SOFT_SHADOW
61syn keyword cConstant FAR_SOFT_SHADOW FAR_SHADOW GLOW
62syn keyword cConstant STATE_SET ACTION_STOP SIGNAL_EMIT
63syn keyword cConstant SCRIPT LUA_SCRIPT
64syn keyword cConstant DRAG_VAL_SET DRAG_VAL_STEP DRAG_VAL_PAGE
65syn keyword cConstant LINEAR SINUSOIDAL ACCELERATE DECELERATE
66syn keyword cConstant VERTICAL HORIZONTAL ON_HOLD BOTH EDITABLE EXPLICIT
67syn keyword cConstant FOCUS_SET "default" NEITHER
68syn keyword cConstant DYNAMIC STATIC PASSWORD
69
70syn keyword cConstant RIGID_BOX RIGID_SPHERE SOFT_BOX SOFT_SPHERE
71syn keyword cConstant RIGID_CYLINDER SOFT_CYLINDER
72syn keyword cConstant CLOTH BOUNDARY_TOP BOUNDARY_BOTTOM BOUNDARY_LEFT
73syn keyword cConstant BOUNDARY_RIGHT BOUNDARY_FRONT BOUNDARY_BACK
74syn keyword cConstant PHYSICS_IMPULSE PHYSICS_TORQUE_IMPULSE
75syn keyword cConstant PHYSICS_FORCE PHYSICS_TORQUE PHYSICS_STOP
76syn keyword cConstant PHYSICS_FORCES_CLEAR PHYSICS_VEL_SET
77syn keyword cConstant PHYSICS_ANG_VEL_SET BOX_MIDDLE_FRONT
78syn keyword cConstant BOX_MIDDLE_BACK BOX_FRONT BOX_BACK BOX_LEFT
79syn keyword cConstant BOX_RIGHT BOX_TOP BOX_BOTTOM
80syn keyword cConstant CYLINDER_MIDDLE_FRONT CYLINDER_MIDDLE_BACK
81syn keyword cConstant CYLINDER_FRONT CYLINDER_BACK CYLINDER_CURVED
82syn keyword cConstant CLOTH_FRONT CLOTH_BACK SPHERE_FRONT SPHERE_BACK
83
84syn keyword cTodo contained TODO FIXME XXX
85
86" cCommentGroup allows adding matches for special things in comments
87syn cluster cCommentGroup contains=cTodo
88
89" String and Character constants
90" Highlight special characters (those which have a backslash) differently
91syn match cSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
92if !exists("c_no_utf")
93 syn match cSpecial display contained "\\\(u\x\{4}\|U\x\{8}\)"
94endif
95if exists("c_no_cformat")
96 syn region cString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial
97 " cCppString: same as cString, but ends at end of line
98 syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial
99else
100 syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([diuoxXfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
101 syn match cFormat display "%%" contained
102 syn region cString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat
103 " cCppString: same as cString, but ends at end of line
104 syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat
105endif
106
107syn match cCharacter "L\='[^\\]'"
108syn match cCharacter "L'[^']*'" contains=cSpecial
109if exists("c_gnu")
110 syn match cSpecialError "L\='\\[^'\"?\\abefnrtv]'"
111 syn match cSpecialCharacter "L\='\\['\"?\\abefnrtv]'"
112else
113 syn match cSpecialError "L\='\\[^'\"?\\abfnrtv]'"
114 syn match cSpecialCharacter "L\='\\['\"?\\abfnrtv]'"
115endif
116syn match cSpecialCharacter display "L\='\\\o\{1,3}'"
117syn match cSpecialCharacter display "'\\x\x\{1,2}'"
118syn match cSpecialCharacter display "L'\\x\x\+'"
119
120"when wanted, highlight trailing white space
121if exists("c_space_errors")
122 if !exists("c_no_trail_space_error")
123 syn match cSpaceError display excludenl "\s\+$"
124 endif
125 if !exists("c_no_tab_space_error")
126 syn match cSpaceError display " \+\t"me=e-1
127 endif
128endif
129
130"catch errors caused by wrong parenthesis and brackets
131syn cluster cParenGroup contains=cParenError,cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cCommentSkip,cOctalZero,cCppOut,cCppOut2,cCppSkip,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom
132if exists("c_no_bracket_error")
133 syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cCppString
134 " cCppParen: same as cParen but ends at end-of-line; used in cDefine
135 syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString
136 syn match cParenError display ")"
137 syn match cErrInParen display contained "[{}]"
138else
139 syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,cCppString
140 " cCppParen: same as cParen but ends at end-of-line; used in cDefine
141 syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString
142 syn match cParenError display "[\])]"
143 syn match cErrInParen display contained "[\]{}]"
144 syn region cBracket transparent start='\[' end=']' contains=ALLBUT,@cParenGroup,cErrInParen,cCppParen,cCppBracket,cCppString
145 " cCppBracket: same as cParen but ends at end-of-line; used in cDefine
146 syn region cCppBracket transparent start='\[' skip='\\$' excludenl end=']' end='$' contained contains=ALLBUT,@cParenGroup,cErrInParen,cParen,cBracket,cString
147 syn match cErrInBracket display contained "[);{}]"
148endif
149
150"integer number, or floating point number without a dot and with "f".
151syn case ignore
152syn match cNumbers display transparent "\<\d\|\.\d" contains=cNumber,cFloat,cOctalError,cOctal
153" Same, but without octal error (for comments)
154syn match cNumbersCom display contained transparent "\<\d\|\.\d" contains=cNumber,cFloat,cOctal
155syn match cNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
156"hex number
157syn match cNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
158" Flag the first zero of an octal number as something special
159syn match cOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero
160syn match cOctalZero display contained "\<0"
161syn match cFloat display contained "\d\+f"
162"floating point number, with dot, optional exponent
163syn match cFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
164"floating point number, starting with a dot, optional exponent
165syn match cFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
166"floating point number, without dot, with exponent
167syn match cFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>"
168" flag an octal number with wrong digits
169syn match cOctalError display contained "0\o*[89]\d*"
170syn case match
171
172if exists("c_comment_strings")
173 " A comment can contain cString, cCharacter and cNumber.
174 " But a "*/" inside a cString in a cComment DOES end the comment! So we
175 " need to use a special type of cString: cCommentString, which also ends on
176 " "*/", and sees a "*" at the start of the line as comment again.
177 " Unfortunately this doesn't very well work for // type of comments :-(
178 syntax match cCommentSkip contained "^\s*\*\($\|\s\+\)"
179 syntax region cCommentString contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=cSpecial,cCommentSkip
180 syntax region cComment2String contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=cSpecial
181 syntax region cCommentL start="//" skip="\\$" end="$" keepend contains=@cCommentGroup,cComment2String,cCharacter,cNumbersCom,cSpaceError
182 syntax region cComment matchgroup=cCommentStart start="/\*" matchgroup=NONE end="\*/" contains=@cCommentGroup,cCommentStartError,cCommentString,cCharacter,cNumbersCom,cSpaceError
183else
184 syn region cCommentL start="//" skip="\\$" end="$" keepend contains=@cCommentGroup,cSpaceError
185 syn region cComment matchgroup=cCommentStart start="/\*" matchgroup=NONE end="\*/" contains=@cCommentGroup,cCommentStartError,cSpaceError
186endif
187" keep a // comment separately, it terminates a preproc. conditional
188syntax match cCommentError display "\*/"
189syntax match cCommentStartError display "/\*"me=e-1 contained
190
191syn keyword cOperator sizeof
192if exists("c_gnu")
193 syn keyword cStatement __asm__
194 syn keyword cOperator typeof __real__ __imag__
195endif
196syn keyword cType int long short char void
197syn keyword cType signed unsigned float double
198if !exists("c_no_ansi") || exists("c_ansi_typedefs")
199 syn keyword cType size_t wchar_t ptrdiff_t sig_atomic_t fpos_t
200 syn keyword cType clock_t time_t va_list jmp_buf FILE DIR div_t ldiv_t
201 syn keyword cType mbstate_t wctrans_t wint_t wctype_t
202endif
203if !exists("c_no_c99") " ISO C99
204 syn keyword cType bool complex
205 syn keyword cType int8_t int16_t int32_t int64_t
206 syn keyword cType uint8_t uint16_t uint32_t uint64_t
207 syn keyword cType int_least8_t int_least16_t int_least32_t int_least64_t
208 syn keyword cType uint_least8_t uint_least16_t uint_least32_t uint_least64_t
209 syn keyword cType int_fast8_t int_fast16_t int_fast32_t int_fast64_t
210 syn keyword cType uint_fast8_t uint_fast16_t uint_fast32_t uint_fast64_t
211 syn keyword cType intptr_t uintptr_t
212 syn keyword cType intmax_t uintmax_t
213endif
214if exists("c_gnu")
215 syn keyword cType __label__ __complex__ __volatile__
216endif
217
218syn keyword cStructure struct union enum typedef
219syn keyword cStorageClass static register auto volatile extern const
220if exists("c_gnu")
221 syn keyword cStorageClass inline __attribute__
222endif
223
224if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu")
225 if exists("c_gnu")
226 syn keyword cConstant __GNUC__ __FUNCTION__ __PRETTY_FUNCTION__
227 endif
228 syn keyword cConstant __LINE__ __FILE__ __DATE__ __TIME__ __STDC__
229 syn keyword cConstant __STDC_VERSION__
230 syn keyword cConstant CHAR_BIT MB_LEN_MAX MB_CUR_MAX
231 syn keyword cConstant UCHAR_MAX UINT_MAX ULONG_MAX USHRT_MAX
232 syn keyword cConstant CHAR_MIN INT_MIN LONG_MIN SHRT_MIN
233 syn keyword cConstant CHAR_MAX INT_MAX LONG_MAX SHRT_MAX
234 syn keyword cConstant SCHAR_MIN SINT_MIN SLONG_MIN SSHRT_MIN
235 syn keyword cConstant SCHAR_MAX SINT_MAX SLONG_MAX SSHRT_MAX
236 syn keyword cConstant FLT_RADIX FLT_ROUNDS
237 syn keyword cConstant FLT_DIG FLT_MANT_DIG FLT_EPSILON
238 syn keyword cConstant DBL_DIG DBL_MANT_DIG DBL_EPSILON
239 syn keyword cConstant LDBL_DIG LDBL_MANT_DIG LDBL_EPSILON
240 syn keyword cConstant FLT_MIN FLT_MAX FLT_MIN_EXP FLT_MAX_EXP
241 syn keyword cConstant FLT_MIN_10_EXP FLT_MAX_10_EXP
242 syn keyword cConstant DBL_MIN DBL_MAX DBL_MIN_EXP DBL_MAX_EXP
243 syn keyword cConstant DBL_MIN_10_EXP DBL_MAX_10_EXP
244 syn keyword cConstant LDBL_MIN LDBL_MAX LDBL_MIN_EXP LDBL_MAX_EXP
245 syn keyword cConstant LDBL_MIN_10_EXP LDBL_MAX_10_EXP
246 syn keyword cConstant HUGE_VAL CLOCKS_PER_SEC NULL
247 syn keyword cConstant LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY
248 syn keyword cConstant LC_NUMERIC LC_TIME
249 syn keyword cConstant SIG_DFL SIG_ERR SIG_IGN
250 syn keyword cConstant SIGABRT SIGFPE SIGILL SIGHUP SIGINT SIGSEGV SIGTERM
251 " Add POSIX signals as well...
252 syn keyword cConstant SIGABRT SIGALRM SIGCHLD SIGCONT SIGFPE SIGHUP
253 syn keyword cConstant SIGILL SIGINT SIGKILL SIGPIPE SIGQUIT SIGSEGV
254 syn keyword cConstant SIGSTOP SIGTERM SIGTRAP SIGTSTP SIGTTIN SIGTTOU
255 syn keyword cConstant SIGUSR1 SIGUSR2
256 syn keyword cConstant _IOFBF _IOLBF _IONBF BUFSIZ EOF
257 syn keyword cConstant FOPEN_MAX FILENAME_MAX L_tmpnam
258 syn keyword cConstant SEEK_CUR SEEK_END SEEK_SET
259 syn keyword cConstant TMP_MAX stderr stdin stdout
260 syn keyword cConstant EXIT_FAILURE EXIT_SUCCESS RAND_MAX
261 " Add POSIX errors as well
262 syn keyword cConstant E2BIG EACCES EAGAIN EBADF EBADMSG EBUSY
263 syn keyword cConstant ECANCELED ECHILD EDEADLK EDOM EEXIST EFAULT
264 syn keyword cConstant EFBIG EILSEQ EINPROGRESS EINTR EINVAL EIO EISDIR
265 syn keyword cConstant EMFILE EMLINK EMSGSIZE ENAMETOOLONG ENFILE ENODEV
266 syn keyword cConstant ENOENT ENOEXEC ENOLCK ENOMEM ENOSPC ENOSYS
267 syn keyword cConstant ENOTDIR ENOTEMPTY ENOTSUP ENOTTY ENXIO EPERM
268 syn keyword cConstant EPIPE ERANGE EROFS ESPIPE ESRCH ETIMEDOUT EXDEV
269 " math.h
270 syn keyword cConstant M_E M_LOG2E M_LOG10E M_LN2 M_LN10 M_PI M_PI_2 M_PI_4
271 syn keyword cConstant M_1_PI M_2_PI M_2_SQRTPI M_SQRT2 M_SQRT1_2
272endif
273if !exists("c_no_c99") " ISO C99
274 syn keyword cConstant true false
275endif
276
277syn region cPreCondit start="^\s*#\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=cComment,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError
278syn match cPreCondit display "^\s*#\s*\(else\|endif\)\>"
279if !exists("c_no_if0")
280 syn region cCppOut start="^\s*#\s*if\s\+0\+\>" end=".\|$" contains=cCppOut2
281 syn region cCppOut2 contained start="0" end="^\s*#\s*\(endif\>\|else\>\|elif\>\)" contains=cSpaceError,cCppSkip
282 syn region cCppSkip contained start="^\s*#\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*#\s*endif\>" contains=cSpaceError,cCppSkip
283endif
284syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
285syn match cIncluded display contained "<[^>]*>"
286syn match cInclude display "^\s*#\s*include\>\s*["<]" contains=cIncluded
287"syn match cLineSkip "\\$"
288syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cErrInParen,cErrInBracket,cUserLabel,cSpecial,cOctalZero,cCppOut,cCppOut2,cCppSkip,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti
289syn region cDefine start="^\s*#\s*\(define\|undef\)\>" skip="\\$" end="$" end="//"me=s-1 contains=ALLBUT,@cPreProcGroup
290syn region cPreProc start="^\s*#\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup
291
292syn match cUserLabel display "\I\i*" contained
293
294
295
296if exists("c_minlines")
297 let b:c_minlines = c_minlines
298else
299 if !exists("c_no_if0")
300 let b:c_minlines = 50 " #if 0 constructs can be long
301 else
302 let b:c_minlines = 15 " mostly for () constructs
303 endif
304endif
305exec "syn sync ccomment cComment minlines=" . b:c_minlines
306
307" Define the default highlighting.
308" For version 5.7 and earlier: only when not done already
309" For version 5.8 and later: only when an item doesn't have highlighting yet
310if version >= 508 || !exists("did_c_syn_inits")
311 if version < 508
312 let did_c_syn_inits = 1
313 command -nargs=+ HiLink hi link <args>
314 else
315 command -nargs=+ HiLink hi def link <args>
316 endif
317
318 HiLink cFormat cSpecial
319 HiLink cCppString cString
320 HiLink cCommentL cComment
321 HiLink cCommentStart cComment
322 HiLink cLabel Label
323 HiLink cUserLabel Label
324 HiLink cConditional Conditional
325 HiLink cRepeat Repeat
326 HiLink cCharacter Character
327 HiLink cSpecialCharacter cSpecial
328 HiLink cNumber Number
329 HiLink cOctal Number
330 HiLink cOctalZero PreProc " link this to Error if you want
331 HiLink cFloat Float
332 HiLink cOctalError cError
333 HiLink cParenError cError
334 HiLink cErrInParen cError
335 HiLink cErrInBracket cError
336 HiLink cCommentError cError
337 HiLink cCommentStartError cError
338 HiLink cSpaceError cError
339 HiLink cSpecialError cError
340 HiLink cOperator Operator
341 HiLink cStructure Structure
342 HiLink cStorageClass StorageClass
343 HiLink cInclude Include
344 HiLink cPreProc PreProc
345 HiLink cDefine Macro
346 HiLink cIncluded cString
347 HiLink cError Error
348 HiLink cStatement Statement
349 HiLink cPreCondit PreCondit
350 HiLink cType Type
351 HiLink cConstant Constant
352 HiLink cCommentString cString
353 HiLink cComment2String cString
354 HiLink cCommentSkip cComment
355 HiLink cString String
356 HiLink cComment Comment
357 HiLink cSpecial SpecialChar
358 HiLink cTodo Todo
359 HiLink cCppSkip cCppOut
360 HiLink cCppOut2 cCppOut
361 HiLink cCppOut Comment
362
363 delcommand HiLink
364endif
365
366let b:current_syntax = "edc"
367
368" vim: ts=8
diff --git a/data/edje/edje-mode.el b/data/edje/edje-mode.el
new file mode 100644
index 0000000000..33c6fe6131
--- /dev/null
+++ b/data/edje/edje-mode.el
@@ -0,0 +1,512 @@
1;;; edje-mode-el -- Major mode for editing Edje files
2
3;; Author: Gustavo Sverzut Barbieri <barbieri@gmail.com>
4;; Created: 2007-07-23
5;; Keywords: Edje major-mode
6;; Url: http://barbieri-playground.googlecode.com/svn/dot-files/edje-mode.el
7;; (if you find this file have problems, check that Url and request update)
8
9;; Copyright (C) 2007 Gustavo Sverzut Barbieri <barbieri@gmail.com>
10
11;; This program is free software; you can redistribute it and/or
12;; modify it under the terms of the GNU General Public License as
13;; published by the Free Software Foundation; either version 2 of
14;; the License, or (at your option) any later version.
15
16;; This program is distributed in the hope that it will be
17;; useful, but WITHOUT ANY WARRANTY; without even the implied
18;; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
19;; PURPOSE. See the GNU General Public License for more details.
20
21;; You should have received a copy of the GNU General Public
22;; License along with this program; if not, write to the Free
23;; Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24;; MA 02111-1307 USA
25
26;;; Commentary:
27;;
28;; This mode is based on tutorial from Scott Andrew Borton:
29;; http://two-wugs.net/emacs/mode-tutorial.html
30
31
32(defvar edje-mode-hook nil)
33
34(defun number-or-nil-to-string (v &optional default)
35 (cond ((numberp v) (number-to-string v))
36 ((stringp v) (if (string= v "") (number-to-string default) v))
37 (t (number-to-string default))))
38
39(defun non-empty-string (s)
40 (and (not (eq 'nil s))
41 (not (string= "" s))))
42
43(defun edje-new-program-action-signal-emit (source emission)
44 "Insert new program SIGNAL_EMIT"
45 (interactive "ssource: \nsemission: ")
46 (insert
47 (concat
48 " action: SIGNAL_EMIT \"" source "\" \"" emission "\";\n"
49 )))
50
51(defun edje-new-program-action-state-set (state value target)
52 "Insert new program STATE_SET"
53 (interactive "sstate: \nsvalue (0.0): \nstarget: ")
54 (insert
55 (concat
56 " action: STATE_SET \"" state "\" "
57 (number-or-nil-to-string value 0.0) ";\n"
58 " target: \"" target "\";\n"
59 )))
60
61(defun edje-new-program-action (action)
62 "Insert new program action"
63 (interactive "saction: ")
64 (setq action (upcase action))
65 (cond ((string= action "STATE_SET")
66 (edje-new-program-action-state-set "" 0.0 ""))
67 ((string= action "SIGNAL_EMIT")
68 (edje-new-program-action-signal-emit "" ""))
69 ))
70
71(defun edje-new-program (name signal source action)
72 "Insert new program block"
73 (interactive "sname: \nssignal: \nssource: \nsaction: ")
74 (insert
75 (concat
76 "\n"
77 " program {\n"
78 " name: \"" name "\";\n"
79
80 (if (non-empty-string signal)
81 (concat " signal: \"" signal "\";\n"))
82
83 (if (non-empty-string source)
84 (concat " source: \"" source "\";\n"))
85 ))
86
87 (edje-new-program-action action)
88
89 (insert
90 (concat
91 " }\n"
92 "\n"
93 )))
94
95(defun edje-new-desc-relative (x y &optional defx defy)
96 "Insert new part description 'relative' line"
97 (interactive "sx: \nsy: ")
98 (insert
99 (concat
100 " relative: "
101 (number-or-nil-to-string x defx) " "
102 (number-or-nil-to-string y defy) ";\n"
103 )))
104
105(defun edje-new-desc-offset (x y &optional defx defy)
106 "Insert new part description 'offset' line"
107 (interactive "sx: \nsy: ")
108 (insert
109 (concat
110 " offset: "
111 (number-or-nil-to-string x defx) " "
112 (number-or-nil-to-string y defy) ";\n"
113 )))
114
115(defun edje-new-desc-inherit (name val)
116 "Insert new part description 'inherit' line"
117 (interactive "sname: \nsvalue: ")
118 (insert
119 (concat
120 " inherit: \"" name "\" "
121 (number-or-nil-to-string val 0.0) ";\n"
122 )))
123
124(defun edje-new-desc-text (font size text)
125 "Insert new part description 'text' block"
126 (interactive "sfont: \nssize: \nstext: ")
127 (insert
128 (concat
129 " text {\n"
130 " font: \"" font "\";\n"
131 " size: " (number-or-nil-to-string size) ";\n"
132 " text: \"" text "\";\n"
133 " }\n"
134 )))
135
136(defun edje-new-desc-image (name)
137 "Insert new part description 'image' block"
138 (interactive "sname: ")
139 (insert
140 (concat
141 " image {\n"
142 " normal: \"" name "\";\n"
143 " }\n"
144 )))
145
146(defun edje-new-desc-color (r g b a &optional defr defg defb defa)
147 "Insert new part description 'color' line"
148 (interactive "sred: \nsgreen: \nsblue: \nsalpha: ")
149 (insert
150 (concat
151 " color: "
152 (number-or-nil-to-string r defr) " "
153 (number-or-nil-to-string g defg) " "
154 (number-or-nil-to-string b defb) " "
155 (number-or-nil-to-string a defa) ";\n"
156 )))
157
158(defun edje-new-desc (name val &optional
159 r1_rx r1_ry
160 r2_rx r2_ry
161 r1_ox r1_oy
162 r2_ox r2_oy
163 part_type)
164 "Insert new part description block"
165 (interactive "sName: \nsValue: ")
166 (insert
167 (concat
168 " description {\n"
169 " state: \"" name "\" " (number-or-nil-to-string val 0.0) ";\n"))
170 (if (string= part_type "RECT") (edje-new-desc-color 255 255 255 255))
171 (insert " rel1 {\n")
172 (edje-new-desc-relative r1_rx r1_ry 0.0 0.0)
173 (edje-new-desc-offset r1_ox r1_oy 0 0)
174 (insert
175 (concat
176 " }\n"
177 " rel2 {\n"
178 ))
179 (edje-new-desc-relative r2_rx r2_ry 1.0 1.0)
180 (edje-new-desc-offset r2_ox r2_oy -1 -1)
181 (insert " }\n")
182 (cond ((string= part_type "IMAGE") (edje-new-desc-image ""))
183 ((string= part_type "TEXT") (edje-new-desc-text "" 10 "contents"))
184 )
185 (insert " }\n")
186 )
187
188(defun edje-new-part (name type &optional
189 r1_rx r1_ry
190 r2_rx r2_ry
191 r1_ox r1_oy
192 r2_ox r2_oy)
193 "Insert new part"
194 (interactive "sName: \nsType: ")
195 (setq type (upcase type))
196 (insert
197 (concat
198 "\n"
199 " part {\n"
200 " name: \"" name "\";\n"
201 " type: " type ";\n"
202 " mouse_events: 0;\n"
203 ))
204 (edje-new-desc "default" 0.0 r1_rx r1_ry r2_rx r2_ry r1_ox r1_oy r2_ox r2_oy type)
205 (insert
206 (concat
207 " }\n"
208 )))
209
210(defun edje-setup-compile ()
211 (set (make-local-variable 'compile-command)
212 (concat "edje_cc " (buffer-file-name))
213 ))
214
215(defun edje-cc ()
216 "Runs edje_cc with current buffer."
217 (interactive)
218 (compile (edje-setup-compile)))
219
220(defvar edje-mode-map
221 (let ((edje-mode-map (make-sparse-keymap)))
222 (define-key edje-mode-map "\C-j" 'newline-and-indent)
223 (define-key edje-mode-map "\C-cp" 'edje-new-part)
224 (define-key edje-mode-map "\C-cd" 'edje-new-desc)
225 (define-key edje-mode-map "\C-cr" 'edje-new-desc-relative)
226 (define-key edje-mode-map "\C-co" 'edje-new-desc-offset)
227 (define-key edje-mode-map "\C-ch" 'edje-new-desc-inherit)
228 (define-key edje-mode-map "\C-cc" 'edje-new-desc-color)
229 (define-key edje-mode-map "\C-ci" 'edje-new-desc-image)
230 (define-key edje-mode-map "\C-ct" 'edje-new-desc-text)
231 (define-key edje-mode-map "\C-cg" 'edje-new-program)
232 (define-key edje-mode-map "\C-ca" 'edje-new-program-action)
233 (define-key edje-mode-map "\C-cs" 'edje-new-program-action-state-set)
234 (define-key edje-mode-map "\C-ce" 'edje-new-program-action-signal-emit)
235 edje-mode-map)
236 "Keymap for Edje major mode")
237
238(add-hook 'c-mode-hook 'edje-setup-compile)
239(add-to-list 'auto-mode-alist '("\\.edc$" . edje-mode))
240
241(defconst edje-font-lock-keywords-1
242 (eval-when-compile
243 (list
244 (list (concat "[ \t]*\\<"
245 (regexp-opt
246 '(
247 "collections"
248 "data"
249 "description"
250 "dragable"
251 "fill"
252 "fonts"
253 "group"
254 "image"
255 "images"
256 "origin"
257 "part"
258 "parts"
259 "program"
260 "programs"
261 "rel1"
262 "rel2"
263 "script"
264 "spectra"
265 "style"
266 "styles"
267 "text"
268 ) t) "\\>\\([ \t]*{\\|\\.\\)")
269 '(1 font-lock-function-name-face))
270
271 ))
272 "Major keywords")
273
274(defconst edje-font-lock-keywords-2
275 (eval-when-compile
276 (append edje-font-lock-keywords-1
277 (list
278 (list
279 (concat "^\\([ \t]*\\|[ \t]*[a-z]+\\.\\|\\)\\<"
280 (regexp-opt
281 '("action"
282 "after"
283 "alias"
284 "align"
285 "angle"
286 "aspect"
287 "aspect_preference"
288 "base"
289 "border"
290 "clip_to"
291 "collections"
292 "color"
293 "color2"
294 "color3"
295 "color_class"
296 "color_classes"
297 "confine"
298 "data"
299 "description"
300 "dragable"
301 "effect"
302 "elipsis"
303 "events"
304 "fill"
305 "fit"
306 "fixed"
307 "font"
308 "fonts"
309 "gradient"
310 "group"
311 "ignore_flags"
312 "image"
313 "images"
314 "in"
315 "inherit"
316 "item"
317 "max"
318 "middle"
319 "min"
320 "mouse_events"
321 "name"
322 "normal"
323 "offset"
324 "origin"
325 "part"
326 "parts"
327 "pointer_mode"
328 "precise_is_inside"
329 "program"
330 "programs"
331 "rel1"
332 "rel2"
333 "relative"
334 "repeat_events"
335 "signal"
336 "size"
337 "smooth"
338 "source"
339 "spectra"
340 "spectrum"
341 "spread"
342 "state"
343 "step"
344 "style"
345 "styles"
346 "tag"
347 "target"
348 "text"
349 "text_class"
350 "text_source"
351 "to"
352 "to_x"
353 "to_y"
354 "transition"
355 "tween"
356 "type"
357 "use_alternate_font_metrics"
358 "visible"
359 "x"
360 "y"
361 ) t) "\\>[ \t]*[:,]")
362 '(2 font-lock-keyword-face))
363 )))
364 "Minor keywords")
365
366(defconst edje-font-lock-keywords-3
367 (eval-when-compile
368 (append edje-font-lock-keywords-2
369 (list
370 (list
371 (concat "\\<"
372 (regexp-opt
373 '(; image options (st_images_image)
374 "RAW"
375 "COMP"
376 "LOSSY"
377 "USER"
378 ; part types (st_collections_group_parts_part_type)
379 "NONE"
380 "RECT"
381 "TEXT"
382 "IMAGE"
383 "SWALLOW"
384 "TEXTBLOCK"
385 "GRADIENT"
386 "GROUP"
387 ; ignore flags (st_collections_group_parts_part_ignore_flags)
388 ;"NONE"
389 "ON_HOLD"
390 ; pointer mode (st_collections_group_parts_part_pointer_mode)
391 "AUTOGRAB"
392 "NOGRAB"
393 ; aspect (st_collections_group_parts_part_description_aspect_preference)
394 "NONE"
395 "VERTICAL"
396 "HORIZONTAL"
397 "BOTH"
398 ; text effect (st_collections_group_parts_part_effect)
399 "NONE"
400 "PLAIN"
401 "OUTLINE"
402 "SOFT_OUTLINE"
403 "SHADOW"
404 "SOFT_SHADOW"
405 "OUTLINE_SHADOW"
406 "OUTLINE_SOFT_SHADOW"
407 "FAR_SHADOW"
408 "FAR_SOFT_SHADOW"
409 "GLOW"
410 ; image fill (st_collections_group_parts_part_description_fill_type)
411 "SCALE"
412 "TILE"
413 ; program action (st_collections_group_programs_program_action)
414 "STATE_SET"
415 "ACTION_STOP"
416 "SIGNAL_EMIT"
417 "DRAG_VAL_SET"
418 "DRAG_VAL_STEP"
419 "DRAG_VAL_PAGE"
420 "SCRIPT"
421 ; program transition (st_collections_group_programs_program_transition)
422 "LINEAR"
423 "SINUSOIDAL"
424 "ACCELERATE"
425 "DECELERATE"
426 ) t) "\\>")
427 '(1 font-lock-builtin-face))
428 )))
429 "Enumerate values")
430
431(defconst edje-font-lock-keywords-4
432 (eval-when-compile
433 (append edje-font-lock-keywords-3
434 (list
435 (list
436 (concat "[ \t]*#"
437 (regexp-opt
438 '("if"
439 "ifdef"
440 "ifndef"
441 "define"
442 "else"
443 "endif"
444 "include"
445 "undef") t) "[ \t]*")
446 '(1 font-lock-builtin-face))
447 )))
448 "CPP directives")
449
450(defconst edje-font-lock-keywords-5
451 (eval-when-compile
452 (append edje-font-lock-keywords-4
453 (list
454 (list "[ \t]*#undef[ \t]+\\([a-zA-Z_][a-zA-Z0-9_]*\\)"
455 '(1 font-lock-variable-name-face))
456 (list "[ \t]*#define[ \t]+\\([a-zA-Z_][a-zA-Z0-9_]*\\)("
457 '(1 font-lock-function-name-face))
458 (list "[ \t]*#define[ \t]+\\([a-zA-Z_][a-zA-Z0-9_]*\\)"
459 '(1 font-lock-variable-name-face))
460 )))
461 "CPP directives that define constants")
462
463
464(defvar edje-font-lock-keywords edje-font-lock-keywords-5)
465
466(defvar edje-mode-syntax-table
467 (let ((edje-mode-syntax-table (make-syntax-table)))
468 ; This is added so entity names with underscores can be more easily parsed
469 (modify-syntax-entry ?_ "w" edje-mode-syntax-table)
470 (modify-syntax-entry ?/ ". 124b" edje-mode-syntax-table)
471 (modify-syntax-entry ?* ". 23" edje-mode-syntax-table)
472 (modify-syntax-entry ?\n "> b" edje-mode-syntax-table)
473
474 edje-mode-syntax-table)
475 "Syntax table for edje-mode")
476
477(c-add-style
478 "edje"
479 '("gnu"
480 (indent-tabs-mode . nil)
481 (tab-width . 8)
482 (c-basic-offset . 3)
483 (c-backslash-column . 72)
484 (c-hanging-braces-alist .
485 ((block-open after)
486 (brace-list-open after)
487 (substatement-open after))
488 )
489 (c-offsets-alist .
490 ((statement-block-intro . +)
491 (defun-open . 0)
492 (substatement-open . 0)
493 (defun-block-intro . +)
494 (block-open . 0)
495 (label . +)
496 ))))
497
498
499(define-derived-mode edje-mode c-mode "Edje"
500 "Major mode for editing Edje files"
501 (interactive)
502 (use-local-map edje-mode-map)
503 (set-syntax-table edje-mode-syntax-table)
504 (set (make-local-variable 'font-lock-defaults) '(edje-font-lock-keywords))
505 (set (make-local-variable 'require-final-newline) t)
506 (c-set-style "edje")
507 (run-hooks 'edje-mode-hook)
508 )
509
510(provide 'edje-mode)
511
512;;; edje-mode.el ends here
diff --git a/data/edje/edje.xml b/data/edje/edje.xml
new file mode 100644
index 0000000000..eb299e7021
--- /dev/null
+++ b/data/edje/edje.xml
@@ -0,0 +1,11 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
3 <mime-type type="text/edje">
4 <comment>Edje source file</comment>
5 <glob pattern="*.edc"/>
6 </mime-type>
7 <mime-type type="application/edje">
8 <comment>Edje file</comment>
9 <glob pattern="*.edj"/>
10 </mime-type>
11</mime-info>
diff --git a/data/edje/include/edje.inc b/data/edje/include/edje.inc
new file mode 100644
index 0000000000..5fc9ec2b3f
--- /dev/null
+++ b/data/edje/include/edje.inc
@@ -0,0 +1,272 @@
1/* Edje exported calls */
2
3/************************************************/
4/* Basic data storage/retrieval (it's explicit) */
5/************************************************/
6/* Example:
7 *
8 * In the "global" script section of a group:
9 *
10 * script {
11 * public global_value1;
12 * public global_value2;
13 * public global_value3;
14 * }
15 *
16 * In the program script sections, OR in any global functions/routines:
17 * ( several examples of setting/getting values)
18 *
19 * set_int(global_value1, 7);
20 * set_float(global_value2, 42.0);
21 * set_str(global_value3, "I am a smelly fish!");
22 * new value1 = get_int(global_value1);
23 * new Float:value2 = get_float(global_value2);
24 * new value3[100]; get_str(global_value3, value3, 100);
25 * set_int(global_value1, value1);
26 * set_float(global_value2, value2);
27 * set_str(global_value3, value3);
28 */
29native get_int (id);
30native set_int (id, val);
31native Float:get_float (id);
32native set_float (id, Float:val);
33native get_strlen(id);
34native get_str (id, dst[], maxlen);
35native set_str (id, str[]);
36
37/********************/
38/* Edje list calls */
39/********************/
40native count (id);
41native remove (id, n);
42native append_int (id, v);
43native prepend_int(id, v);
44native insert_int (id, pos, v);
45native replace_int (id, pos, v);
46native fetch_int (id, pos);
47native append_str (id, str[]);
48native prepend_str(id, str[]);
49native insert_str (id, pos, str[]);
50native replace_str(id, pos, str[]);
51native fetch_str (id, pos, dst[], maxlen);
52native append_float (id, Float:v);
53native prepend_float(id, Float:v);
54native insert_float (id, pos, Float:v);
55native replace_float(id, pos, Float:v);
56native Float:fetch_float (id, pos);
57
58/********************/
59/* Edje timer calls */
60/********************/
61native timer (Float:in, fname[], val);
62native cancel_timer(id);
63
64/*******************/
65/* Edje anim calls */
66/*******************/
67native anim (Float:len, fname[], val);
68native cancel_anim(id);
69
70/***********************************************************/
71/* Edje utility calls for dealing with edjes/programs etc. */
72/***********************************************************/
73/* Example:
74 *
75 * emit("this_thing", "clicked");
76 * emit("state", "playing");
77 *
78 * set_state(PART:"logo", "glowing", 0.0);
79 * set_state(PART:"button", "default", 0.0);
80 *
81 * set_tween_state(PART:"button", 0.5, "default", 0.0, "clicked", 0.0);
82 *
83 * run_program(PROGRAM:"program_name");
84 */
85native emit (sig[], src[]);
86native get_part_id (part[]);
87native get_image_id (image[]);
88native get_program_id (program[]);
89native set_state (part_id, state[], Float:state_val);
90native get_state (part_id, dst[], maxlen, &Float:val);
91native set_tween_state (part_id, Float:tween, state1[], Float:state1_val, state2[], Float:state2_val);
92native run_program (program_id);
93native get_drag_dir (part_id);
94native get_drag (part_id, &Float:dx, &Float:dy);
95native set_drag (part_id, Float:dx, Float:dy);
96native get_drag_size (part_id, &Float:dx, &Float:dy);
97native set_drag_size (part_id, Float:dx, Float:dy);
98native get_drag_step (part_id, &Float:dx, &Float:dy);
99native set_drag_step (part_id, Float:dx, Float:dy);
100native get_drag_page (part_id, &Float:dx, &Float:dy);
101native set_drag_page (part_id, Float:dx, Float:dy);
102native set_text (part_id, str[]);
103native get_text (part_id, dst[], maxlen);
104native get_min_size (&w, &h);
105native get_max_size (&w, &h);
106native get_color_class (class[], &r, &g, &b, &a);
107native set_color_class (class[], r, g, b, a);
108native set_text_class (class[], font[], Float:size);
109native get_text_class (class[], font[], &Float:size);
110native get_geometry (part_id, &x, &y, &w, &h);
111native get_mouse (&x, &y);
112native get_mouse_buttons();
113native stop_program (program_id);
114native stop_programs_on (part_id);
115native set_min_size (Float:w, Float:h);
116native set_max_size (Float:w, Float:h);
117native part_swallow (part_id, GROUP:str[]);
118
119native external_param_get_int(id, param_name[]);
120native external_param_set_int(id, param_name[], value);
121native Float:external_param_get_float(id, param_name[]);
122native external_param_set_float(id, param_name[], Float:value);
123native external_param_get_strlen(id, param_name[]);
124native external_param_get_str(id, param_name[], value[], value_maxlen);
125native external_param_set_str(id, param_name[], value[]);
126native external_param_get_choice_len(id, param_name[]);
127native external_param_get_choice(id, param_name[], value[], value_maxlen);
128native external_param_set_choice(id, param_name[], value[]);
129native external_param_get_bool(id, param_name[]);
130native external_param_set_bool(id, param_name[], value);
131
132enum Msg_Type
133{
134 MSG_NONE = 0,
135 MSG_STRING = 2,
136 MSG_INT = 3,
137 MSG_FLOAT = 4,
138 MSG_STRING_SET = 5,
139 MSG_INT_SET = 6,
140 MSG_FLOAT_SET = 7,
141 MSG_STRING_INT = 8,
142 MSG_STRING_FLOAT = 9,
143 MSG_STRING_INT_SET = 10,
144 MSG_STRING_FLOAT_SET = 11
145};
146
147native send_message(Msg_Type:type, id, ...);
148
149/**********************/
150/* Custom state calls */
151/**********************/
152
153/* Example:
154 *
155 * Create the custom state for "my_part", based on the
156 * default description of the same part:
157 *
158 * custom_state(PART:"my_part", "default", 0.0);
159 *
160 * Later, use set_state_val() to change the properties of the custom
161 * state:
162 *
163 * set_state_val(PART:"my_part", STATE_ALIGNMENT, 0.5, 0.5);
164 *
165 * get_state_val() works the same way.
166 */
167
168native custom_state(part_id, state[], Float:state_val = 0.0);
169
170enum State_Param
171{
172 STATE_ALIGNMENT = 1,
173 STATE_MIN = 2,
174 STATE_MAX = 3,
175 STATE_STEP = 4,
176 STATE_ASPECT = 5,
177 STATE_ASPECT_PREF = 6,
178 STATE_COLOR = 7,
179 STATE_COLOR2 = 8,
180 STATE_COLOR3 = 9,
181 STATE_COLOR_CLASS = 10,
182 STATE_REL1 = 11,
183 STATE_REL1_TO = 12,
184 STATE_REL1_OFFSET = 13,
185 STATE_REL2 = 14,
186 STATE_REL2_TO = 15,
187 STATE_REL2_OFFSET = 16,
188 STATE_IMAGE = 17,
189 STATE_BORDER = 18,
190 STATE_FILL_SMOOTH = 19,
191 STATE_FILL_POS = 20,
192 STATE_FILL_SIZE = 21,
193 STATE_TEXT = 22,
194 STATE_TEXT_CLASS = 23,
195 STATE_TEXT_FONT = 24,
196 STATE_TEXT_STYLE = 25,
197 STATE_TEXT_SIZE = 26,
198 STATE_TEXT_FIT = 27,
199 STATE_TEXT_MIN = 28,
200 STATE_TEXT_MAX = 29,
201 STATE_TEXT_ALIGN = 30,
202 STATE_VISIBLE = 31,
203 STATE_MAP_ON = 32,
204 STATE_MAP_PERSP = 33,
205 STATE_MAP_LIGHT = 34,
206 STATE_MAP_ROT_CENTER = 35,
207 STATE_MAP_ROT_X = 36,
208 STATE_MAP_ROT_Y = 37,
209 STATE_MAP_ROT_Z = 38,
210 STATE_MAP_BACK_CULL = 39,
211 STATE_MAP_PERSP_ON = 40,
212 STATE_PERSP_ZPLANE = 41,
213 STATE_PERSP_FOCAL = 42,
214 STATE_PHYSICS_MASS = 43,
215 STATE_PHYSICS_FRICTION = 44,
216 STATE_PHYSICS_RESTITUTION = 45,
217 STATE_PHYSICS_DAMPING = 46,
218 STATE_PHYSICS_SLEEP = 47,
219 STATE_PHYSICS_MATERIAL = 48,
220 STATE_PHYSICS_DENSITY = 49,
221 STATE_PHYSICS_IGNORE_PART_POS = 50,
222 STATE_PHYSICS_LIGHT_ON = 51,
223 STATE_PHYSICS_HARDNESS = 52,
224 STATE_PHYSICS_MOV_FREEDOM_LIN = 53,
225 STATE_PHYSICS_MOV_FREEDOM_ANG = 54,
226 STATE_PHYSICS_BACK_CULL = 55,
227 STATE_PHYSICS_Z = 56,
228 STATE_PHYSICS_DEPTH = 57
229};
230
231native set_state_val(part_id, State_Param:p, ...);
232native get_state_val(part_id, State_Param:p, ...);
233
234/* Multisense */
235native play_sample (sample_name[], Float:speed);
236native play_tone (tone_name[], Float:duration);
237
238/***********************************************************/
239/* Edje physics calls. */
240/***********************************************************/
241/* Example:
242 *
243 * physics_impulse(PART:"logo", 0, 50.8, 0);
244 * physics_torque_impulse(PART:"logo", 0, 0, 3.4);
245 *
246 * physics_force(PART:"logo", 0, 240, 0);
247 * physics_torque(PART:"logo", 0, 0, 2.2);
248 * physics_clear_forces(PART:"logo");
249 *
250 * physics_set_velocity(PART:"logo", 40.5, 0, 0);
251 * physics_set_ang_velocity(PART:"logo", 0, 0, -3);
252 * physics_stop(PART:"logo");
253 *
254 * physics_set_rotation(PART:"logo", 0.707, 0, 0, 0.707);
255 */
256native physics_impulse (part_id, Float:x, Float:y, Float:z);
257native physics_torque_impulse (part_id, Float:x, Float:y, Float:z);
258
259native physics_torque (part_id, Float:x, Float:y, Float:z);
260native physics_get_torques (part_id, &Float:x, &Float:y, &Float:z);
261native physics_force (part_id, Float:x, Float:y, Float:z);
262native physics_get_forces (part_id, &Float:x, &Float:y, &Float:z);
263native physics_clear_forces (part_id);
264
265native physics_set_velocity (part_id, Float:x, Float:y, Float:z);
266native physics_get_velocity (part_id, &Float:x, &Float:y, &Float:z);
267native physics_set_ang_velocity (part_id, Float:x, Float:y, Float:z);
268native physics_get_ang_velocity (part_id, &Float:x, &Float:y, &Float:z);
269native physics_stop (part_id);
270
271native physics_set_rotation (part_id, Float:w, Float:x, Float:y, Float:z);
272native physics_get_rotation (part_id, &Float:w, &Float:x, &Float:y, &Float:z);
diff --git a/data/edje/vim/autoload/edccomplete.vim b/data/edje/vim/autoload/edccomplete.vim
new file mode 100644
index 0000000000..e2521e9c42
--- /dev/null
+++ b/data/edje/vim/autoload/edccomplete.vim
@@ -0,0 +1,892 @@
1" Vim completion script
2" Language: EDC
3" Maintainer: Viktor Kojouharov
4" Last Change: 2007 02 24
5
6function! edccomplete#Complete(findstart, base)
7 if a:findstart
8 " locate the start of the word
9 let line = getline('.')
10 let start = col('.') - 1
11 let compl_begin = col('.') - 2
12 let lastword = -1
13 if line =~ ':' && line !~ '\.'
14 while start > 0 && (line[start - 1] =~ '\k' || line[start - 1] =~ '"')
15 let start -= 1
16 endwhile
17 else
18 while start > 0
19 if line[start - 1] =~ '\k'
20 let start -= 1
21 elseif line[start - 1] =~ '\.'
22 if lastword == -1
23 let lastword = start - 2
24 endif
25 let start -= 1
26 else
27 break
28 endif
29 endwhile
30 endif
31 let b:compl_context = getline('.')[0:compl_begin]
32
33 if lastword == -1
34 let ppe = searchpos('\.', 'bcn')
35 let pps = searchpos('\w\+\.', 'bcn')
36 let b:sparent = ''
37 if ppe != [0, 0] && pps[0] == ppe[0] && pps[1] <= ppe[1] && pps[0] == line('.')
38 let b:scontext = line[pps[1] -1 : ppe[1] - 2]
39 call edccomplete#FindParent(pps[0], pps[1])
40 return start
41 endif
42
43 let startpos = searchpair('{', '', '}', 'bnW')
44 let lnum = startpos
45 let line = getline(lnum)
46
47 if line !~ '\a\+'
48 let lnum = prevnonblank(lnum - 1)
49 let line = getline(lnum)
50 endif
51
52 call edccomplete#FindParent(lnum, 1)
53 let b:scontext = matchstr(line, '\w\+')
54
55 return start
56 else
57 let b:scontext = line[start : lastword]
58
59 return lastword + 2
60 endif
61 else
62 " find months matching with "a:base"
63 let res = []
64 if exists("b:compl_context")
65 let line = b:compl_context
66 unlet! b:compl_context
67 else
68 let line = a:base
69 endif
70
71 if b:scontext == 'part'
72 call edccomplete#AddLabel(res, line, a:base, s:partLabel)
73 call edccomplete#AddStatement(res, line, a:base, s:partStatement)
74 if line =~ 'type:\s*'
75 call edccomplete#AddKeyword(res, a:base, s:partTypes)
76 elseif line =~ 'effect:\s*'
77 call edccomplete#AddKeyword(res, a:base, s:partEffects)
78 elseif line =~ 'select_mode:\s*'
79 call edccomplete#AddKeyword(res, a:base, s:partSelectMode)
80 elseif line =~ 'ignore_flags:\s*'
81 call edccomplete#AddKeyword(res, a:base, s:partIgnoreFlags)
82 elseif line =~ 'pointer_mode:\s*'
83 call edccomplete#AddKeyword(res, a:base, s:partPointerMode)
84 elseif line =~ 'editable_mode:\s*'
85 call edccomplete#AddKeyword(res, a:base, s:partEditableMode)
86 endif
87 if line =~ 'image:\s*".\{-}"'
88 call edccomplete#AddKeyword(res, a:base, s:imageStorageMethod)
89 endif
90
91 elseif b:scontext == 'dragable'
92 call edccomplete#AddLabel(res, line, a:base, s:dragableLabel)
93
94 elseif b:scontext == 'description'
95 call edccomplete#AddLabel(res, line, a:base, s:descriptionLabel)
96 call edccomplete#AddStatement(res, line, a:base, s:descriptionStatement)
97 if line =~ 'aspect_preference:\s*'
98 call edccomplete#AddKeyword(res, a:base, s:aspectPrefTypes)
99 elseif line =~ 'inherit:\s*"\?'
100 call edccomplete#FindStates(res, a:base, 1)
101 endif
102
103 elseif b:scontext == 'rel1' || b:scontext == 'rel2'
104 call edccomplete#AddLabel(res, line, a:base, s:relLabel)
105 if line =~ 'to\%(_[xy]\)\?:\s*"\?'
106 call edccomplete#FindNamesIn(res, a:base, 'parts')
107 endif
108
109 elseif b:scontext == 'map'
110 call edccomplete#AddLabel(res, line, a:base, s:mapLabel)
111 call edccomplete#AddStatement(res, line, a:base, s:mapStatement)
112
113 elseif b:scontext == 'rotation'
114 call edccomplete#AddLabel(res, line, a:base, s:rotationLabel)
115
116 elseif b:scontext == 'perspective'
117 call edccomplete#AddLabel(res, line, a:base, s:perspectiveLabel)
118
119 elseif b:scontext == 'params'
120 call edccomplete#AddLabel(res, line, a:base, s:paramsLabel)
121
122 elseif b:scontext == 'image'
123 call edccomplete#AddLabel(res, line, a:base, s:imageLabel)
124 if line =~ 'image:\s*".\{-}"'
125 call edccomplete#AddKeyword(res, a:base, s:imageStorageMethod)
126 elseif line =~ 'middle:\s*'
127 call edccomplete#AddKeyword(res, a:base, s:imageMiddleTypes)
128 elseif line =~ 'scale_hint:\s*'
129 call edccomplete#AddKeyword(res, a:base, s:imageScaleHint)
130 endif
131
132 elseif b:scontext == 'fill'
133 call edccomplete#AddLabel(res, line, a:base, s:fillLabel)
134 call edccomplete#AddStatement(res, line, a:base, s:fillStatement)
135 if line =~ 'type:\s*'
136 call edccomplete#AddKeyword(res, a:base, s:fillTypes)
137 endif
138
139 elseif b:scontext == 'origin' || b:scontext == 'size'
140 call edccomplete#AddLabel(res, line, a:base, s:fillInnerStatement)
141
142 elseif b:scontext == 'text'
143 call edccomplete#AddLabel(res, line, a:base, s:textLabel)
144 call edccomplete#AddStatement(res, line, a:base, s:textStatement)
145
146 elseif b:scontext == 'program'
147 call edccomplete#AddLabel(res, line, a:base, s:programLabel)
148 call edccomplete#AddStatement(res, line, a:base, s:programStatement)
149 if line =~ 'transition:\s*'
150 call edccomplete#AddKeyword(res, a:base, s:transitionTypes)
151 elseif line =~ 'STATE_SET\s*"\?'
152 call edccomplete#FindStates(res, a:base, 0)
153 elseif line =~ 'action:\s*'
154 call edccomplete#AddKeyword(res, a:base, s:actionTypes)
155 elseif line =~ 'target:\s*"\?'
156 call edccomplete#FindNamesIn(res, a:base, 'parts')
157 elseif line =~ 'after:\s*"\?'
158 call edccomplete#FindNamesIn(res, a:base, 'programs')
159 endif
160
161 elseif b:scontext == 'programs'
162 call edccomplete#AddLabel(res, line, a:base, s:programsLabel)
163 call edccomplete#AddStatement(res, line, a:base, s:programsStatement)
164 if line =~ 'image:\s*".\{-}"'
165 call edccomplete#AddKeyword(res, a:base, s:imageStorageMethod)
166 endif
167
168 elseif b:scontext == 'box' && b:sparent == 'part'
169 call edccomplete#AddStatement(res, line, a:base, s:boxStatement)
170
171 elseif b:scontext == 'items'
172 call edccomplete#AddStatement(res, line, a:base, s:boxItemsStatement)
173
174 elseif b:scontext == 'item'
175 call edccomplete#AddLabel(res, line, a:base, s:boxItemLabel)
176 if line =~ 'type:\s*'
177 call edccomplete#AddKeyword(res, a:base, s:boxItemTypes)
178 elseif line =~ 'aspect_mode:\s*"\?'
179 call edccomplete#AddKeyword(res, a:base, s:boxItemAspectMode)
180 endif
181
182 elseif b:scontext == 'box' && b:sparent == 'description'
183 call edccomplete#AddLabel(res, line, a:base, s:boxDescLabel)
184 if line =~ 'layout:\s*'
185 call edccomplete#AddKeyword(res, a:base, s:boxLayout)
186 endif
187
188 elseif b:scontext == 'table' && b:sparent == 'description'
189 call edccomplete#AddLabel(res, line, a:base, s:tableDescLabel)
190 if line =~ 'homogeneous:\s*'
191 call edccomplete#AddKeyword(res, a:base, s:tableHomogeneousMode)
192 endif
193
194 elseif b:scontext == 'group'
195 call edccomplete#AddLabel(res, line, a:base, s:groupLabel)
196 call edccomplete#AddStatement(res, line, a:base, s:groupStatement)
197 if line =~ 'image:\s*".\{-}"'
198 call edccomplete#AddKeyword(res, a:base, s:imageStorageMethod)
199 endif
200
201 elseif b:scontext == 'parts'
202 call edccomplete#AddLabel(res, line, a:base, s:partsLabel)
203 call edccomplete#AddStatement(res, line, a:base, s:partsStatement)
204 if line =~ 'image:\s*".\{-}"'
205 call edccomplete#AddKeyword(res, a:base, s:imageStorageMethod)
206 endif
207
208 elseif b:scontext == 'data'
209 call edccomplete#AddLabel(res, line, a:base, s:dataLabel)
210
211 elseif b:scontext == 'fonts'
212 call edccomplete#AddLabel(res, line, a:base, s:fontsLabel)
213
214 elseif b:scontext == 'spectra'
215 call edccomplete#AddStatement(res, line, a:base, s:spectraStatement)
216
217 elseif b:scontext == 'spectrum'
218 call edccomplete#AddLabel(res, line, a:base, s:spectrumLabel)
219
220 elseif b:scontext == 'gradient'
221 call edccomplete#AddLabel(res, line, a:base, s:gradientLabel)
222 call edccomplete#AddStatement(res, line, a:base, s:gradientStatement)
223 if line =~ 'type:\s*'
224 call edccomplete#AddKeyword(res, a:base, s:gradientTypes)
225 endif
226
227 elseif b:scontext == 'styles'
228 call edccomplete#AddStatement(res, line, a:base, s:stylesStatement)
229
230 elseif b:scontext == 'style'
231 call edccomplete#AddLabel(res, line, a:base, s:styleLabel)
232
233 elseif b:scontext == 'color_classes'
234 call edccomplete#AddStatement(res, line, a:base, s:color_classesStatement)
235
236 elseif b:scontext == 'color_class'
237 call edccomplete#AddLabel(res, line, a:base, s:color_classLabel)
238
239 elseif b:scontext == 'images'
240 call edccomplete#AddLabel(res, line, a:base, s:imagesLabel)
241 if line =~ 'image:\s*".\{-}"'
242 call edccomplete#AddKeyword(res, a:base, s:imageStorageMethod)
243 endif
244
245 elseif b:scontext == 'collections'
246 call edccomplete#AddLabel(res, line, a:base, s:collectionsLabel)
247 call edccomplete#AddStatement(res, line, a:base, s:collectionsStatement)
248 if line =~ 'image:\s*".\{-}"'
249 call edccomplete#AddKeyword(res, a:base, s:imageStorageMethod)
250 endif
251
252 elseif b:scontext == 'externals'
253 call edccomplete#AddLabel(res, line, a:base, s:externalsLabel)
254
255 elseif strlen(b:scontext) == 0
256 call edccomplete#AddStatement(res, line, a:base, s:topStatement)
257 endif
258
259 unlet! b:scontext
260
261 return res
262 endif
263endfunction
264
265function! edccomplete#AddLabel(res, line, base, label)
266 if a:line =~ ':'
267 return
268 endif
269
270 for m in sort(keys(a:label))
271 if m =~ '^' . a:base
272 call add(a:res, {'word': m . ':', 'menu': a:label[m]})
273 endif
274 endfor
275endfunction
276
277function! edccomplete#AddKeyword(res, base, label)
278 for m in sort(keys(a:label))
279 if m =~ '^' . a:base
280 call add(a:res, {'word': m, 'menu': a:label[m]})
281 endif
282 endfor
283endfunction
284
285function! edccomplete#AddStatement(res, line, base, statement)
286 if a:line =~ ':'
287 return
288 endif
289
290 for m in sort(a:statement)
291 if m =~ '^' . a:base
292 call add(a:res, m . ' {')
293 endif
294 endfor
295endfunction
296
297function! edccomplete#FindStates(res, base, in_part)
298 let curpos = getpos('.')
299 call remove(curpos, 0, 0)
300
301 let states_list = []
302 if a:in_part == 1 " in the current part only
303 let part_start = search('^[ \t}]*\<part\>[ \t{]*$', 'bnW')
304 if part_start != 0 " found it
305 let line = getline(part_start)
306 if line !~ '{'
307 let part_start = nextnonblank(part_start)
308 endif
309 call cursor(part_start, 0)
310 let part_end = searchpair('{', '', '}', 'nW')
311 endif
312 else " in the current parts group
313 let part_start = search('^[ \t}]*\<parts\>[ \t{]*$', 'bnW')
314 if part_start != 0 " found it
315 let line = getline(part_start)
316 if line !~ '{'
317 let part_start = nextnonblank(part_start)
318 endif
319 call cursor(part_start, 0)
320 let part_end = searchpair('{', '', '}', 'nW')
321 endif
322 endif
323
324 let state_num = search('\%(state:\s*\)"\w\+"', 'W', part_end)
325 while state_num
326 let state = matchstr(getline(state_num), '\%(state:\s*\)\@<="\w\+"')
327 call extend(states_list, [state])
328 let state_num = search('\%(state:\s*\)"\w\+"', 'W', part_end)
329 endwhile
330 call cursor(curpos)
331
332 for m in sort(states_list)
333 if m =~ '^' . a:base
334 call add(a:res, m)
335 endif
336 endfor
337endfunction
338
339function! edccomplete#FindNamesIn(res, base, str)
340 let curpos = getpos('.')
341 call remove(curpos, 0, 0)
342
343 let names_list = []
344 let part_start = search('^[ \t}]*\<' . a:str . '\>[ \t{]*$', 'bnW')
345 if part_start != 0 " found it
346 let line = getline(part_start)
347 if line !~ '{'
348 let part_start = nextnonblank(part_start)
349 endif
350 call cursor(part_start, 0)
351 let part_end = searchpair('{', '', '}', 'nW')
352 endif
353
354 let name_num = search('\%(name:\s*\)"\w\+"', 'W', part_end)
355 while name_num
356 let name = matchstr(getline(name_num), '\%(name:\s*\)\@<="\w\+"')
357 call extend(names_list, [name])
358 let name_num = search('\%(name:\s*\)"\w\+"', 'W', part_end)
359 endwhile
360 call cursor(curpos)
361
362 for m in sort(names_list)
363 if m =~ '^' . a:base
364 call add(a:res, m)
365 endif
366 endfor
367endfunction
368
369function! edccomplete#FindParent(lnum, cnum)
370 call setpos('.', [0, a:lnum, a:cnum, 0])
371 let ppe = searchpos('\.', 'bcn')
372 let pps = searchpos('\w\+\.', 'bcn')
373 if ppe != [0, 0] && pps[0] == ppe[0] && pps[1] <= ppe[1] && pps[0] == line('.')
374 let b:sparent = line[pps[1] -1 : ppe[1] - 2]
375 return
376 endif
377
378 let startpos = searchpair('{', '', '}', 'bnW')
379 let lnum = startpos
380 let line = getline(lnum)
381
382 if line !~ '\a\+'
383 let line = getline(prevnonblank(lnum - 1))
384 endif
385
386 let b:sparent = matchstr(line, '\w\+')
387endfunction
388
389" part
390let s:partLabel = {
391 \ 'name': '"name"',
392 \ 'type': 'keyword',
393 \ 'effect': 'keyword',
394 \ 'clip_to': '"part_name"',
395 \ 'scale': '0-1',
396 \ 'mouse_events': '0-1',
397 \ 'repeat_events': '0-1',
398 \ 'ignore_flags': 'keyword ...',
399 \ 'pointer_mode': 'keyword',
400 \ 'select_mode': 'keyword',
401 \ 'precise_is_inside': '0-1',
402 \ 'use_alternate_font_metrics': '0-1',
403 \ 'image': '"filename" keyword',
404 \ 'font': '"filename" "name"',
405 \ 'entry_mode': 'keyword',
406 \ 'multiline': '0-1 (TEXTBLOCK only)',
407 \ 'source': '"group_name" (GROUP or TEXTBLOCK only)',
408 \ 'source2': '"group_name" (TEXTBLOCK only)',
409 \ 'source3': '"group_name" (TEXTBLOCK only)',
410 \ 'source4': '"group_name" (TEXTBLOCK only)',
411 \ 'source5': '"group_name" (TEXTBLOCK only)',
412 \ 'source6': '"group_name" (TEXTBLOCK only)',
413 \ }
414let s:partStatement = [
415 \ 'dragable',
416 \ 'images',
417 \ 'fonts',
418 \ 'description',
419 \ 'styles',
420 \ 'color_classes',
421 \ 'program',
422 \ 'programs',
423 \ 'box',
424 \ ]
425
426" dragable
427let s:dragableLabel = {
428 \ 'x': '0-1 int int',
429 \ 'y': '0-1 int int',
430 \ 'confine': '"part_name"',
431 \ 'events': '"draggable_part_name"',
432 \ }
433
434" description
435let s:descriptionLabel = {
436 \ 'state': '"name" index (float)',
437 \ 'inherit': '"description" index (float)',
438 \ 'visible': '0-1',
439 \ 'align': 'x y (float)',
440 \ 'fixed': 'width height (0-1)',
441 \ 'min': 'width height (int)',
442 \ 'max': 'width height (int)',
443 \ 'step': 'width height (int)',
444 \ 'aspect': 'min max (float)',
445 \ 'aspect_preference': 'keyword',
446 \ 'color_class': '"name"',
447 \ 'color': '0-255 0-255 0-255 0-255',
448 \ 'color2': '0-255 0-255 0-255 0-255',
449 \ 'color3': '0-255 0-255 0-255 0-255',
450 \ 'font': '"filename" "name"',
451 \ }
452let s:descriptionStatement = [
453 \ 'rel1',
454 \ 'rel2',
455 \ 'image',
456 \ 'fill',
457 \ 'text',
458 \ 'gradient',
459 \ 'images',
460 \ 'fonts',
461 \ 'styles',
462 \ 'color_classes',
463 \ 'program',
464 \ 'programs',
465 \ 'box',
466 \ 'map',
467 \ ]
468
469" rel
470let s:relLabel = {
471 \ 'relative': 'x y (float)',
472 \ 'offset': 'x y (int)',
473 \ 'to': '"part_name"',
474 \ 'to_x': '"part_name"',
475 \ 'to_y': '"part_name"',
476 \ }
477" map
478let s:mapLabel = {
479 \ 'on': '0-1',
480 \ 'perspective': '"part_name"',
481 \ 'light': '"part_name"',
482 \ 'smooth': '0-1',
483 \ 'pespective_on':'0-1',
484 \ 'backface_cull':'0-1',
485 \ 'alpha': '0-1',
486 \ }
487let s:mapStatement = [
488 \ 'rotation',
489 \ ]
490
491let s:rotationLabel = {
492 \ 'center': '"part_name"',
493 \ 'x': '"degrees (float)"',
494 \ 'y': '"degrees (float)"',
495 \ 'z': '"degrees (float)"',
496 \ }
497
498" params
499let s:paramsLabel = {
500 \ 'int': '"name" int',
501 \ 'double': '"name" double',
502 \ 'string': '"name" "string"',
503 \ }
504
505" perspective
506let s:perspectiveLabel = {
507 \ 'zplane': 'int',
508 \ 'focal': 'int',
509 \ }
510
511
512" image
513let s:imageLabel = {
514 \ 'image': '"filename" keyword',
515 \ 'normal': '"filename"',
516 \ 'tween': '"filename"',
517 \ 'border': 'left right top bottom (int)',
518 \ 'middle': 'keyword',
519 \ 'border_scale': '0-1',
520 \ 'scale_hint': 'keyword',
521 \ }
522
523" fill
524let s:fillLabel = {
525 \ 'smooth': '0-1',
526 \ 'angle': '0-360 (GRADIENT)',
527 \ 'spread': '0-1',
528 \ 'type': 'keyword',
529 \ }
530let s:fillStatement = [
531 \ 'origin',
532 \ 'size',
533 \ ]
534" fill origin/size
535let s:fillInnerStatement = {
536 \ 'relative': 'width height (float)',
537 \ 'offset': 'x y (int)',
538 \ }
539" fill types
540let s:fillTypes = {
541 \ 'SCALE': '',
542 \ 'TILE': '',
543 \ }
544
545" text
546let s:textLabel = {
547 \ 'text': '"string"',
548 \ 'font': '"font_name"',
549 \ 'size': 'size (int)',
550 \ 'text_class': '"class_name"',
551 \ 'fit': 'x y (0-1)',
552 \ 'min': 'x y (0-1)',
553 \ 'max': 'x y (0-1)',
554 \ 'align': 'x y (float)',
555 \ 'source': '"part_name"',
556 \ 'text_source': '"text_part_name"',
557 \ 'style': '"style_name"',
558 \ 'elipsis': '0.0-1.0',
559 \ 'repch': '"string" (PASSWORD mode)',
560 \ }
561let s:textStatement = [
562 \ 'fonts',
563 \ ]
564
565" program
566let s:programLabel = {
567 \ 'name': '"name"',
568 \ 'signal': '"signal_name"',
569 \ 'source': '"part_name"',
570 \ 'action': 'keyword ...',
571 \ 'transition': 'keyword time (float)',
572 \ 'filter': '"part_name" "state_name"',
573 \ 'in': 'from range (float)',
574 \ 'target': '"part_name"',
575 \ 'after': '"program_name"',
576 \ }
577let s:programStatement = [
578 \ 'script',
579 \ 'lua_script',
580 \ ]
581
582
583" programs
584let s:programsLabel = {
585 \ 'image': '"filename" keyword',
586 \ 'font': '"filename" "name"',
587 \ }
588let s:programsStatement = [
589 \ 'images',
590 \ 'fonts',
591 \ 'program',
592 \ ]
593
594" box and table
595let s:boxStatement = [
596 \ 'items',
597 \ ]
598let s:boxItemsStatement = [
599 \ 'item',
600 \ ]
601let s:boxItemLabel = {
602 \ 'type': 'keyword',
603 \ 'name': '"name"',
604 \ 'source': '"group_name"',
605 \ 'min': 'width height (int)',
606 \ 'prefer': 'width height (int)',
607 \ 'max': 'width height (int)',
608 \ 'padding': 'left right top bottom (int)',
609 \ 'align': 'x y (float)',
610 \ 'weight': 'x y (float)',
611 \ 'aspect': 'w h (float)',
612 \ 'aspect_mode': 'keyword',
613 \ 'options': '"extra options"',
614 \ }
615let s:boxDescLabel = {
616 \ 'layout': '"string" ["string"]',
617 \ 'align': 'float float',
618 \ 'padding': 'int int',
619 \ }
620let s:tableItemLabel = {
621 \ 'position': 'col row (int)',
622 \ 'span': 'col row (int)',
623 \ }
624let s:tableDescLabel = {
625 \ 'homogeneous': 'keyword',
626 \ 'align': 'float float',
627 \ 'padding': 'int int',
628 \ }
629
630" group
631let s:groupLabel = {
632 \ 'name': '"name"',
633 \ 'alias': '"alias"',
634 \ 'min': 'width height',
635 \ 'max': 'width height',
636 \ 'image': '"filename" keyword',
637 \ 'font': '"filename" "name"',
638 \ 'script_only': '0-1',
639 \ }
640let s:groupStatement = [
641 \ 'data',
642 \ 'script',
643 \ 'lua_script',
644 \ 'parts',
645 \ 'images',
646 \ 'fonts',
647 \ 'styles',
648 \ 'color_classes',
649 \ 'program',
650 \ 'programs',
651 \ 'externals',
652 \ ]
653
654" parts
655let s:partsStatement = [
656 \ 'images',
657 \ 'fonts',
658 \ 'part',
659 \ 'styles',
660 \ 'color_classes',
661 \ 'program',
662 \ 'programs',
663 \ ]
664let s:partsLabel = {
665 \ 'image': '"filename" keyword',
666 \ 'font': '"filename" "name"',
667 \ }
668
669" data
670let s:dataLabel = {
671 \ 'item': '"key" "value"',
672 \ 'file': '"key" "filename"',
673 \ }
674
675" fonts
676let s:fontsLabel = {
677 \ 'font': '"filename" "name"',
678 \ }
679
680"images
681let s:imagesLabel = {
682 \ 'image': '"filename" keyword',
683 \ }
684
685"collections
686let s:collectionsStatement = [
687 \ 'group',
688 \ 'images',
689 \ 'fonts',
690 \ 'styles',
691 \ 'color_classes',
692 \ 'externals',
693 \ ]
694let s:collectionsLabel = {
695 \ 'image': '"filename" keyword',
696 \ 'font': '"filename" "name"',
697 \ }
698
699" externals
700let s:externalsLabel = {
701 \ 'external': '"name"',
702 \ }
703
704" spectra
705let s:spectraStatement = [
706 \ 'spectrum',
707 \ ]
708" spectrum
709let s:spectrumLabel = {
710 \ 'name': '"name"',
711 \ 'color': '0-255 0-255 0-255 0-255',
712 \ }
713" gradient
714let s:gradientLabel = {
715 \ 'type': '"keyword"',
716 \ 'spectrum': '"spectrum_name"',
717 \ }
718let s:gradientStatement = [
719 \ 'rel1',
720 \ 'rel2',
721 \ ]
722" gradient types
723let s:gradientTypes = {
724 \ '"linear"': '',
725 \ '"radial"': '',
726 \ '"rectangular"': '',
727 \ '"angular"': '',
728 \ '"sinusoidal"': '',
729 \ }
730
731" styles
732let s:stylesStatement = [
733 \ 'style',
734 \ ]
735" style
736let s:styleLabel = {
737 \ 'name': '"name"',
738 \ 'base': '".. default style properties .."',
739 \ 'tag': '"tagname" "style properties"',
740 \ }
741
742" color_classes
743let s:color_classesStatement = [
744 \ 'color_class',
745 \ ]
746" color_class
747let s:color_classLabel = {
748 \ 'name': '"name"',
749 \ 'color': '0-255 0-255 0-255 0-255',
750 \ 'color2': '0-255 0-255 0-255 0-255',
751 \ 'color3': '0-255 0-255 0-255 0-255',
752 \ }
753
754" toplevel
755let s:topStatement = [
756 \ 'fonts',
757 \ 'images',
758 \ 'data',
759 \ 'collections',
760 \ 'spectra',
761 \ 'styles',
762 \ 'color_classes',
763 \ 'externals',
764 \ ]
765
766" images image storage method
767let s:imageStorageMethod = {
768 \ 'COMP': '',
769 \ 'RAW': '',
770 \ 'USER': '',
771 \ 'LOSSY': '0-100',
772 \ }
773" image middle types
774let s:imageMiddleTypes = {
775 \ '0': '',
776 \ '1': '',
777 \ 'NONE': '',
778 \ 'DEFAULT': '',
779 \ 'SOLID': '',
780 \ }
781" image scale hint
782let s:imageScaleHint = {
783 \ '0': '',
784 \ 'NONE': '',
785 \ 'DYNAMIC': '',
786 \ 'STATIC': '',
787 \ }
788
789" part types
790let s:partTypes = {
791 \ 'TEXT': '',
792 \ 'IMAGE': '',
793 \ 'RECT': '',
794 \ 'TEXTBLOCK': '',
795 \ 'SWALLOW': '',
796 \ 'GRADIENT': '',
797 \ 'GROUP': '',
798 \ 'BOX': '',
799 \ 'TABLE': '',
800 \ 'EXTERNAL': '',
801 \ }
802" part effects
803let s:partEffects = {
804 \ 'NONE': '',
805 \ 'PLAIN': '',
806 \ 'OUTLINE': '',
807 \ 'SOFT_OUTLINE': '',
808 \ 'SHADOW': '',
809 \ 'SOFT_SHADOW': '',
810 \ 'OUTLINE_SHADOW': '',
811 \ 'OUTLINE_SOFT_SHADOW': '',
812 \ 'FAR_SHADOW': '',
813 \ 'FAR_SOFT_SHADOW': '',
814 \ 'GLOW': '',
815 \ }
816" part select_mode
817let s:partSelectMode = {
818 \ 'DEFAULT': '',
819 \ 'EXPLICIT': '',
820 \ }
821" part ignore flags
822let s:partIgnoreFlags = {
823 \ 'NONE': '',
824 \ 'ON_HOLD': '',
825 \ }
826" part pointer mode
827let s:partPointerMode = {
828 \ 'AUTOGRAB': '',
829 \ 'NOGRAB': '',
830 \ }
831" part editable_mode
832let s:partEditableMode = {
833 \ 'NONE': '',
834 \ 'PLAIN': '',
835 \ 'EDITABLE': '',
836 \ 'PASSWORD': '',
837 \ }
838
839" aspect_preference types
840let s:aspectPrefTypes = {
841 \ 'VERTICAL': '',
842 \ 'HORIZONTAL': '',
843 \ 'BOTH': '',
844 \ }
845
846" program transition types
847let s:transitionTypes = {
848 \ 'LINEAR': '0.0 - 1.0',
849 \ 'SINUSOIDAL': '0.0 - 1.0',
850 \ 'ACCELERATE': '0.0 - 1.0',
851 \ 'DECELERATE': '0.0 - 1.0',
852 \ }
853" program action types
854let s:actionTypes = {
855 \ 'STATE_SET': '"string" "0.0 - 1.0"',
856 \ 'ACTION_STOP': '',
857 \ 'SIGNAL_EMIT': '"string" "string"',
858 \ 'DRAG_VAL_SET': 'float float',
859 \ 'DRAG_VAL_STEP': 'float float',
860 \ 'DRAG_VAL_PAGE': 'float float',
861 \ 'FOCUS_SET': '',
862 \ }
863" box item types
864let s:boxItemTypes = {
865 \ 'GROUP': '',
866 \ }
867" box item aspect mode
868let s:boxItemAspectMode = {
869 \ 'NONE': '',
870 \ 'NEITHER': '',
871 \ 'VERTICAL': '',
872 \ 'HORIZONTAL': '',
873 \ 'BOTH': '',
874 \ }
875" box layout
876let s:boxLayout = {
877 \ '"horizontal"': '',
878 \ '"horizontal_homogeneous"': '',
879 \ '"horizontal_max"': '',
880 \ '"horizontal_flow"': '',
881 \ '"vertical"': '',
882 \ '"vertical_homogeneous"': '',
883 \ '"vertical_max"': '',
884 \ '"vertical_flow"': '',
885 \ '"stack"': '',
886 \ }
887" table homogeneous mode
888let s:tableHomogeneousMode = {
889 \ 'NONE': '',
890 \ 'TABLE': '',
891 \ 'ITEM': '',
892 \ }
diff --git a/data/edje/vim/ftdetect/edc.vim b/data/edje/vim/ftdetect/edc.vim
new file mode 100644
index 0000000000..d8cc228c27
--- /dev/null
+++ b/data/edje/vim/ftdetect/edc.vim
@@ -0,0 +1,3 @@
1au BufRead,BufNewFile *.edc set filetype=edc
2au BufRead,BufNewFile *.sma set filetype=embryo
3au BufRead,BufNewFile *.embryo set filetype=embryo
diff --git a/data/edje/vim/ftplugin/edc.vim b/data/edje/vim/ftplugin/edc.vim
new file mode 100644
index 0000000000..5a90a56a6c
--- /dev/null
+++ b/data/edje/vim/ftplugin/edc.vim
@@ -0,0 +1,23 @@
1" Vim filetype plugin file
2" Language: EDC
3" Maintainer: Viktor Kojouharov
4" Latest Revision: 2006-10-29
5
6if exists("b:did_ftplugin")
7 finish
8endif
9let b:did_ftplugin = 1
10
11let b:undo_ftplugin = "setl com< cms< inc< fo< efm< mp<"
12
13setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
14setlocal commentstring=/*%s*/
15setlocal formatoptions-=t formatoptions+=croql
16setlocal include=^\s*#\s*include
17setlocal efm=edje_cc:%s.\ %f:%l\ %m
18setlocal mp=edje_cc\ %
19
20if exists('&ofu')
21 setlocal ofu=edccomplete#Complete
22 setlocal cfu=edccomplete#Complete
23endif
diff --git a/data/edje/vim/indent/edc.vim b/data/edje/vim/indent/edc.vim
new file mode 100644
index 0000000000..498be4a5b1
--- /dev/null
+++ b/data/edje/vim/indent/edc.vim
@@ -0,0 +1,83 @@
1" Vim indent file
2" Language: EDC
3" Maintainer: Viktor Kojouharov
4" Latest Revision: 2007 02 24
5
6if exists("b:did_indent")
7 finish
8endif
9let b:did_indent = 1
10
11setlocal indentexpr=GetEDCIndent()
12setlocal indentkeys=0{,0},!^F,o,O
13
14if exists("*GetEDCIndent")
15 finish
16endif
17
18function s:prevnonblanknoncomment(lnum)
19 let lnum = a:lnum
20 while lnum > 1
21 let lnum = prevnonblank(lnum)
22 let line = getline(lnum)
23 if line =~ '\*/'
24 while lnum > 1 && line !~ '/\*'
25 let lnum -= 1
26 endwhile
27 if line =~ '^\s*/\*'
28 let lnum -= 1
29 else
30 break
31 endif
32 elseif line =~ '^\s*//'
33 let lnum -= 1
34 else
35 break
36 endif
37 endwhile
38 return lnum
39endfunction
40
41function s:count_braces(lnum, count_open)
42 let n_open = 0
43 let n_close = 0
44 let line = getline(a:lnum)
45 let pattern = '[{}]'
46 let i = match(line, pattern)
47 while i != -1
48 if synIDattr(synID(a:lnum, i + 1, 0), 'name') !~ 'c\%(CommentL\|Comment\|StringQ\{1,2}\)'
49 if line[i] == '{'
50 let n_open += 1
51 elseif line[i] == '}'
52 if n_open > 0
53 let n_open -= 1
54 else
55 let n_close += 1
56 endif
57 endif
58 endif
59 let i = match(line, pattern, i + 1)
60 endwhile
61 return a:count_open ? n_open : n_close
62endfunction
63
64function GetEDCIndent()
65 let line = getline(v:lnum)
66 if line =~ '^\s*\*' || line =~ '^\s*//' || line =~ '^\s*}'
67 return cindent(v:lnum)
68 endif
69
70 let pnum = s:prevnonblanknoncomment(v:lnum - 1)
71 if pnum == 0
72 return 0
73 endif
74
75 let ind = indent(pnum) + s:count_braces(pnum, 1) * &sw
76
77 let pline = getline(pnum)
78 if pline =~ '}\s*$'
79 let ind -= (s:count_braces(pnum, 0) - (pline =~ '^\s*}' ? 1 : 0)) * &sw
80 endif
81
82 return ind
83endfunction
diff --git a/data/edje/vim/plugin-info.txt b/data/edje/vim/plugin-info.txt
new file mode 100644
index 0000000000..e01cb420e4
--- /dev/null
+++ b/data/edje/vim/plugin-info.txt
@@ -0,0 +1,8 @@
1{
2 "name" : "edje",
3 "version" : "dev",
4 "author" : "viktor kojouharov <vkojouharov at gmail.com>",
5 "repository" : {"type": "svn", "url": "http://svn.enlightenment.org/svn/e/trunk/edje/data/vim/"},
6 "dependencies" : {},
7 "description" : "Edje vim support addon"
8}
diff --git a/data/edje/vim/snippets/edc.snippets b/data/edje/vim/snippets/edc.snippets
new file mode 100644
index 0000000000..bb93e42265
--- /dev/null
+++ b/data/edje/vim/snippets/edc.snippets
@@ -0,0 +1,99 @@
1snippet col
2 collections {
3 ${1}
4 }
5
6snippet images
7 images {
8 ${1}
9 }
10
11snippet image
12 image: "${1:.png}" COMP;
13
14snippet group
15 group { name: "${1}";
16 ${2}
17 parts {
18 ${3}
19 }
20 }
21
22snippet part
23 part { name: "${1}";
24 type: ${2:RECT};
25 mouse_events: 0;
26 description { state: "default" 0.0;
27 visible: 1;
28 color: 255 255 255 255;
29 rel1 {
30 to_x: "${2:bg}";
31 to_y: "${3:bg}";
32 relative: 0.0 0.0;
33 offset: 0 0;
34 }
35 rel2 {
36 to_x: "${4:bg}";
37 to_y: "${5:bg}";
38 relative: 1.0 1.0;
39 offset: -1 -1;
40 }
41 }
42 }
43
44snippet bg
45 part { name: "${1:bg}";
46 type: RECT;
47 mouse_events: 0;
48 description { state: "default" 0.0;
49 visible: 1;
50 color: 0 0 0 0;
51 }
52 }
53
54snippet event
55 part { name: "${1:event}";
56 type: RECT;
57 mouse_events: 1;
58 description { state: "default" 0.0;
59 visible: 1;
60 color: 0 0 0 0;
61 }
62 }
63
64snippet IMAGE
65 part { name: "${1:image}";
66 type: IMAGE;
67 mouse_events: 0;
68 description { state: "default" 0.0;
69 visible: 1;
70 image {
71 normal: "${2}";
72 border: 0 0 0 0;
73 middle: 1;
74 }
75 }
76 }
77
78snippet desc
79 description { state: "${1}" ${2:0.0};
80 inherit: "default" 0.0;
81 ${3}
82 }
83
84snippet programs
85 programs {
86 ${1}
87 }
88
89snippet program
90 program { name: "${1}";
91 ${2}
92 }
93
94snippet clicked
95 program { name: "${1:mouse_clicked}";
96 signal: "mouse,clicked,${2:1}";
97 source: "${2:event}";
98 action: SIGNAL_EMIT "${3}" "${4}";
99 }
diff --git a/data/edje/vim/syntax/edc.vim b/data/edje/vim/syntax/edc.vim
new file mode 100644
index 0000000000..e21c01810d
--- /dev/null
+++ b/data/edje/vim/syntax/edc.vim
@@ -0,0 +1,235 @@
1" Vim syntax file
2" Language: EDC
3" Maintainer: Viktor Kojouharov
4" Last Change: 2007 02 24
5
6" For version 5.x: Clear all syntax items
7" For version 6.x: Quit when a syntax file was already loaded
8if version < 600
9 syntax clear
10elseif exists("b:current_syntax")
11 finish
12endif
13
14" A bunch of useful keywords
15syn keyword edcBlock images data fonts collections group contained
16syn keyword edcBlock part parts dragable description contained
17syn keyword edcBlock text font fill origin size image contained
18syn keyword edcBlock programs program styles style contained
19syn keyword edcBlock gradient spectra spectrum contained
20syn keyword edcBlock color_classes color_class rel1 rel2 contained
21syn keyword edcBlock items item file params externals contained
22syn keyword edcBlock map rotation perspective script lua_script contained
23
24syn keyword edcLabel item name alias min max type effect contained
25syn keyword edcLabel mouse_events repeat_events clip_to contained
26syn keyword edcLabel x y z confine events scale contained
27syn keyword edcLabel ignore_flags precise_is_inside contained
28syn keyword edcLabel use_alternate_font_metrics entry_mode contained
29syn keyword edcLabel source source2 source3 source4 contained
30syn keyword edcLabel source5 source6 multiline pointer_mode contained
31syn keyword edcLabel state visible step aspect fixed middle contained
32syn keyword edcLabel aspect_preference ellipsis elipsis image contained
33syn keyword edcLabel relative offset to to_x to_y contained
34syn keyword edcLabel border border_scale scale_hint color color2 color3 font size contained
35syn keyword edcLabel signal action transition in filter contained
36syn keyword edcLabel target after fit align contained
37syn keyword edcLabel text smooth inherit tag base style contained
38syn keyword edcLabel text_source color_class text_class contained
39syn keyword edcLabel spectrum angle spread normal tween contained
40syn keyword edcLabel padding prefer weight aspect_mode contained
41syn keyword edcLabel options layout position span contained
42syn keyword edcLabel homogeneous contained
43syn keyword edcLabel on perspective light perspective_on contained
44syn keyword edcLabel backface_cull alpha center focus zplane contained
45syn keyword edcLabel int double string external script_only contained
46
47syn keyword edcConstant COMP RAW LOSSY NONE ON_HOLD AUTOGRAB NOGRAB
48syn keyword edcConstant TEXT IMAGE RECT TEXTBLOCK SWALLOW GRADIENT GROUP
49syn keyword edcConstant NONE PLAIN OUTLINE SOFT_OUTLINE SHADOW
50syn keyword edcConstant SOFT_SHADOW OUTLINE_SHADOW OUTLINE_SOFT_SHADOW
51syn keyword edcConstant GLOW FAR_SHADOW FAR_SOFT_SHADOW
52syn keyword edcConstant STATE_SET ACTION_STOP SIGNAL_EMIT FOCUS_SET
53syn keyword edcConstant DRAG_VAL_SET DRAG_VAL_STEP DRAG_VAL_PAGE
54syn keyword edcConstant LINEAR SINUSOIDAL ACCELERATE DECELERATE
55syn keyword edcConstant VERTICAL HORIZONTAL BOTH BOX TABLE
56syn keyword edcConstant EDITABLE PASSWORD "default"
57
58syn keyword edcTodo contained TODO FIXME XXX
59
60syn match edcLabelMatch "\w\+:" contains=edcLabel
61syn match edcBlockMatch "\w\+\_s*{" contains=edcBlock
62syn match edcBlockMatch "\w\+\.\a"me=e-2 contains=edcBlock
63" edcCommentGroup allows adding matches for special things in comments
64syn cluster edcCommentGroup contains=edcTodo
65
66" String and Character constants
67" Highlight special characters (those which have a backslash) differently
68syn match edcSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
69syn region edcString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=edcSpecial
70syn match edcFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([diuoxXfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
71syn match edcFormat display "%%" contained
72syn region edcString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat
73
74syn match edcCharacter "L\='[^\\]'"
75syn match edcCharacter "L'[^']*'" contains=edcSpecial
76syn match edcSpecialError "L\='\\[^'\"?\\abfnrtv]'"
77syn match edcSpecialCharacter "L\='\\['\"?\\abfnrtv]'"
78syn match edcSpecialCharacter display "L\='\\\o\{1,3}'"
79syn match edcSpecialCharacter display "'\\x\x\{1,2}'"
80syn match edcSpecialCharacter display "L'\\x\x\+'"
81
82"when wanted, highlight trailing white space
83if exists("edc_space_errors")
84 if !exists("edc_no_trail_space_error")
85 syn match edcSpaceError display excludenl "\s\+$"
86 endif
87 if !exists("edc_no_tab_space_error")
88 syn match edcSpaceError display " \+\t"me=e-1
89 endif
90endif
91
92"catch errors caused by wrong parenthesis and brackets
93syn cluster edcParenGroup contains=edcParenError,edcIncluded,edcSpecial,edcCommentSkip,edcCommentString,edcComment2String,@edcCommentGroup,edcCommentStartError,edcUserCont,edcUserLabel,edcBitField,edcCommentSkip,edcOctalZero,edcFormat,edcNumber,edcFloat,edcOctal,edcOctalError,edcNumbersCom
94if exists("edc_no_bracket_error")
95 syn region edcParen transparent start='(' end=')' contains=ALLBUT,@edcParenGroup
96 syn match edcParenError display ")"
97 syn match edcErrInParen display contained "[{}]"
98else
99 syn region edcParen transparent start='(' end=')' contains=ALLBUT,@edcParenGroup,edcErrInBracket
100 syn match edcParenError display "[\])]"
101 syn match edcErrInParen display contained "[\]{}]"
102 syn region edcBracket transparent start='\[' end=']' contains=ALLBUT,@edcParenGroup,edcErrInParen
103 syn match edcErrInBracket display contained "[);{}]"
104endif
105
106"integer number, or floating point number without a dot and with "f".
107syn case ignore
108syn match edcNumbers display transparent "\<\d\|\.\d" contains=edcNumber,edcFloat,edcOctalError,edcOctal
109" Same, but without octal error (for comments)
110syn match edcNumbersCom display contained transparent "\<\d\|\.\d" contains=edcNumber,edcFloat,edcOctal
111syn match edcNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
112"hex number
113syn match edcNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
114" Flag the first zero of an octal number as something special
115syn match edcOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=edcOctalZero
116syn match edcOctalZero display contained "\<0"
117syn match edcFloat display contained "\d\+f"
118"floating point number, with dot, optional exponent
119syn match edcFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
120"floating point number, starting with a dot, optional exponent
121syn match edcFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
122"floating point number, without dot, with exponent
123syn match edcFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>"
124" flag an octal number with wrong digits
125syn match edcOctalError display contained "0\o*[89]\d*"
126syn case match
127
128if exists("edc_comment_strings")
129 " A comment can contain edcString, edcCharacter and edcNumber.
130 " But a "*/" inside a edcString in a edcComment DOES end the comment! So we
131 " need to use a special type of edcString: edcCommentString, which also ends
132 " on "*/", and sees a "*" at the start of the line as comment again.
133 " Unfortunately this doesn't very well work for // type of comments :-(
134 syntax match edcCommentSkip contained "^\s*\*\($\|\s\+\)"
135 syntax region edcCommentString contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=edcSpecial,edcCommentSkip
136 syntax region edcComment2String contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=edcSpecial
137 syntax region edcCommentL start="//" skip="\\$" end="$" keepend contains=@edcCommentGroup,edcComment2String,edcCharacter,edcNumbersCom,edcSpaceError
138 syntax region edcComment matchgroup=edcCommentStart start="/\*" matchgroup=NONE end="\*/" contains=@edcCommentGroup,edcCommentStartError,edcCommentString,edcCharacter,edcNumbersCom,edcSpaceError
139else
140 syn region edcCommentL start="//" skip="\\$" end="$" keepend contains=@edcCommentGroup,edcSpaceError
141 syn region edcComment matchgroup=edcCommentStart start="/\*" matchgroup=NONE end="\*/" contains=@edcCommentGroup,edcCommentStartError,edcSpaceError
142endif
143" keep a // comment separately, it terminates a preproc. conditional
144syntax match edcCommentError display "\*/"
145syntax match edcCommentStartError display "/\*"me=e-1 contained
146
147syn region edcPreCondit start="^\s*#\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=edcComment,edcCharacter,edcParenError,edcNumbers,edcCommentError,edcSpaceError
148syn match edcPreCondit display "^\s*#\s*\(else\|endif\)\>"
149syn region edcIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
150syn match edcIncluded display contained "<[^>]*>"
151syn match edcInclude display "^\s*#\s*include\>\s*["<]" contains=edcIncluded
152syn cluster edcPreProcGroup contains=edcPreCondit,edcIncluded,edcInclude,edcDefine,edcErrInParen,edcErrInBracket,edcCommentSkip,edcCommentString,edcComment2String,@edcCommentGroup,edcCommentStartError,edcParen,edcBracket,edcMulti,edcUserLabel
153syn cluster edcAlphaNum contains=edcSpecial,edcOctalZero,edcFormat,edcNumber,edcFloat,edcOctal,edcOctalError,edcNumbersCom,edcString
154syn region edcDefine start="^\s*#\s*\(define\|undef\)\>" skip="\\$" end="$" end="//"me=s-1 contains=ALLBUT,@edcPreProcGroup
155syn region edcPreProc start="^\s*#\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@edcPreProcGroup
156
157syn match edcUserLabel display "\I\i*" contained
158
159syn include @edcEmbryo syntax/embryo.vim
160unlet b:current_syntax
161syn region edcScript matchgroup=edcScriptTag start="\<script\_s*{" end="}" contains=@edcEmbryo,edcScriptTag
162syn keyword edcScriptTag contained script
163
164syn include @edcLua syntax/lua.vim
165unlet b:current_syntax
166syn region edcLuaScript matchgroup=edcLuaScriptTag start="\<lua_script\_s*{" end="}" contains=@edcLua,edcLuaScriptTag
167syn keyword edcLuaScriptTag contained script
168
169if exists("edc_minlines")
170 let b:edc_minlines = edc_minlines
171else
172 let b:edc_minlines = 50 " #if 0 constructs can be long
173endif
174exec "syn sync ccomment edcComment minlines=" . b:edc_minlines
175"syn sync fromstart
176
177" Define the default highlighting.
178" For version 5.7 and earlier: only when not done already
179" For version 5.8 and later: only when an item doesn't have highlighting yet
180if version >= 508 || !exists("did_edc_syn_inits")
181 if version < 508
182 let did_edc_syn_inits = 1
183 command -nargs=+ HiLink hi link <args>
184 else
185 command -nargs=+ HiLink hi def link <args>
186 endif
187
188 HiLink edcFormat edcSpecial
189 HiLink edcCommentL edcComment
190 HiLink edcCommentStart edcComment
191 HiLink edcLabel Label
192 HiLink edcUserLabel Label
193 HiLink edcConditional Conditional
194 HiLink edcRepeat Repeat
195 HiLink edcCharacter Character
196 HiLink edcSpecialCharacter cSpecial
197 HiLink edcNumber Number
198 HiLink edcOctal Number
199 HiLink edcOctalZero PreProc " link this to Error if you want
200 HiLink edcFloat Float
201 HiLink edcOctalError edcError
202 HiLink edcParenError edcError
203 HiLink edcErrInParen edcError
204 HiLink edcErrInBracket edcError
205 HiLink edcCommentError edcError
206 HiLink edcCommentStartError edcError
207 HiLink edcSpaceError edcError
208 HiLink edcSpecialError edcError
209 HiLink edcOperator Operator
210 HiLink edcStructure Structure
211 HiLink edcStorageClass StorageClass
212 HiLink edcInclude Include
213 HiLink edcPreProc PreProc
214 HiLink edcDefine Macro
215 HiLink edcIncluded edcString
216 HiLink edcError Error
217 HiLink edcBlock Function
218 HiLink edcScriptTag Function
219 HiLink edcLuaScriptTag Function
220 HiLink edcPreCondit PreCondit
221 HiLink edcConstant Constant
222 HiLink edcCommentString edcString
223 HiLink edcComment2String edcString
224 HiLink edcCommentSkip edcComment
225 HiLink edcString String
226 HiLink edcComment Comment
227 HiLink edcSpecial SpecialChar
228 HiLink edcTodo Todo
229
230 delcommand HiLink
231endif
232
233let b:current_syntax = "edc"
234
235" vim: ts=8
diff --git a/data/edje/vim/syntax/embryo.vim b/data/edje/vim/syntax/embryo.vim
new file mode 100644
index 0000000000..11175d893f
--- /dev/null
+++ b/data/edje/vim/syntax/embryo.vim
@@ -0,0 +1,195 @@
1" Vim syntax file
2" Language: Embryo
3" Maintainer: Viktor Kojouharov
4" Last Change: 2006 10 06
5
6" For version 5.x: Clear all syntax items
7" For version 6.x: Quit when a syntax file was already loaded
8if version < 600
9 syntax clear
10elseif exists("b:current_syntax")
11 finish
12endif
13
14" A bunch of useful keywords
15syn keyword embryoConditional if else switch
16syn keyword embryoRepeat while for do in
17syn keyword embryoBranch break continue
18syn keyword embryoOperator new
19syn keyword embryoType Float State_Param Msg_Type enum
20syn keyword embryoStatement return with native stock forward
21syn keyword embryoLabel case default
22syn keyword embryoReserved public
23syn keyword embryoEdjeKey PART PROGRAM
24
25syn keyword embryoTodo contained TODO FIXME XXX
26
27" embryoCommentGroup allows adding matches for special things in comments
28syn cluster embryoCommentGroup contains=embryoTodo
29
30" String and Character constants
31" Highlight special characters (those which have a backslash) differently
32syn match embryoSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
33syn region embryoString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=embryoSpecial
34syn match embryoFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([diuoxXfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
35syn match embryoFormat display "%%" contained
36syn region embryoString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat
37
38syn match embryoCharacter "L\='[^\\]'"
39syn match embryoCharacter "L'[^']*'" contains=embryoSpecial
40syn match embryoSpecialError "L\='\\[^'\"?\\abfnrtv]'"
41syn match embryoSpecialCharacter "L\='\\['\"?\\abfnrtv]'"
42syn match embryoSpecialCharacter display "L\='\\\o\{1,3}'"
43syn match embryoSpecialCharacter display "'\\x\x\{1,2}'"
44syn match embryoSpecialCharacter display "L'\\x\x\+'"
45
46"when wanted, highlight trailing white space
47if exists("embryo_space_errors")
48 if !exists("embryo_no_trail_space_error")
49 syn match embryoSpaceError display excludenl "\s\+$"
50 endif
51 if !exists("embryo_no_tab_space_error")
52 syn match embryoSpaceError display " \+\t"me=e-1
53 endif
54endif
55
56"catch errors caused by wrong parenthesis and brackets
57syn cluster embryoParenGroup contains=embryoParenError,embryoIncluded,embryoSpecial,embryoCommentSkip,embryoCommentString,embryoComment2String,@embryoCommentGroup,embryoCommentStartErr,embryoUserCont,embryoUserLabel,embryoBitField,embryoCommentSkip,embryoOctalZero,embryoFormat,embryoNumber,embryoFloat,embryoOctal,embryoOctalError,embryoNumbersCom
58if exists("embryo_no_bracket_error")
59 syn region embryoParen transparent start='(' end=')' contains=ALLBUT,@embryoParenGroup
60 syn match embryoParenError display ")"
61 syn match embryoErrInParen display contained "[{}]"
62else
63 syn region embryoParen transparent start='(' end=')' contains=ALLBUT,@embryoParenGroup,embryoErrInBracket
64 syn match embryoParenError display "[\])]"
65 syn match embryoErrInParen display contained "[\]{}]"
66 syn region embryoBracket transparent start='\[' end=']' contains=ALLBUT,@embryoParenGroup,embryoErrInParen
67 syn match embryoErrInBracket display contained "[);{}]"
68endif
69
70syn region embryoBrace start='{' end='}' transparent
71"integer number, or floating point number without a dot and with "f".
72syn case ignore
73syn match embryoNumbers display transparent "\<\d\|\.\d" contains=embryoNumber,embryoFloat,embryoOctalError,embryoOctal
74" Same, but without octal error (for comments)
75syn match embryoNumbersCom display contained transparent "\<\d\|\.\d" contains=embryoNumber,embryoFloat,embryoOctal
76syn match embryoNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
77"hex number
78syn match embryoNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
79" Flag the first zero of an octal number as something special
80syn match embryoOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=embryoOctalZero
81syn match embryoOctalZero display contained "\<0"
82syn match embryoFloat display contained "\d\+f"
83"floating point number, with dot, optional exponent
84syn match embryoFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
85"floating point number, starting with a dot, optional exponent
86syn match embryoFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
87"floating point number, without dot, with exponent
88syn match embryoFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>"
89" flag an octal number with wrong digits
90syn match embryoOctalError display contained "0\o*[89]\d*"
91syn case match
92
93if exists("embryo_comment_strings")
94 " A comment can contain embryoString, embryoCharacter and embryoNumber.
95 " But a "*/" inside a embryoString in a embryoComment DOES end the comment! So we
96 " need to use a special type of embryoString: embryoCommentString, which also ends
97 " on "*/", and sees a "*" at the start of the line as comment again.
98 " Unfortunately this doesn't very well work for // type of comments :-(
99 syntax match embryoCommentSkip contained "^\s*\*\($\|\s\+\)"
100 syntax region embryoCommentString contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=embryoSpecial,embryoCommentSkip
101 syntax region embryoComment2String contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=embryoSpecial
102 syntax region embryoCommentL start="//" skip="\\$" end="$" keepend contains=@embryoCommentGroup,embryoComment2String,embryoCharacter,embryoNumbersCom,embryoSpaceError
103 syntax region embryoComment matchgroup=embryoCommentStart start="/\*" matchgroup=NONE end="\*/" contains=@embryoCommentGroup,embryoCommentStartErr,embryoCommentString,embryoCharacter,embryoNumbersCom,embryoSpaceError
104else
105 syn region embryoCommentL start="//" skip="\\$" end="$" keepend contains=@embryoCommentGroup,embryoSpaceError
106 syn region embryoComment matchgroup=embryoCommentStart start="/\*" matchgroup=NONE end="\*/" contains=@embryoCommentGroup,embryoCommentStartErr,embryoSpaceError
107endif
108" keep a // comment separately, it terminates a preproc. conditional
109syntax match embryoCommentError display "\*/"
110syntax match embryoCommentStartErr display "/\*"me=e-1 contained
111
112syn region embryoPreCondit start="^\s*#\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=embryoComment,embryoCharacter,embryoParenError,embryoNumbers,embryoCommentError,embryoSpaceError
113syn match embryoPreCondit display "^\s*#\s*\(else\|endif\)\>"
114syn region embryoIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
115syn match embryoIncluded display contained "<[^>]*>"
116syn match embryoInclude display "^\s*#\s*include\>\s*["<]" contains=embryoIncluded
117syn cluster embryoPreProcGroup contains=embryoPreCondit,embryoIncluded,embryoInclude,embryoDefine,embryoErrInParen,embryoErrInBracket,embryoCommentSkip,embryoCommentString,embryoComment2String,@embryoCommentGroup,embryoCommentStartErr,embryoParen,embryoBracket,embryoMulti,embryoUserLabel
118syn cluster embryoAlphaNum contains=embryoSpecial,embryoOctalZero,embryoFormat,embryoNumber,embryoFloat,embryoOctal,embryoOctalError,embryoNumbersCom,embryoString
119syn region embryoDefine start="^\s*#\s*\(define\|undef\)\>" skip="\\$" end="$" end="//"me=s-1 contains=ALLBUT,@embryoPreProcGroup
120syn region embryoPreProc start="^\s*#\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@embryoPreProcGroup
121
122syn match embryoUserLabel display "\I\i*" contained
123
124syn match embryoFunctionName "\h\w*\s*\%((\@=\)"
125
126if exists("embryo_minlines")
127 let b:embryo_minlines = embryo_minlines
128else
129 let b:embryo_minlines = 50 " #if 0 constructs can be long
130endif
131exec "syn sync ccomment embryoComment minlines=" . b:embryo_minlines
132"syn sync fromstart
133
134" Define the default highlighting.
135" For version 5.7 and earlier: only when not done already
136" For version 5.8 and later: only when an item doesn't have highlighting yet
137if version >= 508 || !exists("did_embryo_syn_inits")
138 if version < 508
139 let did_embryo_syn_inits = 1
140 command -nargs=+ HiLink hi link <args>
141 else
142 command -nargs=+ HiLink hi def link <args>
143 endif
144
145 HiLink embryoFormat embryoSpecial
146 HiLink embryoCommentL embryoComment
147 HiLink embryoCommentStart embryoComment
148 HiLink embryoLabel Label
149 HiLink embryoUserLabel Label
150 HiLink embryoConditional Conditional
151 HiLink embryoRepeat Repeat
152 HiLink embryoBranch Conditional
153 HiLink embryoReserved Keyword
154 HiLink embryoCharacter Character
155 HiLink embryoSpecialCharacter cSpecial
156 HiLink embryoNumber Number
157 HiLink embryoOctal Number
158 HiLink embryoOctalZero PreProc " link this to Error if you want
159 HiLink embryoFloat Float
160 HiLink embryoOctalError embryoError
161 HiLink embryoParenError embryoError
162 HiLink embryoErrInParen embryoError
163 HiLink embryoErrInBracket embryoError
164 HiLink embryoCommentError embryoError
165 HiLink embryoCommentStartErr embryoError
166 HiLink embryoSpaceError embryoError
167 HiLink embryoSpecialError embryoError
168 HiLink embryoOperator Operator
169 HiLink embryoStructure Structure
170 HiLink embryoEdjeKey Structure
171 HiLink embryoStorageClass StorageClass
172 HiLink embryoInclude Include
173 HiLink embryoPreProc PreProc
174 HiLink embryoDefine Macro
175 HiLink embryoIncluded embryoString
176 HiLink embryoError Error
177 HiLink embryoStatement Statement
178 HiLink embryoPreCondit PreCondit
179 HiLink embryoType Type
180 HiLink embryoConstant Constant
181 HiLink embryoCommentString embryoString
182 HiLink embryoComment2String embryoString
183 HiLink embryoCommentSkip embryoComment
184 HiLink embryoString String
185 HiLink embryoComment Comment
186 HiLink embryoSpecial SpecialChar
187 HiLink embryoTodo Todo
188 HiLink embryoFunctionName Function
189
190 delcommand HiLink
191endif
192
193let b:current_syntax = "embryo"
194
195" vim: ts=8