After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 463 KiB |
After Width: | Height: | Size: 6.9 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 791 B |
After Width: | Height: | Size: 449 B |
After Width: | Height: | Size: 196 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1002 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 19 KiB |
|
@ -0,0 +1,2 @@
|
||||||
|
usr/bin/evas_*
|
||||||
|
usr/share/evas/data/*.png
|
|
@ -0,0 +1,5 @@
|
||||||
|
usr/bin/evas-config
|
||||||
|
usr/include/*
|
||||||
|
usr/lib/lib*.a
|
||||||
|
usr/lib/lib*.so
|
||||||
|
usr/lib/lib*.la
|
|
@ -0,0 +1,2 @@
|
||||||
|
usr/lib/lib*.so.*
|
||||||
|
usr/share/evas/data/*.ttf
|
|
@ -0,0 +1,55 @@
|
||||||
|
H1 { text-align: center; color: #333333}
|
||||||
|
CAPTION { font-weight: bold }
|
||||||
|
A:link { text-decoration: none; color: #444444; }
|
||||||
|
A:visited { text-decoration: none; color: #666666; }
|
||||||
|
A:hover { text-decoration: none; color: #ffffff; }
|
||||||
|
A.qindex { text-decoration: none; }
|
||||||
|
A.qindexRef { text-decoration: none; }
|
||||||
|
A.el { text-decoration: none; color: #555555; }
|
||||||
|
A.elRef { text-decoration: none; color: #555555; }
|
||||||
|
A.code { text-decoration: none; font-weight: normal; color: #555555; }
|
||||||
|
A.codeRef { text-decoration: none; font-weight: normal; color: #555555; }
|
||||||
|
DL.el { margin-left: -1cm }
|
||||||
|
DIV.fragment { width: 100%; border: none; background-color: #dddddd }
|
||||||
|
DIV.ah { background-color: black; color: #eeeeee; margin-bottom: 3px; margin-top: 3px }
|
||||||
|
TD.md { background-color: #aaaaaa; color: #000088; }
|
||||||
|
TD.mdname1 { color: #880000; }
|
||||||
|
TD.mdname { color: #880000; width: 600px; }
|
||||||
|
DIV.groupHeader { margin-left: 10px; margin-top: 10px; margin-bottom: 10px; font-weight: bold }
|
||||||
|
DIV.groupText { margin-left: 10px; font-style: italic; font-size: smaller }
|
||||||
|
BODY {
|
||||||
|
background: #999999;
|
||||||
|
color: #222222;
|
||||||
|
font-family: times;
|
||||||
|
}
|
||||||
|
TD.indexkey {
|
||||||
|
background-color: #99aaaa;
|
||||||
|
font-weight: bold;
|
||||||
|
padding-right : 10px;
|
||||||
|
padding-top : 2px;
|
||||||
|
padding-left : 10px;
|
||||||
|
padding-bottom : 2px;
|
||||||
|
margin-left : 0px;
|
||||||
|
margin-right : 0px;
|
||||||
|
margin-top : 2px;
|
||||||
|
margin-bottom : 2px
|
||||||
|
}
|
||||||
|
TD.indexvalue {
|
||||||
|
background-color: #aa99aa;
|
||||||
|
font-style: italic;
|
||||||
|
padding-right : 10px;
|
||||||
|
padding-top : 2px;
|
||||||
|
padding-left : 10px;
|
||||||
|
padding-bottom : 2px;
|
||||||
|
margin-left : 0px;
|
||||||
|
margin-right : 0px;
|
||||||
|
margin-top : 2px;
|
||||||
|
margin-bottom : 2px
|
||||||
|
}
|
||||||
|
span.keyword { color: #008000 }
|
||||||
|
span.keywordtype { color: #604020 }
|
||||||
|
span.keywordflow { color: #e08000 }
|
||||||
|
span.comment { color: #800000 }
|
||||||
|
span.preprocessor { color: #806020 }
|
||||||
|
span.stringliteral { color: #002080 }
|
||||||
|
span.charliteral { color: #008080 }
|
|
@ -0,0 +1,2 @@
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,16 @@
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
|
||||||
|
<title>$title</title>
|
||||||
|
<link href=evas.css rel=stylesheet type=text/css>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<table border=0 cellpadding=4 cellspacing=0 width=100%>
|
||||||
|
<tr>
|
||||||
|
<td><img src=evas_small.png width=48 height=48 alt=E></td>
|
||||||
|
<td width=100% align=center valign=middle><font face=helvetica size=2 color=#000000>E : V : A : S</font></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
|
@ -0,0 +1,149 @@
|
||||||
|
%!PS-Adobe-2.0 EPSF-2.0
|
||||||
|
%%Title: evas.eps
|
||||||
|
%%Creator: fig2dev Version 3.2 Patchlevel 3c
|
||||||
|
%%CreationDate: Wed Oct 23 16:18:00 2002
|
||||||
|
%%For: raster@dugong.fluffyspider.com.au (The Rasterman)
|
||||||
|
%%BoundingBox: 0 0 404 396
|
||||||
|
%%Magnification: 1.0000
|
||||||
|
%%EndComments
|
||||||
|
/$F2psDict 200 dict def
|
||||||
|
$F2psDict begin
|
||||||
|
$F2psDict /mtrx matrix put
|
||||||
|
/col-1 {0 setgray} bind def
|
||||||
|
/col0 {0.000 0.000 0.000 srgb} bind def
|
||||||
|
/col1 {0.000 0.000 1.000 srgb} bind def
|
||||||
|
/col2 {0.000 1.000 0.000 srgb} bind def
|
||||||
|
/col3 {0.000 1.000 1.000 srgb} bind def
|
||||||
|
/col4 {1.000 0.000 0.000 srgb} bind def
|
||||||
|
/col5 {1.000 0.000 1.000 srgb} bind def
|
||||||
|
/col6 {1.000 1.000 0.000 srgb} bind def
|
||||||
|
/col7 {1.000 1.000 1.000 srgb} bind def
|
||||||
|
/col8 {0.000 0.000 0.560 srgb} bind def
|
||||||
|
/col9 {0.000 0.000 0.690 srgb} bind def
|
||||||
|
/col10 {0.000 0.000 0.820 srgb} bind def
|
||||||
|
/col11 {0.530 0.810 1.000 srgb} bind def
|
||||||
|
/col12 {0.000 0.560 0.000 srgb} bind def
|
||||||
|
/col13 {0.000 0.690 0.000 srgb} bind def
|
||||||
|
/col14 {0.000 0.820 0.000 srgb} bind def
|
||||||
|
/col15 {0.000 0.560 0.560 srgb} bind def
|
||||||
|
/col16 {0.000 0.690 0.690 srgb} bind def
|
||||||
|
/col17 {0.000 0.820 0.820 srgb} bind def
|
||||||
|
/col18 {0.560 0.000 0.000 srgb} bind def
|
||||||
|
/col19 {0.690 0.000 0.000 srgb} bind def
|
||||||
|
/col20 {0.820 0.000 0.000 srgb} bind def
|
||||||
|
/col21 {0.560 0.000 0.560 srgb} bind def
|
||||||
|
/col22 {0.690 0.000 0.690 srgb} bind def
|
||||||
|
/col23 {0.820 0.000 0.820 srgb} bind def
|
||||||
|
/col24 {0.500 0.190 0.000 srgb} bind def
|
||||||
|
/col25 {0.630 0.250 0.000 srgb} bind def
|
||||||
|
/col26 {0.750 0.380 0.000 srgb} bind def
|
||||||
|
/col27 {1.000 0.500 0.500 srgb} bind def
|
||||||
|
/col28 {1.000 0.630 0.630 srgb} bind def
|
||||||
|
/col29 {1.000 0.750 0.750 srgb} bind def
|
||||||
|
/col30 {1.000 0.880 0.880 srgb} bind def
|
||||||
|
/col31 {1.000 0.840 0.000 srgb} bind def
|
||||||
|
|
||||||
|
end
|
||||||
|
save
|
||||||
|
newpath 0 396 moveto 0 0 lineto 404 0 lineto 404 396 lineto closepath clip newpath
|
||||||
|
-8.0 450.0 translate
|
||||||
|
1 -1 scale
|
||||||
|
|
||||||
|
/cp {closepath} bind def
|
||||||
|
/ef {eofill} bind def
|
||||||
|
/gr {grestore} bind def
|
||||||
|
/gs {gsave} bind def
|
||||||
|
/sa {save} bind def
|
||||||
|
/rs {restore} bind def
|
||||||
|
/l {lineto} bind def
|
||||||
|
/m {moveto} bind def
|
||||||
|
/rm {rmoveto} bind def
|
||||||
|
/n {newpath} bind def
|
||||||
|
/s {stroke} bind def
|
||||||
|
/sh {show} bind def
|
||||||
|
/slc {setlinecap} bind def
|
||||||
|
/slj {setlinejoin} bind def
|
||||||
|
/slw {setlinewidth} bind def
|
||||||
|
/srgb {setrgbcolor} bind def
|
||||||
|
/rot {rotate} bind def
|
||||||
|
/sc {scale} bind def
|
||||||
|
/sd {setdash} bind def
|
||||||
|
/ff {findfont} bind def
|
||||||
|
/sf {setfont} bind def
|
||||||
|
/scf {scalefont} bind def
|
||||||
|
/sw {stringwidth} bind def
|
||||||
|
/tr {translate} bind def
|
||||||
|
/tnt {dup dup currentrgbcolor
|
||||||
|
4 -2 roll dup 1 exch sub 3 -1 roll mul add
|
||||||
|
4 -2 roll dup 1 exch sub 3 -1 roll mul add
|
||||||
|
4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
|
||||||
|
bind def
|
||||||
|
/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
|
||||||
|
4 -2 roll mul srgb} bind def
|
||||||
|
/DrawEllipse {
|
||||||
|
/endangle exch def
|
||||||
|
/startangle exch def
|
||||||
|
/yrad exch def
|
||||||
|
/xrad exch def
|
||||||
|
/y exch def
|
||||||
|
/x exch def
|
||||||
|
/savematrix mtrx currentmatrix def
|
||||||
|
x y tr xrad yrad sc 0 0 1 startangle endangle arc
|
||||||
|
closepath
|
||||||
|
savematrix setmatrix
|
||||||
|
} def
|
||||||
|
|
||||||
|
/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
|
||||||
|
/$F2psEnd {$F2psEnteredState restore end} def
|
||||||
|
|
||||||
|
$F2psBegin
|
||||||
|
%%Page: 1 1
|
||||||
|
10 setmiterlimit
|
||||||
|
0.06000 0.06000 sc
|
||||||
|
%
|
||||||
|
% Fig objects follow
|
||||||
|
%
|
||||||
|
% Ellipse
|
||||||
|
n 3450 4200 3300 3300 0 360 DrawEllipse gs 0.00 setgray ef gr
|
||||||
|
% Ellipse
|
||||||
|
n 3825 4200 3000 3000 0 360 DrawEllipse gs col7 1.00 shd ef gr
|
||||||
|
% Ellipse
|
||||||
|
n 1725 4200 600 600 0 360 DrawEllipse gs 0.00 setgray ef gr
|
||||||
|
% Ellipse
|
||||||
|
n 6238 4200 600 600 0 360 DrawEllipse gs 0.00 setgray ef gr
|
||||||
|
% Rotated Ellipse
|
||||||
|
gs
|
||||||
|
3225 4200 tr
|
||||||
|
-90.000 rot
|
||||||
|
n 0 0 600 600 0 360 DrawEllipse 90.000 rot
|
||||||
|
gs 0.00 setgray ef gr gr
|
||||||
|
|
||||||
|
% Rotated Ellipse
|
||||||
|
gs
|
||||||
|
4725 4200 tr
|
||||||
|
-270.001 rot
|
||||||
|
n 0 0 600 600 0 360 DrawEllipse 270.001 rot
|
||||||
|
gs 0.00 setgray ef gr gr
|
||||||
|
|
||||||
|
% Rotated Ellipse
|
||||||
|
gs
|
||||||
|
3225 4132 tr
|
||||||
|
-90.000 rot
|
||||||
|
n 0 0 545 545 0 360 DrawEllipse 90.000 rot
|
||||||
|
gs col7 1.00 shd ef gr gr
|
||||||
|
|
||||||
|
% Rotated Ellipse
|
||||||
|
gs
|
||||||
|
4725 4268 tr
|
||||||
|
-270.001 rot
|
||||||
|
n 0 0 545 545 0 360 DrawEllipse 270.001 rot
|
||||||
|
gs col7 1.00 shd ef gr gr
|
||||||
|
|
||||||
|
% Arc
|
||||||
|
n 6306.0 4200.0 545.0 180.0 0.0 arc
|
||||||
|
6306.0 4200.0 l 5761.0 4200.0 l gs col7 1.00 shd ef gr
|
||||||
|
% Arc
|
||||||
|
n 6170.0 4200.0 545.0 180.0 0.0 arcn
|
||||||
|
6170.0 4200.0 l 5625.0 4200.0 l gs col7 1.00 shd ef gr
|
||||||
|
$F2psEnd
|
||||||
|
rs
|
|
@ -0,0 +1,25 @@
|
||||||
|
#FIG 3.2
|
||||||
|
Landscape
|
||||||
|
Center
|
||||||
|
Inches
|
||||||
|
Letter
|
||||||
|
500.00
|
||||||
|
Single
|
||||||
|
-2
|
||||||
|
1200 2
|
||||||
|
6 150 900 6825 7500
|
||||||
|
1 4 0 0 0 0 48 0 20 0.000 1 0.0000 1725 4200 600 600 1125 4200 2325 4200
|
||||||
|
1 4 0 0 0 0 50 0 20 0.000 1 0.0000 3450 4200 3300 3300 150 4200 6750 4200
|
||||||
|
1 4 0 0 0 7 49 0 20 0.000 1 0.0000 3825 4200 3000 3000 825 4200 6825 4200
|
||||||
|
-6
|
||||||
|
6 5625 3600 6900 4800
|
||||||
|
6 5625 3600 6900 4800
|
||||||
|
5 2 0 0 0 7 30 0 20 0.000 0 0 0 0 6306.000 4200.000 5761 4200 6306 3655 6851 4200
|
||||||
|
5 2 0 0 0 7 30 0 20 0.000 0 1 0 0 6170.000 4200.000 5625 4200 6170 4745 6715 4200
|
||||||
|
-6
|
||||||
|
1 4 0 0 0 0 40 0 20 0.000 1 0.0000 6238 4200 600 600 5638 4200 6838 4200
|
||||||
|
-6
|
||||||
|
1 4 0 0 0 0 40 0 20 0.000 1 1.5708 3225 4200 600 600 3225 4800 3225 3600
|
||||||
|
1 4 0 0 0 7 39 0 20 0.000 1 1.5708 3225 4132 545 545 3225 4677 3225 3587
|
||||||
|
1 4 0 0 0 0 40 0 20 0.000 1 4.7124 4725 4200 600 600 4725 3600 4725 4800
|
||||||
|
1 4 0 0 0 7 39 0 20 0.000 1 4.7124 4725 4268 545 545 4725 3723 4725 4813
|
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 47 KiB |
After Width: | Height: | Size: 2.9 KiB |
|
@ -0,0 +1,3 @@
|
||||||
|
## Process this file with automake to produce Makefile.in
|
||||||
|
|
||||||
|
SUBDIRS = win32_gdi
|
|
@ -0,0 +1,11 @@
|
||||||
|
EXTRA_DIST = \
|
||||||
|
evaslib.vcb \
|
||||||
|
evaslib.vcl \
|
||||||
|
evaslib.vco \
|
||||||
|
evaslib.vcp \
|
||||||
|
evaslib.vcw \
|
||||||
|
evas_software_win32.vcb \
|
||||||
|
evas_software_win32.vcl \
|
||||||
|
evas_software_win32.vco \
|
||||||
|
evas_software_win32.vcp \
|
||||||
|
evas_software_win32.vcw
|
|
@ -0,0 +1,130 @@
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<pre>
|
||||||
|
<h1>Build Log</h1>
|
||||||
|
<h3>
|
||||||
|
--------------------Configuration: evas_software_win32 - Win32 (WCE emulator) Debug--------------------
|
||||||
|
</h3>
|
||||||
|
<h3>Command Lines</h3>
|
||||||
|
Creating command line "rc.exe /l 0x409 /fo"emulatorDbg/evas_software_win32.res" /i "\Projects\mbed\evas\src\bin\evas_software_win32" /d "WCE_PLATFORM_STANDARDSDK" /d UNDER_CE=400 /d _WIN32_WCE=400 /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "_X86_" /d "x86" /d "_i386_" /r "C:\Projects\mbed\evas\src\bin\evas_software_win32\evas_software_win32.rc""
|
||||||
|
Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP1E8.tmp" with contents
|
||||||
|
[
|
||||||
|
/nologo /W3 /Zi /Od /I "..\..\\" /I "..\..\src\bin" /I "..\..\src\lib" /D "DEBUG" /D "_i386_" /D "i_386_" /D "_X86_" /D "x86" /D UNDER_CE=400 /D _WIN32_WCE=400 /D "WCE_PLATFORM_STANDARDSDK" /D "UNICODE" /D "_UNICODE" /FR"emulatorDbg/" /Fo"emulatorDbg/" /Fd"emulatorDbg/" /Gs8192 /GF /c
|
||||||
|
"C:\Projects\mbed\evas\src\bin\evas_software_win32\evas_software_win32.cpp"
|
||||||
|
]
|
||||||
|
Creating command line "cl.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP1E8.tmp"
|
||||||
|
Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP1E9.tmp" with contents
|
||||||
|
[
|
||||||
|
/nologo /W3 /Zi /Od /I "..\..\\" /I "..\..\src\bin" /I "..\..\src\lib" /D "DEBUG" /D "_i386_" /D "i_386_" /D "_X86_" /D "x86" /D UNDER_CE=400 /D _WIN32_WCE=400 /D "WCE_PLATFORM_STANDARDSDK" /D "MBCS" /D "_MBCS" /FR"emulatorDbg/" /Fo"emulatorDbg/" /Fd"emulatorDbg/" /Gs8192 /GF /c
|
||||||
|
"C:\Projects\mbed\evas\src\bin\evas_test_main.c"
|
||||||
|
"C:\Projects\mbed\evas\src\bin\evas_software_win32\StdAfx.cpp"
|
||||||
|
]
|
||||||
|
Creating command line "cl.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP1E9.tmp"
|
||||||
|
Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP1EA.tmp" with contents
|
||||||
|
[
|
||||||
|
commctrl.lib coredll.lib corelibc.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /incremental:yes /pdb:"emulatorDbg/evas_software_win32.pdb" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:libc.lib /nodefaultlib:libcd.lib /nodefaultlib:libcmt.lib /nodefaultlib:libcmtd.lib /nodefaultlib:msvcrt.lib /nodefaultlib:msvcrtd.lib /out:"emulatorDbg/evas_software_win32.exe" /subsystem:windowsce,4.00 /MACHINE:IX86
|
||||||
|
.\emulatorDbg\evas_software_win32.obj
|
||||||
|
.\emulatorDbg\evas_test_main.obj
|
||||||
|
.\emulatorDbg\StdAfx.obj
|
||||||
|
.\emulatorDbg\evas_software_win32.res
|
||||||
|
.\emulatorDbg\evaslib.lib
|
||||||
|
]
|
||||||
|
Creating command line "link.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP1EA.tmp"
|
||||||
|
<h3>Output Window</h3>
|
||||||
|
Compiling resources...
|
||||||
|
Compiling...
|
||||||
|
evas_software_win32.cpp
|
||||||
|
C:\Projects\mbed\evas\src\bin\evas_software_win32\evas_software_win32.cpp(195) : warning C4101: 'szHello' : unreferenced local variable
|
||||||
|
Compiling...
|
||||||
|
evas_test_main.c
|
||||||
|
C:\Projects\mbed\evas\src\bin\evas_test_main.c(91) : warning C4244: 'function' : conversion from 'double ' to 'int ', possible loss of data
|
||||||
|
C:\Projects\mbed\evas\src\bin\evas_test_main.c(324) : warning C4101: 'iw' : unreferenced local variable
|
||||||
|
C:\Projects\mbed\evas\src\bin\evas_test_main.c(324) : warning C4101: 'ih' : unreferenced local variable
|
||||||
|
C:\Projects\mbed\evas\src\bin\evas_test_main.c(358) : warning C4101: 'iw' : unreferenced local variable
|
||||||
|
C:\Projects\mbed\evas\src\bin\evas_test_main.c(358) : warning C4101: 'ih' : unreferenced local variable
|
||||||
|
C:\Projects\mbed\evas\src\bin\evas_test_main.c(394) : warning C4101: 'iw' : unreferenced local variable
|
||||||
|
C:\Projects\mbed\evas\src\bin\evas_test_main.c(394) : warning C4101: 'ih' : unreferenced local variable
|
||||||
|
Generating Code...
|
||||||
|
Compiling...
|
||||||
|
StdAfx.cpp
|
||||||
|
C:\Projects\mbed\evas\src\bin\evas_test_main.c(91) : warning C4761: integral size mismatch in argument; conversion supplied
|
||||||
|
Generating Code...
|
||||||
|
Linking...
|
||||||
|
evaslib.lib(evas_callbacks.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_clip.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_events.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_layer.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_main.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_name.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_object_gradient.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_object_image.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_object_line.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_object_main.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_object_polygon.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_object_rectangle.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_object_text.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_rectangle.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_render.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_stack.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_hash.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_list.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_object_list.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_blend_alpha_color_pixel.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_blend_color_pixel.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_blend_main.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_blend_pixel_cmod_pixel.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_blend_pixel_mul_pixel.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_blend_pixel_pixel.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_blit_main.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_convert_main.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_convert_rgb_16.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_convert_rgb_32.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_cpu.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_draw_main.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_font_draw.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_font_load.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_font_main.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_font_query.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_gradient_main.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_image_load.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_image_main.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_line_main.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_polygon_main.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_rectangle_main.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_scale_main.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_scale_sample.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_scale_smooth.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_tiler.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_engine.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_outbuf.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_win32_buffer.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_win32_main.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(evas_path.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(winfnt.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(type42.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(type1.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(truetype.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(smooth.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(sfnt.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(raster.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(psmodule.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(pshinter.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(psaux.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(pfr.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(pcf.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(type1cid.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(cff.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(bdf.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(ftsystem.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(ftinit.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(ftglyph.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(ftbase.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
evaslib.lib(autohint.obj) : warning LNK4204: 'C:\Projects\mbed\evas\proj\win32_gdi\emulatorDbg\vc60.pdb' is missing debugging information for referencing module; linking object as if no debug info
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h3>Results</h3>
|
||||||
|
evas_software_win32.exe - 0 error(s), 79 warning(s)
|
||||||
|
</pre>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,41 @@
|
||||||
|
Microsoft eMbedded Visual Tools Workspace File, Format Version 4.00
|
||||||
|
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
Project: "evas_software_win32"=.\evas_software_win32.vcp - Package Owner=<4>
|
||||||
|
|
||||||
|
Package=<5>
|
||||||
|
{{{
|
||||||
|
}}}
|
||||||
|
|
||||||
|
Package=<4>
|
||||||
|
{{{
|
||||||
|
}}}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
Project: "evaslib"=.\evaslib.vcp - Package Owner=<4>
|
||||||
|
|
||||||
|
Package=<5>
|
||||||
|
{{{
|
||||||
|
}}}
|
||||||
|
|
||||||
|
Package=<4>
|
||||||
|
{{{
|
||||||
|
}}}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
Global:
|
||||||
|
|
||||||
|
Package=<5>
|
||||||
|
{{{
|
||||||
|
}}}
|
||||||
|
|
||||||
|
Package=<3>
|
||||||
|
{{{
|
||||||
|
}}}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
|
@ -0,0 +1,292 @@
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<pre>
|
||||||
|
<h1>Build Log</h1>
|
||||||
|
<h3>
|
||||||
|
--------------------Configuration: evaslib - Win32 (WCE emulator) Debug--------------------
|
||||||
|
</h3>
|
||||||
|
<h3>Command Lines</h3>
|
||||||
|
Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP1E5.tmp" with contents
|
||||||
|
[
|
||||||
|
/nologo /W3 /Zi /Od /I "..\..\lib" /I "..\\" /I "..\..\lib\include" /I "..\..\\" /I "..\..\src\bin" /I "..\..\src\lib" /I "..\..\src\lib\include" /I "..\..\..\freetype-2.1.2\include" /I "..\..\..\libpng-1.2.4" /I "..\..\..\zlib" /I "..\..\..\jpeg-6b" /D "DEBUG" /D "_i386_" /D "_X86_" /D "x86" /D _WIN32_WCE=400 /D "WCE_PLATFORM_STANDARDSDK" /D UNDER_CE=400 /D "MBCS" /D "_MBCS" /D "_LIB" /Fo"emulatorDbg/" /Fd"emulatorDbg/" /Gs8192 /GF /c
|
||||||
|
"C:\Projects\mbed\evas\src\lib\canvas\evas_callbacks.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\canvas\evas_clip.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\canvas\evas_data.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\canvas\evas_events.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\canvas\evas_layer.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\canvas\evas_main.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\canvas\evas_name.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\canvas\evas_object_gradient.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\canvas\evas_object_image.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\canvas\evas_object_line.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\canvas\evas_object_main.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\canvas\evas_object_polygon.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\canvas\evas_object_rectangle.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\canvas\evas_object_text.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\canvas\evas_rectangle.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\canvas\evas_render.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\canvas\evas_stack.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\data\evas_hash.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\data\evas_list.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\data\evas_object_list.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_blend_alpha_color_pixel.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_blend_color_pixel.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_blend_main.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_blend_pixel_cmod_pixel.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_blend_pixel_mul_pixel.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_blend_pixel_pixel.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_blit_main.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_color.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_gry_1.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_gry_4.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_gry_8.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_main.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_rgb_16.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_rgb_24.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_rgb_32.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_rgb_8.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_cpu.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_font_draw.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_font_load.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_font_main.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_font_query.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_gradient_main.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_image_load.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_image_main.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_line_main.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_polygon_main.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_rectangle_main.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_scale_main.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_scale_sample.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_scale_smooth.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\common\evas_tiler.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\software_win32_gdi\evas_engine.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\software_win32_gdi\evas_outbuf.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\software_win32_gdi\evas_win32_buffer.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\engines\software_win32_gdi\evas_win32_main.c"
|
||||||
|
"C:\Projects\mbed\evas\src\lib\file\evas_path.c"
|
||||||
|
]
|
||||||
|
Creating command line "cl.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP1E5.tmp"
|
||||||
|
Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP1E6.tmp" with contents
|
||||||
|
[
|
||||||
|
/nologo /out:"emulatorDbg\evaslib.lib"
|
||||||
|
.\emulatorDbg\evas_callbacks.obj
|
||||||
|
.\emulatorDbg\evas_clip.obj
|
||||||
|
.\emulatorDbg\evas_data.obj
|
||||||
|
.\emulatorDbg\evas_events.obj
|
||||||
|
.\emulatorDbg\evas_layer.obj
|
||||||
|
.\emulatorDbg\evas_main.obj
|
||||||
|
.\emulatorDbg\evas_name.obj
|
||||||
|
.\emulatorDbg\evas_object_gradient.obj
|
||||||
|
.\emulatorDbg\evas_object_image.obj
|
||||||
|
.\emulatorDbg\evas_object_line.obj
|
||||||
|
.\emulatorDbg\evas_object_main.obj
|
||||||
|
.\emulatorDbg\evas_object_polygon.obj
|
||||||
|
.\emulatorDbg\evas_object_rectangle.obj
|
||||||
|
.\emulatorDbg\evas_object_text.obj
|
||||||
|
.\emulatorDbg\evas_rectangle.obj
|
||||||
|
.\emulatorDbg\evas_render.obj
|
||||||
|
.\emulatorDbg\evas_stack.obj
|
||||||
|
.\emulatorDbg\evas_hash.obj
|
||||||
|
.\emulatorDbg\evas_list.obj
|
||||||
|
.\emulatorDbg\evas_object_list.obj
|
||||||
|
.\emulatorDbg\evas_blend_alpha_color_pixel.obj
|
||||||
|
.\emulatorDbg\evas_blend_color_pixel.obj
|
||||||
|
.\emulatorDbg\evas_blend_main.obj
|
||||||
|
.\emulatorDbg\evas_blend_pixel_cmod_pixel.obj
|
||||||
|
.\emulatorDbg\evas_blend_pixel_mul_pixel.obj
|
||||||
|
.\emulatorDbg\evas_blend_pixel_pixel.obj
|
||||||
|
.\emulatorDbg\evas_blit_main.obj
|
||||||
|
.\emulatorDbg\evas_convert_color.obj
|
||||||
|
.\emulatorDbg\evas_convert_gry_1.obj
|
||||||
|
.\emulatorDbg\evas_convert_gry_4.obj
|
||||||
|
.\emulatorDbg\evas_convert_gry_8.obj
|
||||||
|
.\emulatorDbg\evas_convert_main.obj
|
||||||
|
.\emulatorDbg\evas_convert_rgb_16.obj
|
||||||
|
.\emulatorDbg\evas_convert_rgb_24.obj
|
||||||
|
.\emulatorDbg\evas_convert_rgb_32.obj
|
||||||
|
.\emulatorDbg\evas_convert_rgb_8.obj
|
||||||
|
.\emulatorDbg\evas_cpu.obj
|
||||||
|
.\emulatorDbg\evas_draw_main.obj
|
||||||
|
.\emulatorDbg\evas_font_draw.obj
|
||||||
|
.\emulatorDbg\evas_font_load.obj
|
||||||
|
.\emulatorDbg\evas_font_main.obj
|
||||||
|
.\emulatorDbg\evas_font_query.obj
|
||||||
|
.\emulatorDbg\evas_gradient_main.obj
|
||||||
|
.\emulatorDbg\evas_image_load.obj
|
||||||
|
.\emulatorDbg\evas_image_main.obj
|
||||||
|
.\emulatorDbg\evas_line_main.obj
|
||||||
|
.\emulatorDbg\evas_polygon_main.obj
|
||||||
|
.\emulatorDbg\evas_rectangle_main.obj
|
||||||
|
.\emulatorDbg\evas_scale_main.obj
|
||||||
|
.\emulatorDbg\evas_scale_sample.obj
|
||||||
|
.\emulatorDbg\evas_scale_smooth.obj
|
||||||
|
.\emulatorDbg\evas_tiler.obj
|
||||||
|
.\emulatorDbg\evas_engine.obj
|
||||||
|
.\emulatorDbg\evas_outbuf.obj
|
||||||
|
.\emulatorDbg\evas_win32_buffer.obj
|
||||||
|
.\emulatorDbg\evas_win32_main.obj
|
||||||
|
.\emulatorDbg\evas_path.obj
|
||||||
|
"..\..\..\freetype-2.1.2\builds\win32\evisualc\emulatorDbg\freetype212.lib"
|
||||||
|
"..\..\..\jpeg-6b\wince\libjpeg\emulatorDbg\libjpeg.lib"
|
||||||
|
"..\..\..\libpng-1.2.4\projects\wince\emulatorDbg\lpngce.lib"
|
||||||
|
]
|
||||||
|
Creating command line "link.exe -lib @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP1E6.tmp"
|
||||||
|
<h3>Output Window</h3>
|
||||||
|
Compiling...
|
||||||
|
evas_callbacks.c
|
||||||
|
evas_clip.c
|
||||||
|
evas_data.c
|
||||||
|
evas_events.c
|
||||||
|
evas_layer.c
|
||||||
|
evas_main.c
|
||||||
|
evas_name.c
|
||||||
|
evas_object_gradient.c
|
||||||
|
evas_object_image.c
|
||||||
|
C:\Projects\mbed\evas\src\lib\canvas\evas_object_image.c(706) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data
|
||||||
|
C:\Projects\mbed\evas\src\lib\canvas\evas_object_image.c(710) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data
|
||||||
|
C:\Projects\mbed\evas\src\lib\canvas\evas_object_image.c(975) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data
|
||||||
|
C:\Projects\mbed\evas\src\lib\canvas\evas_object_image.c(979) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data
|
||||||
|
evas_object_line.c
|
||||||
|
evas_object_main.c
|
||||||
|
evas_object_polygon.c
|
||||||
|
evas_object_rectangle.c
|
||||||
|
evas_object_text.c
|
||||||
|
C:\Projects\mbed\evas\src\lib\canvas\evas_object_text.c(103) : warning C4244: 'function' : conversion from 'double ' to 'int ', possible loss of data
|
||||||
|
C:\Projects\mbed\evas\src\lib\canvas\evas_object_text.c(119) : warning C4244: 'function' : conversion from 'double ' to 'int ', possible loss of data
|
||||||
|
C:\Projects\mbed\evas\src\lib\canvas\evas_object_text.c(131) : warning C4244: 'function' : conversion from 'double ' to 'int ', possible loss of data
|
||||||
|
C:\Projects\mbed\evas\src\lib\canvas\evas_object_text.c(141) : warning C4244: 'function' : conversion from 'double ' to 'int ', possible loss of data
|
||||||
|
C:\Projects\mbed\evas\src\lib\canvas\evas_object_text.c(159) : warning C4244: 'function' : conversion from 'double ' to 'int ', possible loss of data
|
||||||
|
C:\Projects\mbed\evas\src\lib\canvas\evas_object_text.c(187) : warning C4244: 'function' : conversion from 'double ' to 'int ', possible loss of data
|
||||||
|
C:\Projects\mbed\evas\src\lib\canvas\evas_object_text.c(512) : warning C4244: 'function' : conversion from 'double ' to 'int ', possible loss of data
|
||||||
|
C:\Projects\mbed\evas\src\lib\canvas\evas_object_text.c(512) : warning C4244: 'function' : conversion from 'double ' to 'int ', possible loss of data
|
||||||
|
C:\Projects\mbed\evas\src\lib\canvas\evas_object_text.c(685) : warning C4244: 'function' : conversion from 'double ' to 'int ', possible loss of data
|
||||||
|
C:\Projects\mbed\evas\src\lib\canvas\evas_object_text.c(686) : warning C4244: 'function' : conversion from 'double ' to 'int ', possible loss of data
|
||||||
|
evas_rectangle.c
|
||||||
|
evas_render.c
|
||||||
|
evas_stack.c
|
||||||
|
evas_hash.c
|
||||||
|
evas_list.c
|
||||||
|
evas_object_list.c
|
||||||
|
Generating Code...
|
||||||
|
C:\Projects\mbed\evas\src\lib\canvas\evas_object_text.c(103) : warning C4761: integral size mismatch in argument; conversion supplied
|
||||||
|
C:\Projects\mbed\evas\src\lib\canvas\evas_object_text.c(119) : warning C4761: integral size mismatch in argument; conversion supplied
|
||||||
|
C:\Projects\mbed\evas\src\lib\canvas\evas_object_text.c(131) : warning C4761: integral size mismatch in argument; conversion supplied
|
||||||
|
C:\Projects\mbed\evas\src\lib\canvas\evas_object_text.c(141) : warning C4761: integral size mismatch in argument; conversion supplied
|
||||||
|
C:\Projects\mbed\evas\src\lib\canvas\evas_object_text.c(159) : warning C4761: integral size mismatch in argument; conversion supplied
|
||||||
|
C:\Projects\mbed\evas\src\lib\canvas\evas_object_text.c(187) : warning C4761: integral size mismatch in argument; conversion supplied
|
||||||
|
C:\Projects\mbed\evas\src\lib\canvas\evas_object_text.c(514) : warning C4761: integral size mismatch in argument; conversion supplied
|
||||||
|
C:\Projects\mbed\evas\src\lib\canvas\evas_object_text.c(514) : warning C4761: integral size mismatch in argument; conversion supplied
|
||||||
|
C:\Projects\mbed\evas\src\lib\canvas\evas_object_text.c(687) : warning C4761: integral size mismatch in argument; conversion supplied
|
||||||
|
C:\Projects\mbed\evas\src\lib\canvas\evas_object_text.c(687) : warning C4761: integral size mismatch in argument; conversion supplied
|
||||||
|
Compiling...
|
||||||
|
evas_blend_alpha_color_pixel.c
|
||||||
|
evas_blend_color_pixel.c
|
||||||
|
evas_blend_main.c
|
||||||
|
evas_blend_pixel_cmod_pixel.c
|
||||||
|
evas_blend_pixel_mul_pixel.c
|
||||||
|
evas_blend_pixel_pixel.c
|
||||||
|
evas_blit_main.c
|
||||||
|
evas_convert_color.c
|
||||||
|
evas_convert_gry_1.c
|
||||||
|
evas_convert_gry_4.c
|
||||||
|
evas_convert_gry_8.c
|
||||||
|
evas_convert_main.c
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_main.c(206) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_main.c(208) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_main.c(215) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_main.c(217) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_main.c(229) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_main.c(231) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_main.c(238) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_main.c(240) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_main.c(252) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_main.c(254) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_main.c(261) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_main.c(263) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_main.c(275) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_main.c(277) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_main.c(285) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_main.c(287) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_main.c(299) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_main.c(301) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_main.c(309) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_main.c(311) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_main.c(324) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_main.c(328) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_main.c(337) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_convert_main.c(341) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
evas_convert_rgb_16.c
|
||||||
|
evas_convert_rgb_24.c
|
||||||
|
evas_convert_rgb_32.c
|
||||||
|
evas_convert_rgb_8.c
|
||||||
|
evas_cpu.c
|
||||||
|
evas_draw_main.c
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c(498) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c(512) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c(520) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c(541) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c(545) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c(561) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c(573) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c(581) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c(600) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c(604) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c(620) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c(624) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c(631) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c(635) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c(638) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c(654) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c(666) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c(674) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c(686) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c(690) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c(705) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c(717) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c(721) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c(752) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c(772) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_draw_main.c(776) : warning C4550: expression evaluates to a function which is missing an argument list
|
||||||
|
evas_font_draw.c
|
||||||
|
evas_font_load.c
|
||||||
|
Generating Code...
|
||||||
|
Compiling...
|
||||||
|
evas_font_main.c
|
||||||
|
evas_font_query.c
|
||||||
|
evas_gradient_main.c
|
||||||
|
evas_image_load.c
|
||||||
|
..\..\..\jpeg-6b\jmorecfg.h(161) : warning C4142: benign redefinition of type
|
||||||
|
..\..\..\jpeg-6b\jmorecfg.h(215) : warning C4005: 'FAR' : macro redefinition
|
||||||
|
C:\Program Files\Windows CE Tools\wce400\STANDARDSDK\Include\emulator\windef.h(151) : see previous definition of 'FAR'
|
||||||
|
evas_image_main.c
|
||||||
|
evas_line_main.c
|
||||||
|
evas_polygon_main.c
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_polygon_main.c(209) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_polygon_main.c(210) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_polygon_main.c(250) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_polygon_main.c(252) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data
|
||||||
|
evas_rectangle_main.c
|
||||||
|
evas_scale_main.c
|
||||||
|
evas_scale_sample.c
|
||||||
|
evas_scale_smooth.c
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_scale_smooth_scaler.c(29) : warning C4101: 'divx' : unreferenced local variable
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_scale_smooth_scaler.c(29) : warning C4101: 'divy' : unreferenced local variable
|
||||||
|
C:\Projects\mbed\evas\src\lib\engines\common\evas_scale_smooth_scaler.c(844) : warning C4101: 'dyy' : unreferenced local variable
|
||||||
|
evas_tiler.c
|
||||||
|
evas_engine.c
|
||||||
|
evas_outbuf.c
|
||||||
|
evas_win32_buffer.c
|
||||||
|
evas_win32_main.c
|
||||||
|
evas_path.c
|
||||||
|
Generating Code...
|
||||||
|
Creating library...
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h3>Results</h3>
|
||||||
|
evaslib.lib - 0 error(s), 83 warning(s)
|
||||||
|
</pre>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,29 @@
|
||||||
|
Microsoft eMbedded Visual Tools Workspace File, Format Version 4.00
|
||||||
|
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
Project: "evaslib"=.\evaslib.vcp - Package Owner=<4>
|
||||||
|
|
||||||
|
Package=<5>
|
||||||
|
{{{
|
||||||
|
}}}
|
||||||
|
|
||||||
|
Package=<4>
|
||||||
|
{{{
|
||||||
|
}}}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
Global:
|
||||||
|
|
||||||
|
Package=<5>
|
||||||
|
{{{
|
||||||
|
}}}
|
||||||
|
|
||||||
|
Package=<3>
|
||||||
|
{{{
|
||||||
|
}}}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
|
@ -0,0 +1,76 @@
|
||||||
|
## Process this file with automake to produce Makefile.in
|
||||||
|
|
||||||
|
INCLUDES = \
|
||||||
|
-I. -I$(top_srcdir)/src/lib -I$(includedir) -I$(top_srcdir) \
|
||||||
|
@DIRECTFB_CFLAGS@ @qt_cflags@ @gl_cflags@
|
||||||
|
|
||||||
|
bin_PROGRAMS = \
|
||||||
|
@ENGINE_SOFTWARE_X11_PRG@ \
|
||||||
|
@ENGINE_DIRECTFB_PRG@ \
|
||||||
|
@ENGINE_FB_PRG@ \
|
||||||
|
@ENGINE_SOFTWARE_QTOPIA_PRG@ \
|
||||||
|
@ENGINE_GL_X11_PRG@
|
||||||
|
|
||||||
|
EXTRA_PROGRAMS = \
|
||||||
|
evas_software_x11_test \
|
||||||
|
evas_software_x11_perf_test \
|
||||||
|
evas_software_x11_perf_load \
|
||||||
|
evas_directfb_test \
|
||||||
|
evas_directfb_window \
|
||||||
|
evas_fb_test \
|
||||||
|
evas_software_qtopia_test \
|
||||||
|
evas_gl_x11_test
|
||||||
|
|
||||||
|
SUBDIRS = evas_software_win32
|
||||||
|
|
||||||
|
evas_software_x11_test_SOURCES = evas_test_main.h evas_test_main.c evas_software_x11_main.c
|
||||||
|
evas_software_x11_test_LDADD = $(top_builddir)/src/lib/libevas.la -lm @x_libs@
|
||||||
|
evas_software_x11_test_LDFLAGS = $(LDFLAGS)
|
||||||
|
evas_software_x11_test_CFLAGS = $(CFLAGS) @x_cflags@
|
||||||
|
evas_software_x11_test_DEPENDANCIES = $(top_builddir)/src/lib/libevas.la
|
||||||
|
|
||||||
|
evas_software_x11_perf_test_SOURCES = evas_software_x11_perf_test.c
|
||||||
|
evas_software_x11_perf_test_LDADD = $(top_builddir)/src/lib/libevas.la -lm @x_libs@
|
||||||
|
evas_software_x11_perf_test_LDFLAGS = $(LDFLAGS)
|
||||||
|
evas_software_x11_perf_test_CFLAGS = $(CFLAGS) @x_cflags@
|
||||||
|
evas_software_x11_perf_test_DEPENDANCIES = $(top_builddir)/src/lib/libevas.la
|
||||||
|
|
||||||
|
evas_software_x11_perf_load_SOURCES = evas_software_x11_perf_load.c
|
||||||
|
evas_software_x11_perf_load_LDADD = $(top_builddir)/src/lib/libevas.la -lm @x_libs@
|
||||||
|
evas_software_x11_perf_load_LDFLAGS = $(LDFLAGS)
|
||||||
|
evas_software_x11_perf_load_CFLAGS = $(CFLAGS) @x_cflags@
|
||||||
|
evas_software_x11_perf_load_DEPENDANCIES = $(top_builddir)/src/lib/libevas.la
|
||||||
|
|
||||||
|
evas_directfb_test_SOURCES = evas_test_main.h evas_test_main.c evas_directfb_main.c
|
||||||
|
evas_directfb_test_LDADD = $(top_builddir)/src/lib/libevas.la -lm @DIRECTFB_LIBS@
|
||||||
|
evas_directfb_test_LDFLAGS = $(LDFLAGS)
|
||||||
|
evas_directfb_test_CFLAGS = $(CFLAGS) @DIRECTFB_CFLAGS@
|
||||||
|
evas_directfb_test_DEPENDANCIES = $(top_builddir)/src/lib/libevas.la
|
||||||
|
|
||||||
|
evas_directfb_window_SOURCES = evas_test_main.h evas_test_main.c evas_directfb_window.c
|
||||||
|
evas_directfb_window_LDADD = $(top_builddir)/src/lib/libevas.la -lm @DIRECTFB_LIBS@
|
||||||
|
evas_directfb_window_LDFLAGS = $(LDFLAGS)
|
||||||
|
evas_directfb_window_CFLAGS = $(CFLAGS) @DIRECTFB_CFLAGS@
|
||||||
|
evas_directfb_window_DEPENDANCIES = $(top_builddir)/src/lib/libevas.la
|
||||||
|
|
||||||
|
evas_fb_test_SOURCES = evas_test_main.h evas_test_main.c evas_fb_main.c
|
||||||
|
evas_fb_test_LDADD = $(top_builddir)/src/lib/libevas.la -lm
|
||||||
|
evas_fb_test_LDFLAGS = $(LDFLAGS)
|
||||||
|
evas_fb_test_CFLAGS = $(CFLAGS)
|
||||||
|
evas_fb_test_DEPENDANCIES = $(top_builddir)/src/lib/libevas.la
|
||||||
|
|
||||||
|
moc_evas_software_qtopia_main.cpp: evas_software_qtopia_main.h
|
||||||
|
@qt_moc@ evas_software_qtopia_main.h -o moc_evas_software_qtopia_main.cpp
|
||||||
|
|
||||||
|
evas_software_qtopia_test_SOURCES = evas_test_main.h evas_test_main.c evas_software_qtopia_main.h evas_software_qtopia_main.cpp moc_evas_software_qtopia_main.cpp
|
||||||
|
evas_software_qtopia_test_LDADD = $(top_builddir)/src/lib/libevas.la -lm @qt_libs@
|
||||||
|
evas_software_qtopia_test_LDFLAGS = $(LDFLAGS)
|
||||||
|
evas_software_qtopia_test_CFLAGS = $(CFLAGS) @qt_cflags@
|
||||||
|
evas_software_qtopia_test_CXXFLAGS = $(CFLAGS) $(CXXFLAGS) @qt_cflags@
|
||||||
|
evas_software_qtopia_test_DEPENDANCIES = $(top_builddir)/src/lib/libevas.la
|
||||||
|
|
||||||
|
evas_gl_x11_test_SOURCES = evas_test_main.h evas_test_main.c evas_gl_x11_main.c
|
||||||
|
evas_gl_x11_test_LDADD = $(top_builddir)/src/lib/libevas.la -lm @x_libs@ @gl_libs@
|
||||||
|
evas_gl_x11_test_LDFLAGS = $(LDFLAGS)
|
||||||
|
evas_gl_x11_test_CFLAGS = $(CFLAGS) @x_cflags@ @gl_cflags@
|
||||||
|
evas_gl_x11_test_DEPENDANCIES = $(top_builddir)/src/lib/libevas.la
|
|
@ -0,0 +1,132 @@
|
||||||
|
#include "evas_test_main.h"
|
||||||
|
|
||||||
|
#include <directfb.h>
|
||||||
|
|
||||||
|
#include "Evas.h"
|
||||||
|
#include "Evas_Engine_DirectFB.h"
|
||||||
|
|
||||||
|
/* macro for a safe call to DirectFB functions */
|
||||||
|
#define DFBCHECK(x...) \
|
||||||
|
{ \
|
||||||
|
err = x; \
|
||||||
|
if (err != DFB_OK) { \
|
||||||
|
fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ ); \
|
||||||
|
DirectFBErrorFatal( #x, err ); \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
IDirectFB *dfb = NULL;
|
||||||
|
IDirectFBSurface *primary;
|
||||||
|
IDirectFBDisplayLayer *layer;
|
||||||
|
IDirectFBInputDevice *keyboard;
|
||||||
|
IDirectFBInputDevice *mouse;
|
||||||
|
IDirectFBEventBuffer *buffer;
|
||||||
|
DFBResult err;
|
||||||
|
DFBSurfaceDescription dsc;
|
||||||
|
DFBCardCapabilities caps;
|
||||||
|
DFBDisplayLayerConfig layer_config;
|
||||||
|
DFBInputEvent evt;
|
||||||
|
|
||||||
|
int quit = 0;
|
||||||
|
int paused = 0;
|
||||||
|
|
||||||
|
DFBCHECK(DirectFBInit(&argc, &argv));
|
||||||
|
|
||||||
|
/* create the super interface */
|
||||||
|
DFBCHECK(DirectFBCreate(&dfb));
|
||||||
|
|
||||||
|
dfb->SetCooperativeLevel(dfb, DFSCL_FULLSCREEN);
|
||||||
|
|
||||||
|
DFBCHECK(dfb->GetDisplayLayer(dfb, DLID_PRIMARY, &layer));
|
||||||
|
layer->GetConfiguration(layer, &layer_config);
|
||||||
|
|
||||||
|
/* get the primary surface, i.e. the surface of the primary layer we have
|
||||||
|
* exclusive access to */
|
||||||
|
memset(&dsc, 0, sizeof(DFBSurfaceDescription));
|
||||||
|
dsc.flags = DSDESC_CAPS | DSDESC_WIDTH | DSDESC_HEIGHT;
|
||||||
|
dsc.width = layer_config.width;
|
||||||
|
dsc.height = layer_config.height;
|
||||||
|
|
||||||
|
dsc.caps = DSCAPS_PRIMARY;
|
||||||
|
|
||||||
|
DFBCHECK(dfb->CreateSurface(dfb, &dsc, &primary));
|
||||||
|
|
||||||
|
DFBCHECK(dfb->GetInputDevice(dfb, DIDID_KEYBOARD, &keyboard));
|
||||||
|
DFBCHECK(dfb->GetInputDevice(dfb, DIDID_MOUSE, &mouse));
|
||||||
|
DFBCHECK(dfb->CreateEventBuffer(dfb, DICAPS_ALL, &buffer));
|
||||||
|
|
||||||
|
evas = evas_new();
|
||||||
|
evas_output_method_set(evas, evas_render_method_lookup("directfb"));
|
||||||
|
evas_output_size_set(evas, win_w, win_h);
|
||||||
|
evas_output_viewport_set(evas, 0, 0, win_w, win_h);
|
||||||
|
{
|
||||||
|
Evas_Engine_Info_DirectFB *einfo;
|
||||||
|
|
||||||
|
einfo = (Evas_Engine_Info_DirectFB *) evas_engine_info_get(evas);
|
||||||
|
|
||||||
|
einfo->info.dfb = dfb;
|
||||||
|
einfo->info.surface = primary;
|
||||||
|
einfo->info.flags = DSDRAW_BLEND;
|
||||||
|
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
|
||||||
|
}
|
||||||
|
setup();
|
||||||
|
start_time = get_time();
|
||||||
|
|
||||||
|
while (!quit)
|
||||||
|
{
|
||||||
|
|
||||||
|
while (buffer->GetEvent(buffer, DFB_EVENT(&evt)) == DFB_OK)
|
||||||
|
{
|
||||||
|
|
||||||
|
switch (evt.type)
|
||||||
|
{
|
||||||
|
|
||||||
|
case DIET_BUTTONPRESS:
|
||||||
|
switch (evt.button)
|
||||||
|
{
|
||||||
|
case DIBI_LEFT:
|
||||||
|
if (paused == 0)
|
||||||
|
paused = 1;
|
||||||
|
else if (paused == 1)
|
||||||
|
paused = 0;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DIET_KEYPRESS:
|
||||||
|
switch (evt.key_symbol)
|
||||||
|
{
|
||||||
|
case DIKS_ESCAPE:
|
||||||
|
case DIKS_SMALL_Q:
|
||||||
|
case DIKS_CAPITAL_Q:
|
||||||
|
case DIKS_BACK:
|
||||||
|
case DIKS_STOP:
|
||||||
|
quit = 1;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!paused)
|
||||||
|
{
|
||||||
|
loop();
|
||||||
|
evas_render(evas);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
buffer->Release(buffer);
|
||||||
|
layer->Release(layer);
|
||||||
|
primary->Release(primary);
|
||||||
|
dfb->Release(dfb);
|
||||||
|
|
||||||
|
return 42;
|
||||||
|
}
|
|
@ -0,0 +1,382 @@
|
||||||
|
/*
|
||||||
|
(c) Copyright 2000-2002 convergence integrated media GmbH.
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Written by Denis Oliver Kropp <dok@directfb.org>,
|
||||||
|
Andreas Hundt <andi@fischlustig.de> and
|
||||||
|
Sven Neumann <neo@directfb.org>.
|
||||||
|
|
||||||
|
This file is subject to the terms and conditions of the MIT License:
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person
|
||||||
|
obtaining a copy of this software and associated documentation
|
||||||
|
files (the "Software"), to deal in the Software without restriction,
|
||||||
|
including without limitation the rights to use, copy, modify, merge,
|
||||||
|
publish, distribute, sublicense, and/or sell copies of the Software,
|
||||||
|
and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||||
|
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
|
#include <directfb.h>
|
||||||
|
#include "config.h"
|
||||||
|
#include "Evas.h"
|
||||||
|
#include "Evas_Engine_DirectFB.h"
|
||||||
|
|
||||||
|
#include "evas_test_main.h"
|
||||||
|
|
||||||
|
/* macro for a safe call to DirectFB functions */
|
||||||
|
#define DFBCHECK(x...) \
|
||||||
|
{ \
|
||||||
|
err = x; \
|
||||||
|
if (err != DFB_OK) { \
|
||||||
|
fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ ); \
|
||||||
|
DirectFBErrorFatal( #x, err ); \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline long myclock()
|
||||||
|
{
|
||||||
|
struct timeval tv;
|
||||||
|
|
||||||
|
gettimeofday (&tv, NULL);
|
||||||
|
return (tv.tv_sec * 1000 + tv.tv_usec / 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main( int argc, char *argv[] )
|
||||||
|
{
|
||||||
|
IDirectFB *dfb;
|
||||||
|
IDirectFBDisplayLayer *layer;
|
||||||
|
|
||||||
|
IDirectFBSurface *bgsurface;
|
||||||
|
IDirectFBImageProvider *provider;
|
||||||
|
|
||||||
|
IDirectFBWindow *window1;
|
||||||
|
IDirectFBWindow *window2;
|
||||||
|
IDirectFBSurface *window_surface1;
|
||||||
|
IDirectFBSurface *window_surface2;
|
||||||
|
|
||||||
|
IDirectFBEventBuffer *buffer;
|
||||||
|
|
||||||
|
DFBDisplayLayerConfig layer_config;
|
||||||
|
DFBCardCapabilities caps;
|
||||||
|
IDirectFBWindow* upper;
|
||||||
|
DFBWindowID id1;
|
||||||
|
|
||||||
|
IDirectFBFont *font;
|
||||||
|
int fontheight;
|
||||||
|
int err;
|
||||||
|
int quit = 0;
|
||||||
|
|
||||||
|
|
||||||
|
DFBCHECK(DirectFBInit( &argc, &argv ));
|
||||||
|
DFBCHECK(DirectFBCreate( &dfb ));
|
||||||
|
|
||||||
|
dfb->GetCardCapabilities( dfb, &caps );
|
||||||
|
|
||||||
|
dfb->GetDisplayLayer( dfb, DLID_PRIMARY, &layer );
|
||||||
|
|
||||||
|
if (!((caps.blitting_flags & DSBLIT_BLEND_ALPHACHANNEL) &&
|
||||||
|
(caps.blitting_flags & DSBLIT_BLEND_COLORALPHA )))
|
||||||
|
{
|
||||||
|
layer_config.flags = DLCONF_BUFFERMODE;
|
||||||
|
layer_config.buffermode = DLBM_BACKSYSTEM;
|
||||||
|
|
||||||
|
layer->SetConfiguration( layer, &layer_config );
|
||||||
|
}
|
||||||
|
|
||||||
|
layer->GetConfiguration( layer, &layer_config );
|
||||||
|
layer->EnableCursor ( layer, 1 );
|
||||||
|
|
||||||
|
{
|
||||||
|
DFBFontDescription desc;
|
||||||
|
|
||||||
|
desc.flags = DFDESC_HEIGHT;
|
||||||
|
desc.height = layer_config.width/50;
|
||||||
|
|
||||||
|
DFBCHECK(dfb->CreateFont( dfb, PACKAGE_DATA_DIR"/data/grunge.ttf", &desc, &font ));
|
||||||
|
font->GetHeight( font, &fontheight );
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
DFBSurfaceDescription desc;
|
||||||
|
|
||||||
|
DFBCHECK(dfb->CreateImageProvider( dfb,
|
||||||
|
PACKAGE_DATA_DIR"/data/bg.png",
|
||||||
|
&provider ));
|
||||||
|
|
||||||
|
desc.flags = DSDESC_WIDTH | DSDESC_HEIGHT;
|
||||||
|
desc.width = layer_config.width;
|
||||||
|
desc.height = layer_config.height;
|
||||||
|
|
||||||
|
DFBCHECK(dfb->CreateSurface( dfb, &desc, &bgsurface ) );
|
||||||
|
|
||||||
|
|
||||||
|
provider->RenderTo( provider, bgsurface, NULL );
|
||||||
|
provider->Release( provider );
|
||||||
|
|
||||||
|
DFBCHECK(bgsurface->SetFont( bgsurface, font ));
|
||||||
|
|
||||||
|
bgsurface->SetColor( bgsurface, 0xCF, 0xCF, 0xFF, 0xFF );
|
||||||
|
bgsurface->DrawString( bgsurface,
|
||||||
|
"Move the mouse over a window to activate it.",
|
||||||
|
-1, 10, 0, DSTF_LEFT | DSTF_TOP );
|
||||||
|
|
||||||
|
bgsurface->SetColor( bgsurface, 0xFF, 0xCF, 0xFF, 0xFF );
|
||||||
|
bgsurface->DrawString( bgsurface,
|
||||||
|
"You can drag them around, too, if you want.",
|
||||||
|
-1, 10 , 40, DSTF_LEFT | DSTF_TOP );
|
||||||
|
|
||||||
|
bgsurface->SetColor( bgsurface, 0xCF, 0xCF, 0xFF, 0xFF );
|
||||||
|
bgsurface->DrawString( bgsurface,
|
||||||
|
"The one with funky stuff happening and things flying around is an evas.",
|
||||||
|
-1, 10, 80, DSTF_LEFT | DSTF_TOP );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
layer->SetBackgroundImage( layer, bgsurface );
|
||||||
|
layer->SetBackgroundMode( layer, DLBM_IMAGE );
|
||||||
|
}
|
||||||
|
{
|
||||||
|
DFBWindowDescription desc;
|
||||||
|
desc.flags = ( DWDESC_POSX | DWDESC_POSY |
|
||||||
|
DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_CAPS );
|
||||||
|
|
||||||
|
desc.posx = 20;
|
||||||
|
desc.posy = 120;
|
||||||
|
desc.width = 200;
|
||||||
|
desc.height = 200;
|
||||||
|
desc.caps = DWCAPS_ALPHACHANNEL;
|
||||||
|
|
||||||
|
DFBCHECK( layer->CreateWindow( layer, &desc, &window2 ) );
|
||||||
|
window2->GetSurface( window2, &window_surface2 );
|
||||||
|
|
||||||
|
window2->SetOpacity( window2, 0xFF );
|
||||||
|
|
||||||
|
window2->CreateEventBuffer( window2, &buffer );
|
||||||
|
|
||||||
|
{
|
||||||
|
window_surface2->SetColor( window_surface2,
|
||||||
|
0x00, 0x30, 0x10, 0xc0 );
|
||||||
|
window_surface2->DrawRectangle( window_surface2, 0, 0,
|
||||||
|
desc.width, desc.height );
|
||||||
|
window_surface2->SetColor( window_surface2,
|
||||||
|
0x80, 0xa0, 0x00, 0x90 );
|
||||||
|
window_surface2->FillRectangle( window_surface2, 1, 1,
|
||||||
|
desc.width-2, desc.height-2 );
|
||||||
|
|
||||||
|
|
||||||
|
DFBCHECK(window_surface2->SetFont(window_surface2, font ));
|
||||||
|
window_surface2->SetColor( window_surface2, 0xCF, 0xFF, 0xCF, 0xFF );
|
||||||
|
|
||||||
|
window_surface2->DrawString( window_surface2,
|
||||||
|
"Pants!",
|
||||||
|
-1,10, fontheight + 5, DSTF_LEFT | DSTF_TOP );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
window_surface2->Flip( window_surface2, NULL, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
DFBWindowDescription desc;
|
||||||
|
|
||||||
|
desc.flags = ( DWDESC_POSX | DWDESC_POSY |
|
||||||
|
DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_CAPS );
|
||||||
|
desc.posx = 200;
|
||||||
|
desc.posy = 200;
|
||||||
|
desc.width = 240;
|
||||||
|
desc.height = 320;
|
||||||
|
desc.caps = DWCAPS_ALPHACHANNEL;
|
||||||
|
|
||||||
|
DFBCHECK(layer->CreateWindow( layer, &desc, &window1 ) );
|
||||||
|
window1->GetSurface( window1, &window_surface1 );
|
||||||
|
|
||||||
|
window_surface1->SetColor( window_surface1, 0xFF, 0x20, 0x20, 0x90 );
|
||||||
|
window_surface1->DrawRectangle( window_surface1, 0, 0,
|
||||||
|
desc.width, desc.height );
|
||||||
|
|
||||||
|
window_surface1->Flip( window_surface1, NULL, 0 );
|
||||||
|
|
||||||
|
window1->SetOpacity( window1, 0xFF );
|
||||||
|
|
||||||
|
window1->GetID( window1, &id1 );
|
||||||
|
|
||||||
|
window1->AttachEventBuffer( window1, buffer );
|
||||||
|
}
|
||||||
|
|
||||||
|
window1->RequestFocus( window1 );
|
||||||
|
window1->RaiseToTop( window1 );
|
||||||
|
upper = window1;
|
||||||
|
{
|
||||||
|
evas = evas_new();
|
||||||
|
evas_output_method_set(evas, evas_render_method_lookup("directfb"));
|
||||||
|
evas_output_size_set(evas, 240, 320);
|
||||||
|
evas_output_viewport_set(evas, 0, 0, 240, 320);
|
||||||
|
{
|
||||||
|
Evas_Engine_Info_DirectFB *einfo;
|
||||||
|
|
||||||
|
einfo = (Evas_Engine_Info_DirectFB *) evas_engine_info_get(evas);
|
||||||
|
|
||||||
|
einfo->info.dfb = dfb;
|
||||||
|
einfo->info.surface = window_surface1;
|
||||||
|
einfo->info.flags = DSDRAW_BLEND;
|
||||||
|
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
|
||||||
|
}
|
||||||
|
setup();
|
||||||
|
evas_render(evas);
|
||||||
|
start_time = get_time();
|
||||||
|
}
|
||||||
|
|
||||||
|
while (!quit) {
|
||||||
|
static IDirectFBWindow* active = NULL;
|
||||||
|
static int grabbed = 0;
|
||||||
|
static int startx = 0;
|
||||||
|
static int starty = 0;
|
||||||
|
static int endx = 0;
|
||||||
|
static int endy = 0;
|
||||||
|
DFBWindowEvent evt;
|
||||||
|
|
||||||
|
buffer->WaitForEventWithTimeout( buffer, 0, 10 );
|
||||||
|
|
||||||
|
while (buffer->GetEvent( buffer, DFB_EVENT(&evt) ) == DFB_OK) {
|
||||||
|
IDirectFBWindow* window;
|
||||||
|
|
||||||
|
if (evt.window_id == id1)
|
||||||
|
window = window1;
|
||||||
|
else
|
||||||
|
window = window2;
|
||||||
|
|
||||||
|
if (active) {
|
||||||
|
switch (evt.type) {
|
||||||
|
|
||||||
|
case DWET_BUTTONDOWN:
|
||||||
|
if (!grabbed && evt.button == DIBI_LEFT) {
|
||||||
|
grabbed = 1;
|
||||||
|
layer->GetCursorPosition( layer,
|
||||||
|
&startx, &starty );
|
||||||
|
window->GrabPointer( window );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DWET_BUTTONUP:
|
||||||
|
switch (evt.button) {
|
||||||
|
case DIBI_LEFT:
|
||||||
|
if (grabbed) {
|
||||||
|
window->UngrabPointer( window );
|
||||||
|
grabbed = 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DIBI_MIDDLE:
|
||||||
|
upper->LowerToBottom( upper );
|
||||||
|
upper = (upper == window1) ? window2 : window1;
|
||||||
|
break;
|
||||||
|
case DIBI_RIGHT:
|
||||||
|
quit = DIKS_DOWN;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DWET_KEYDOWN:
|
||||||
|
if (grabbed)
|
||||||
|
break;
|
||||||
|
switch (evt.key_id) {
|
||||||
|
case DIKI_RIGHT:
|
||||||
|
active->Move (active, 1, 0);
|
||||||
|
break;
|
||||||
|
case DIKI_LEFT:
|
||||||
|
active->Move (active, -1, 0);
|
||||||
|
break;
|
||||||
|
case DIKI_UP:
|
||||||
|
active->Move (active, 0, -1);
|
||||||
|
break;
|
||||||
|
case DIKI_DOWN:
|
||||||
|
active->Move (active, 0, 1);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DWET_LOSTFOCUS:
|
||||||
|
if (!grabbed)
|
||||||
|
active = NULL;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (evt.type == DWET_GOTFOCUS)
|
||||||
|
active = window;
|
||||||
|
|
||||||
|
switch (evt.type) {
|
||||||
|
|
||||||
|
case DWET_MOTION:
|
||||||
|
endx = evt.cx;
|
||||||
|
endy = evt.cy;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DWET_KEYDOWN:
|
||||||
|
switch (evt.key_symbol) {
|
||||||
|
case DIKS_ESCAPE:
|
||||||
|
case DIKS_SMALL_Q:
|
||||||
|
case DIKS_CAPITAL_Q:
|
||||||
|
case DIKS_BACK:
|
||||||
|
case DIKS_STOP:
|
||||||
|
quit = 1;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (active) {
|
||||||
|
if (grabbed) {
|
||||||
|
active->Move( active, endx - startx, endy - starty);
|
||||||
|
startx = endx;
|
||||||
|
starty = endy;
|
||||||
|
}
|
||||||
|
active->SetOpacity( active,
|
||||||
|
(sin( myclock()/300.0 ) * 85) + 170 );
|
||||||
|
}
|
||||||
|
loop();
|
||||||
|
evas_render(evas);
|
||||||
|
}
|
||||||
|
|
||||||
|
buffer->Release( buffer );
|
||||||
|
window_surface2->Release( window_surface2 );
|
||||||
|
window_surface1->Release( window_surface1 );
|
||||||
|
window2->Release( window2 );
|
||||||
|
window1->Release( window1 );
|
||||||
|
layer->Release( layer );
|
||||||
|
bgsurface->Release( bgsurface );
|
||||||
|
dfb->Release( dfb );
|
||||||
|
|
||||||
|
return 42;
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
#include "evas_test_main.h"
|
||||||
|
|
||||||
|
#include "Evas.h"
|
||||||
|
#include "Evas_Engine_FB.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
int rot = 0;
|
||||||
|
|
||||||
|
if ((argc >= 3) && (!strcmp(argv[1], "-rot")))
|
||||||
|
rot = atoi(argv[2]);
|
||||||
|
evas = evas_new();
|
||||||
|
evas_output_method_set(evas, evas_render_method_lookup("fb"));
|
||||||
|
evas_output_size_set(evas, win_w, win_h);
|
||||||
|
evas_output_viewport_set(evas, 0, 0, win_w, win_h);
|
||||||
|
{
|
||||||
|
Evas_Engine_Info_FB *einfo;
|
||||||
|
|
||||||
|
einfo = (Evas_Engine_Info_FB *) evas_engine_info_get(evas);
|
||||||
|
|
||||||
|
/* the following is specific to the engine */
|
||||||
|
einfo->info.virtual_terminal = 0;
|
||||||
|
einfo->info.device_number = 0;
|
||||||
|
einfo->info.refresh = 0;
|
||||||
|
einfo->info.rotation = rot;
|
||||||
|
|
||||||
|
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
|
||||||
|
}
|
||||||
|
setup();
|
||||||
|
orig_start_time = start_time = get_time();
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
loop();
|
||||||
|
evas_render(evas);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -0,0 +1,140 @@
|
||||||
|
#include "evas_test_main.h"
|
||||||
|
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
#include <X11/Xutil.h>
|
||||||
|
#include <GL/gl.h>
|
||||||
|
#include <GL/glu.h>
|
||||||
|
#include <GL/glx.h>
|
||||||
|
|
||||||
|
#include "Evas.h"
|
||||||
|
#include "Evas_Engine_GL_X11.h"
|
||||||
|
|
||||||
|
int
|
||||||
|
main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
int pause_me = 0;
|
||||||
|
Display *disp;
|
||||||
|
Window win;
|
||||||
|
XSetWindowAttributes attr;
|
||||||
|
XClassHint chint;
|
||||||
|
XSizeHints szhints;
|
||||||
|
|
||||||
|
disp = XOpenDisplay(NULL);
|
||||||
|
if (!disp)
|
||||||
|
{
|
||||||
|
printf("Error: cannot open display.\n");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
/* test evas_free.... :) */
|
||||||
|
evas = evas_new();
|
||||||
|
evas_output_method_set(evas, evas_render_method_lookup("gl_x11"));
|
||||||
|
evas_output_size_set(evas, win_w, win_h);
|
||||||
|
evas_output_viewport_set(evas, 0, 0, win_w, win_h);
|
||||||
|
{
|
||||||
|
Evas_Engine_Info_GL_X11 *einfo;
|
||||||
|
|
||||||
|
einfo = (Evas_Engine_Info_GL_X11 *) evas_engine_info_get(evas);
|
||||||
|
|
||||||
|
/* the following is specific to the engine */
|
||||||
|
attr.backing_store = NotUseful;
|
||||||
|
attr.colormap = einfo->func.best_colormap_get(disp, DefaultScreen(disp));
|
||||||
|
attr.border_pixel = 0;
|
||||||
|
attr.background_pixmap = None;
|
||||||
|
attr.event_mask =
|
||||||
|
ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask |
|
||||||
|
StructureNotifyMask;
|
||||||
|
attr.bit_gravity = ForgetGravity;
|
||||||
|
|
||||||
|
win = XCreateWindow(disp, DefaultRootWindow(disp), 0, 0, win_w, win_h, 0,
|
||||||
|
einfo->func.best_depth_get(disp, DefaultScreen(disp)),
|
||||||
|
InputOutput,
|
||||||
|
einfo->func.best_visual_get(disp, DefaultScreen(disp)),
|
||||||
|
CWBackingStore | CWColormap |
|
||||||
|
CWBackPixmap | CWBorderPixel |
|
||||||
|
CWBitGravity | CWEventMask, &attr);
|
||||||
|
|
||||||
|
einfo->info.display = disp;
|
||||||
|
einfo->info.visual = einfo->func.best_visual_get(disp, DefaultScreen(disp));
|
||||||
|
einfo->info.colormap = einfo->func.best_colormap_get(disp, DefaultScreen(disp));
|
||||||
|
einfo->info.drawable = win;
|
||||||
|
einfo->info.depth = einfo->func.best_depth_get(disp, DefaultScreen(disp));
|
||||||
|
|
||||||
|
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
XStoreName(disp, win, "Evas GL X11 Test");
|
||||||
|
chint.res_name = "Evas_GL_X11_Test";
|
||||||
|
chint.res_class = "Main";
|
||||||
|
XSetClassHint(disp, win, &chint);
|
||||||
|
#if 0
|
||||||
|
szhints.flags = PMinSize | PMaxSize | PSize | USSize;
|
||||||
|
szhints.min_width = szhints.max_width = win_w;
|
||||||
|
szhints.min_height = szhints.max_height = win_h;
|
||||||
|
XSetWMNormalHints(disp, win, &szhints);
|
||||||
|
#endif
|
||||||
|
XMapWindow(disp, win);
|
||||||
|
XSync(disp, False);
|
||||||
|
|
||||||
|
setup();
|
||||||
|
|
||||||
|
orig_start_time = start_time = get_time();
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
XEvent ev;
|
||||||
|
|
||||||
|
while (XCheckMaskEvent(disp,
|
||||||
|
ExposureMask |
|
||||||
|
StructureNotifyMask |
|
||||||
|
KeyPressMask |
|
||||||
|
KeyReleaseMask |
|
||||||
|
ButtonPressMask |
|
||||||
|
ButtonReleaseMask | PointerMotionMask, &ev))
|
||||||
|
{
|
||||||
|
switch (ev.type)
|
||||||
|
{
|
||||||
|
case ButtonPress:
|
||||||
|
if (ev.xbutton.button == 3)
|
||||||
|
exit(0);
|
||||||
|
if (!pause_me)
|
||||||
|
pause_me = 1;
|
||||||
|
else if (pause_me == 1)
|
||||||
|
pause_me = 2;
|
||||||
|
else
|
||||||
|
pause_me = 1;
|
||||||
|
evas_event_feed_mouse_move(evas, ev.xbutton.x, ev.xbutton.y);
|
||||||
|
evas_event_feed_mouse_down(evas, ev.xbutton.button);
|
||||||
|
break;
|
||||||
|
case ButtonRelease:
|
||||||
|
evas_event_feed_mouse_move(evas, ev.xbutton.x, ev.xbutton.y);
|
||||||
|
evas_event_feed_mouse_up(evas, ev.xbutton.button);
|
||||||
|
break;
|
||||||
|
case MotionNotify:
|
||||||
|
evas_event_feed_mouse_move(evas, ev.xmotion.x, ev.xmotion.y);
|
||||||
|
break;
|
||||||
|
case Expose:
|
||||||
|
evas_damage_rectangle_add(evas,
|
||||||
|
ev.xexpose.x,
|
||||||
|
ev.xexpose.y,
|
||||||
|
ev.xexpose.width,
|
||||||
|
ev.xexpose.height);
|
||||||
|
break;
|
||||||
|
case ConfigureNotify:
|
||||||
|
evas_output_size_set(evas,
|
||||||
|
ev.xconfigure.width,
|
||||||
|
ev.xconfigure.height);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!(pause_me == 1))
|
||||||
|
{
|
||||||
|
loop();
|
||||||
|
evas_render(evas);
|
||||||
|
XFlush(disp);
|
||||||
|
}
|
||||||
|
if (pause_me == 2)
|
||||||
|
usleep(100000);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -0,0 +1,65 @@
|
||||||
|
#ifndef EVAS_SOFTWARE_QTOPIA_MAIN_H
|
||||||
|
#define EVAS_SOFTWARE_QTOPIA_MAIN_H
|
||||||
|
|
||||||
|
#ifndef QT_QWS_EBX
|
||||||
|
#define QT_QWS_EBX
|
||||||
|
#endif
|
||||||
|
#ifndef QT_QWS_CUSTOM
|
||||||
|
#define QT_QWS_CUSTOM
|
||||||
|
#endif
|
||||||
|
#ifndef QWS
|
||||||
|
#define QWS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <qwidget.h>
|
||||||
|
#include <qmainwindow.h>
|
||||||
|
#include <qpe/qlibrary.h>
|
||||||
|
#include <qtimer.h>
|
||||||
|
#include <qwidget.h>
|
||||||
|
#include <qwidgetstack.h>
|
||||||
|
#include <qpainter.h>
|
||||||
|
#include <qdirectpainter_qws.h>
|
||||||
|
|
||||||
|
class EvasTargetWidget : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
EvasTargetWidget(QWidget *parent=NULL, const char *name=NULL);
|
||||||
|
|
||||||
|
QSizePolicy sizePolicy() const;
|
||||||
|
|
||||||
|
void enableFullscreen(void);
|
||||||
|
void disableFullscreen(void);
|
||||||
|
int fullscreen;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void mousePressEvent(QMouseEvent *);
|
||||||
|
void mouseReleaseEvent(QMouseEvent *);
|
||||||
|
void mouseMoveEvent(QMouseEvent *);
|
||||||
|
void paintEvent(QPaintEvent *);
|
||||||
|
void resizeEvent(QResizeEvent *);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void idleHandler(void);
|
||||||
|
private:
|
||||||
|
QTimer *idleTimer;
|
||||||
|
};
|
||||||
|
|
||||||
|
class EvasTestApp : public QMainWindow
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
EvasTestApp(QWidget *parent=0, const char *name=0, int wFlags=0);
|
||||||
|
~EvasTestApp();
|
||||||
|
|
||||||
|
QSizePolicy sizePolicy() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void resizeEvent(QResizeEvent *);
|
||||||
|
|
||||||
|
EvasTargetWidget *evas_target_widget;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,10 @@
|
||||||
|
EXTRA_DIST = \
|
||||||
|
ReadMe.txt \
|
||||||
|
StdAfx.cpp \
|
||||||
|
StdAfx.h \
|
||||||
|
evas_software_win32.cpp \
|
||||||
|
evas_software_win32.rc \
|
||||||
|
evas_software_win32.h \
|
||||||
|
newres.h \
|
||||||
|
resource.h
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
========================================================================
|
||||||
|
Windows CE APPLICATION : evas_software_win32
|
||||||
|
========================================================================
|
||||||
|
|
||||||
|
|
||||||
|
AppWizard has created this evas_software_win32 application for you.
|
||||||
|
|
||||||
|
This file contains a summary of what you will find in each of the files that
|
||||||
|
make up your evas_software_win32 application.
|
||||||
|
|
||||||
|
evas_software_win32.cpp
|
||||||
|
This is the main application source file.
|
||||||
|
|
||||||
|
evas_software_win32.h
|
||||||
|
This is the main header file for the application. It includes other
|
||||||
|
project specific headers (including Resource.h).
|
||||||
|
|
||||||
|
evas_software_win32.vcp
|
||||||
|
This file (the project file) contains information at the project level and
|
||||||
|
is used to build a single project or subproject. Other users can share the
|
||||||
|
project (.vcp) file, but they should export the makefiles locally.
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
AppWizard has created the following resources:
|
||||||
|
|
||||||
|
evas_software_win32.rc
|
||||||
|
This is a listing of all of the Microsoft Windows CE resources that the
|
||||||
|
program uses. This file can be directly edited in Microsoft
|
||||||
|
eMbedded Visual C++.
|
||||||
|
|
||||||
|
evas_software_win32.ico
|
||||||
|
This is an icon file, which is used as the application's icon (32x32).
|
||||||
|
This icon is included by the main resource file evas_software_win32.rc.
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
Other standard files:
|
||||||
|
|
||||||
|
StdAfx.h, StdAfx.cpp
|
||||||
|
These files are used to build a precompiled header (PCH) file
|
||||||
|
named evas_software_win32.pch and a precompiled types file named StdAfx.obj.
|
||||||
|
|
||||||
|
Resource.h
|
||||||
|
This is the standard header file, which defines new resource IDs.
|
||||||
|
Microsoft eMbedded Visual C++ reads and updates this file.
|
||||||
|
|
||||||
|
Newres.h
|
||||||
|
This header file is used to replace the ..\mfc\include\afxres.h.
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
Other notes:
|
||||||
|
|
||||||
|
AppWizard uses "TODO:" to indicate parts of the source code you
|
||||||
|
should add to or customize.
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
|
@ -0,0 +1,8 @@
|
||||||
|
// stdafx.cpp : source file that includes just the standard includes
|
||||||
|
// evas_software_win32.pch will be the pre-compiled header
|
||||||
|
// stdafx.obj will contain the pre-compiled type information
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
|
||||||
|
// TODO: reference any additional headers you need in STDAFX.H
|
||||||
|
// and not in this file
|
|
@ -0,0 +1,25 @@
|
||||||
|
// stdafx.h : include file for standard system include files,
|
||||||
|
// or project specific include files that are used frequently, but
|
||||||
|
// are changed infrequently
|
||||||
|
//
|
||||||
|
|
||||||
|
#if !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
|
||||||
|
#define AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
|
||||||
|
|
||||||
|
#if _MSC_VER > 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER > 1000
|
||||||
|
|
||||||
|
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||||
|
|
||||||
|
// Windows Header Files:
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
|
// Local Header Files
|
||||||
|
|
||||||
|
// TODO: reference additional headers your program requires here
|
||||||
|
|
||||||
|
//{{AFX_INSERT_LOCATION}}
|
||||||
|
// Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.
|
||||||
|
|
||||||
|
#endif // !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
|
|
@ -0,0 +1,323 @@
|
||||||
|
// evas_software_win32.c : Defines the entry point for the application.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "evas_software_win32.h"
|
||||||
|
#include <commctrl.h>
|
||||||
|
|
||||||
|
#include "Evas.h"
|
||||||
|
|
||||||
|
#include "evas_test_main.h"
|
||||||
|
|
||||||
|
#include "Evas_Engine_Software_win32_gdi.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define MAX_LOADSTRING 100
|
||||||
|
|
||||||
|
|
||||||
|
// Global Variables:
|
||||||
|
HINSTANCE hInst; // The current instance
|
||||||
|
HWND hwndCB; // The command bar handle
|
||||||
|
|
||||||
|
// Forward declarations of functions included in this code module:
|
||||||
|
ATOM MyRegisterClass (HINSTANCE, LPTSTR);
|
||||||
|
BOOL InitInstance (HINSTANCE, int);
|
||||||
|
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
|
||||||
|
LRESULT CALLBACK About (HWND, UINT, WPARAM, LPARAM);
|
||||||
|
|
||||||
|
int WINAPI WinMain( HINSTANCE hInstance,
|
||||||
|
HINSTANCE hPrevInstance,
|
||||||
|
LPTSTR lpCmdLine,
|
||||||
|
int nCmdShow)
|
||||||
|
{
|
||||||
|
MSG msg;
|
||||||
|
HACCEL hAccelTable;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Perform application initialization:
|
||||||
|
if (!InitInstance (hInstance, nCmdShow))
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_EVAS_SOFTWARE_WIN32);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
setup();
|
||||||
|
orig_start_time = start_time = get_time();
|
||||||
|
|
||||||
|
// Main message loop:
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
|
||||||
|
{
|
||||||
|
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
|
||||||
|
{
|
||||||
|
TranslateMessage(&msg);
|
||||||
|
DispatchMessage(&msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(msg.message == WM_QUIT)
|
||||||
|
return msg.wParam;
|
||||||
|
|
||||||
|
loop();
|
||||||
|
evas_render(evas);
|
||||||
|
}
|
||||||
|
|
||||||
|
return msg.wParam;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// FUNCTION: MyRegisterClass()
|
||||||
|
//
|
||||||
|
// PURPOSE: Registers the window class.
|
||||||
|
//
|
||||||
|
// COMMENTS:
|
||||||
|
//
|
||||||
|
// It is important to call this function so that the application
|
||||||
|
// will get 'well formed' small icons associated with it.
|
||||||
|
//
|
||||||
|
ATOM MyRegisterClass(HINSTANCE hInstance, LPTSTR szWindowClass)
|
||||||
|
{
|
||||||
|
WNDCLASS wc;
|
||||||
|
|
||||||
|
wc.style = CS_HREDRAW | CS_VREDRAW;
|
||||||
|
wc.lpfnWndProc = (WNDPROC) WndProc;
|
||||||
|
wc.cbClsExtra = 0;
|
||||||
|
wc.cbWndExtra = 0;
|
||||||
|
wc.hInstance = hInstance;
|
||||||
|
wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_EVAS_SOFTWARE_WIN32));
|
||||||
|
wc.hCursor = 0;
|
||||||
|
wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
|
||||||
|
wc.lpszMenuName = 0;
|
||||||
|
wc.lpszClassName = szWindowClass;
|
||||||
|
|
||||||
|
return RegisterClass(&wc);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// FUNCTION: InitInstance(HANDLE, int)
|
||||||
|
//
|
||||||
|
// PURPOSE: Saves instance handle and creates main window
|
||||||
|
//
|
||||||
|
// COMMENTS:
|
||||||
|
//
|
||||||
|
// In this function, we save the instance handle in a global variable and
|
||||||
|
// create and display the main program window.
|
||||||
|
//
|
||||||
|
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||||
|
{
|
||||||
|
HWND hWnd;
|
||||||
|
TCHAR szTitle[MAX_LOADSTRING]; // The title bar text
|
||||||
|
TCHAR szWindowClass[MAX_LOADSTRING]; // The window class name
|
||||||
|
|
||||||
|
hInst = hInstance; // Store instance handle in our global variable
|
||||||
|
// Initialize global strings
|
||||||
|
LoadString(hInstance, IDC_EVAS_SOFTWARE_WIN32, szWindowClass, MAX_LOADSTRING);
|
||||||
|
MyRegisterClass(hInstance, szWindowClass);
|
||||||
|
|
||||||
|
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
|
||||||
|
hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE|WS_CAPTION|WS_SYSMENU,
|
||||||
|
0, 0, (int)win_w, (int)win_h+24, NULL, NULL, hInstance, NULL);
|
||||||
|
|
||||||
|
if (!hWnd)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ShowWindow(hWnd, nCmdShow);
|
||||||
|
UpdateWindow(hWnd);
|
||||||
|
// if (hwndCB)
|
||||||
|
// CommandBar_Show(hwndCB, TRUE);
|
||||||
|
|
||||||
|
|
||||||
|
evas = evas_new();
|
||||||
|
evas_output_method_set(evas, evas_render_method_lookup("software_win32_gdi"));
|
||||||
|
evas_output_size_set(evas, win_w, win_h);
|
||||||
|
evas_output_viewport_set(evas, 0, 0, win_w, win_h);
|
||||||
|
|
||||||
|
{
|
||||||
|
Evas_Engine_Info_Software_Win32_GDI *einfo;
|
||||||
|
|
||||||
|
|
||||||
|
einfo = (Evas_Engine_Info_Software_Win32_GDI *)evas_engine_info_get(evas);
|
||||||
|
|
||||||
|
einfo->info.hwnd = hWnd;
|
||||||
|
einfo->info.rotation = 0;
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
HDC hdc;
|
||||||
|
int c;
|
||||||
|
|
||||||
|
|
||||||
|
hdc = GetDC(hWnd);
|
||||||
|
c = GetDeviceCaps(hdc,BITSPIXEL);
|
||||||
|
|
||||||
|
einfo->info.depth = c;
|
||||||
|
|
||||||
|
|
||||||
|
c = GetDeviceCaps(hdc,RASTERCAPS);
|
||||||
|
|
||||||
|
|
||||||
|
ReleaseDC(hWnd,hdc);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
evas_engine_info_set(evas, (Evas_Engine_Info *)einfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
|
||||||
|
//
|
||||||
|
// PURPOSE: Processes messages for the main window.
|
||||||
|
//
|
||||||
|
// WM_COMMAND - process the application menu
|
||||||
|
// WM_PAINT - Paint the main window
|
||||||
|
// WM_DESTROY - post a quit message and return
|
||||||
|
//
|
||||||
|
//
|
||||||
|
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
HDC hdc;
|
||||||
|
int wmId, wmEvent;
|
||||||
|
PAINTSTRUCT ps;
|
||||||
|
TCHAR szHello[MAX_LOADSTRING];
|
||||||
|
RECT rect;
|
||||||
|
|
||||||
|
|
||||||
|
switch (message)
|
||||||
|
{
|
||||||
|
case WM_COMMAND:
|
||||||
|
wmId = LOWORD(wParam);
|
||||||
|
wmEvent = HIWORD(wParam);
|
||||||
|
// Parse the menu selections:
|
||||||
|
switch (wmId)
|
||||||
|
{
|
||||||
|
case IDM_HELP_ABOUT:
|
||||||
|
DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);
|
||||||
|
break;
|
||||||
|
case IDM_FILE_EXIT:
|
||||||
|
DestroyWindow(hWnd);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case WM_CREATE:
|
||||||
|
// hwndCB = CommandBar_Create(hInst, hWnd, 1);
|
||||||
|
// CommandBar_InsertMenubar(hwndCB, hInst, IDM_MENU, 0);
|
||||||
|
// CommandBar_AddAdornments(hwndCB, 0, 0);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WM_LBUTTONDOWN:
|
||||||
|
evas_event_feed_mouse_move(evas, LOWORD(lParam), HIWORD(lParam));
|
||||||
|
evas_event_feed_mouse_down(evas, 1);
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
case WM_LBUTTONUP:
|
||||||
|
evas_event_feed_mouse_move(evas, LOWORD(lParam), HIWORD(lParam));
|
||||||
|
evas_event_feed_mouse_up(evas, 1);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WM_MOVE:
|
||||||
|
evas_event_feed_mouse_move(evas, LOWORD(lParam), HIWORD(lParam));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WM_SIZE:
|
||||||
|
evas_output_size_set(evas, LOWORD(lParam), HIWORD(lParam));
|
||||||
|
break;
|
||||||
|
|
||||||
|
/*
|
||||||
|
case WM_ERASEBKGND:
|
||||||
|
|
||||||
|
// Get window coordinates, and normalize.
|
||||||
|
GetWindowRect(hWnd, &rect);
|
||||||
|
rect.right = rect.right - rect.left; // Get width.
|
||||||
|
rect.bottom = rect.bottom - rect.top; // Get height.
|
||||||
|
rect.left = rect.top = 0;
|
||||||
|
|
||||||
|
evas_damage_rectangle_add(evas,
|
||||||
|
rect.left,
|
||||||
|
rect.top,
|
||||||
|
rect.right,
|
||||||
|
rect.bottom);
|
||||||
|
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
break;
|
||||||
|
*/
|
||||||
|
|
||||||
|
case WM_PAINT:
|
||||||
|
hdc = BeginPaint(hWnd, &ps);
|
||||||
|
rect.right = ps.rcPaint.right - ps.rcPaint.left; // Get width.
|
||||||
|
rect.bottom = ps.rcPaint.bottom - ps.rcPaint.top; // Get height.
|
||||||
|
rect.left = ps.rcPaint.left;
|
||||||
|
rect.top = ps.rcPaint.top;
|
||||||
|
ps.fErase = TRUE;
|
||||||
|
|
||||||
|
evas_damage_rectangle_add(evas,
|
||||||
|
rect.left,
|
||||||
|
rect.top,
|
||||||
|
rect.right,
|
||||||
|
rect.bottom);
|
||||||
|
EndPaint(hWnd, &ps);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WM_DESTROY:
|
||||||
|
CommandBar_Destroy(hwndCB);
|
||||||
|
PostQuitMessage(0);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mesage handler for the About box.
|
||||||
|
LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
RECT rt, rt1;
|
||||||
|
int DlgWidth, DlgHeight; // dialog width and height in pixel units
|
||||||
|
int NewPosX, NewPosY;
|
||||||
|
|
||||||
|
switch (message)
|
||||||
|
{
|
||||||
|
case WM_INITDIALOG:
|
||||||
|
// trying to center the About dialog
|
||||||
|
if (GetWindowRect(hDlg, &rt1)) {
|
||||||
|
GetClientRect(GetParent(hDlg), &rt);
|
||||||
|
DlgWidth = rt1.right - rt1.left;
|
||||||
|
DlgHeight = rt1.bottom - rt1.top ;
|
||||||
|
NewPosX = (rt.right - rt.left - DlgWidth)/2;
|
||||||
|
NewPosY = (rt.bottom - rt.top - DlgHeight)/2;
|
||||||
|
|
||||||
|
// if the About box is larger than the physical screen
|
||||||
|
if (NewPosX < 0) NewPosX = 0;
|
||||||
|
if (NewPosY < 0) NewPosY = 0;
|
||||||
|
SetWindowPos(hDlg, 0, NewPosX, NewPosY,
|
||||||
|
0, 0, SWP_NOZORDER | SWP_NOSIZE);
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
case WM_COMMAND:
|
||||||
|
if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL))
|
||||||
|
{
|
||||||
|
EndDialog(hDlg, LOWORD(wParam));
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
|
||||||
|
#if !defined(AFX_EVAS_SOFTWARE_WIN32_H__16C4A65E_CA5A_452B_930E_842EC94AF401__INCLUDED_)
|
||||||
|
#define AFX_EVAS_SOFTWARE_WIN32_H__16C4A65E_CA5A_452B_930E_842EC94AF401__INCLUDED_
|
||||||
|
|
||||||
|
#if _MSC_VER > 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER > 1000
|
||||||
|
|
||||||
|
#include "resource.h"
|
||||||
|
|
||||||
|
|
||||||
|
#endif // !defined(AFX_EVAS_SOFTWARE_WIN32_H__16C4A65E_CA5A_452B_930E_842EC94AF401__INCLUDED_)
|
|
@ -0,0 +1,152 @@
|
||||||
|
//Microsoft eMbedded Visual C++ generated resource script.
|
||||||
|
//
|
||||||
|
#include "resource.h"
|
||||||
|
|
||||||
|
#define APSTUDIO_READONLY_SYMBOLS
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Generated from the TEXTINCLUDE 2 resource.
|
||||||
|
//
|
||||||
|
#include "newres.h"
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#undef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// English (U.S.) resources
|
||||||
|
|
||||||
|
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||||
|
#ifdef _WIN32
|
||||||
|
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||||
|
#pragma code_page(1252)
|
||||||
|
#endif //_WIN32
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Icon
|
||||||
|
//
|
||||||
|
|
||||||
|
// Icon with lowest ID value placed first to ensure application icon
|
||||||
|
// remains consistent on all systems.
|
||||||
|
IDI_EVAS_SOFTWARE_WIN32 ICON DISCARDABLE "evas_software_win32.ICO"
|
||||||
|
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// TEXTINCLUDE
|
||||||
|
//
|
||||||
|
|
||||||
|
1 TEXTINCLUDE DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
"resource.h\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
2 TEXTINCLUDE DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
"#include ""newres.h""\r\n"
|
||||||
|
"\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
3 TEXTINCLUDE DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
"\r\n"
|
||||||
|
"\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Menu
|
||||||
|
//
|
||||||
|
|
||||||
|
IDM_MENU MENU DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
POPUP "&File"
|
||||||
|
BEGIN
|
||||||
|
MENUITEM "E&xit", IDM_FILE_EXIT
|
||||||
|
END
|
||||||
|
POPUP "&Help"
|
||||||
|
BEGIN
|
||||||
|
MENUITEM "&About", IDM_HELP_ABOUT
|
||||||
|
END
|
||||||
|
END
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Dialog
|
||||||
|
//
|
||||||
|
|
||||||
|
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 125, 55
|
||||||
|
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
|
EXSTYLE 0x80000000L
|
||||||
|
CAPTION "About evas_software_win32"
|
||||||
|
FONT 8, "System"
|
||||||
|
BEGIN
|
||||||
|
ICON IDI_EVAS_SOFTWARE_WIN32,IDC_STATIC,11,17,20,20
|
||||||
|
LTEXT "evas_software_win32 Version 1.0",IDC_STATIC,38,10,70,8,
|
||||||
|
SS_NOPREFIX
|
||||||
|
LTEXT "Copyright (C) 2002",IDC_STATIC,38,25,70,8
|
||||||
|
END
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// DESIGNINFO
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
GUIDELINES DESIGNINFO DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
IDD_ABOUTBOX, DIALOG
|
||||||
|
BEGIN
|
||||||
|
LEFTMARGIN, 7
|
||||||
|
RIGHTMARGIN, 118
|
||||||
|
TOPMARGIN, 7
|
||||||
|
BOTTOMMARGIN, 48
|
||||||
|
END
|
||||||
|
END
|
||||||
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Accelerator
|
||||||
|
//
|
||||||
|
|
||||||
|
IDC_EVAS_SOFTWARE_WIN32 ACCELERATORS DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
"/", IDM_HELP_ABOUT, ASCII, ALT, NOINVERT
|
||||||
|
VK_F4, IDM_FILE_EXIT, VIRTKEY, ALT, NOINVERT
|
||||||
|
END
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// String Table
|
||||||
|
//
|
||||||
|
|
||||||
|
STRINGTABLE DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
IDS_APP_TITLE "WinCE EVAS Test"
|
||||||
|
IDS_HELLO "Hello World!"
|
||||||
|
IDC_EVAS_SOFTWARE_WIN32 "EVAS_SOFTWARE_WIN32"
|
||||||
|
END
|
||||||
|
|
||||||
|
#endif // English (U.S.) resources
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef APSTUDIO_INVOKED
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Generated from the TEXTINCLUDE 3 resource.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#endif // not APSTUDIO_INVOKED
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
#ifndef __NEWRES_H__
|
||||||
|
#define __NEWRES_H__
|
||||||
|
|
||||||
|
#if !defined(UNDER_CE)
|
||||||
|
#define UNDER_CE _WIN32_WCE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(_WIN32_WCE)
|
||||||
|
#if !defined(WCEOLE_ENABLE_DIALOGEX)
|
||||||
|
#define DIALOGEX DIALOG DISCARDABLE
|
||||||
|
#endif
|
||||||
|
#include <commctrl.h>
|
||||||
|
#define SHMENUBAR RCDATA
|
||||||
|
#if defined(WIN32_PLATFORM_PSPC) && (_WIN32_WCE >= 300)
|
||||||
|
#include <aygshell.h>
|
||||||
|
#else
|
||||||
|
#define I_IMAGENONE (-2)
|
||||||
|
#define NOMENU 0xFFFF
|
||||||
|
#define IDS_SHNEW 1
|
||||||
|
|
||||||
|
#define IDM_SHAREDNEW 10
|
||||||
|
#define IDM_SHAREDNEWDEFAULT 11
|
||||||
|
#endif
|
||||||
|
#endif // _WIN32_WCE
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef RC_INVOKED
|
||||||
|
#ifndef _INC_WINDOWS
|
||||||
|
#define _INC_WINDOWS
|
||||||
|
#include "winuser.h" // extract from windows header
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef IDC_STATIC
|
||||||
|
#undef IDC_STATIC
|
||||||
|
#endif
|
||||||
|
#define IDC_STATIC (-1)
|
||||||
|
|
||||||
|
#endif //__NEWRES_H__
|
|
@ -0,0 +1,23 @@
|
||||||
|
//{{NO_DEPENDENCIES}}
|
||||||
|
// Microsoft eMbedded Visual C++ generated include file.
|
||||||
|
// Used by EVAS_SOFTWARE_WIN32.RC
|
||||||
|
//
|
||||||
|
#define IDS_APP_TITLE 1
|
||||||
|
#define IDS_HELLO 2
|
||||||
|
#define IDC_EVAS_SOFTWARE_WIN32 3
|
||||||
|
#define IDI_EVAS_SOFTWARE_WIN32 101
|
||||||
|
#define IDM_MENU 102
|
||||||
|
#define IDD_ABOUTBOX 103
|
||||||
|
#define IDM_FILE_EXIT 40002
|
||||||
|
#define IDM_HELP_ABOUT 40003
|
||||||
|
|
||||||
|
// Next default values for new objects
|
||||||
|
//
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
#define _APS_NEXT_RESOURCE_VALUE 104
|
||||||
|
#define _APS_NEXT_COMMAND_VALUE 40004
|
||||||
|
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||||
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
|
#endif
|
||||||
|
#endif
|
|
@ -0,0 +1,229 @@
|
||||||
|
#include "evas_test_main.h"
|
||||||
|
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
#include <X11/Xutil.h>
|
||||||
|
|
||||||
|
#include "Evas.h"
|
||||||
|
#include "Evas_Engine_Software_X11.h"
|
||||||
|
|
||||||
|
int
|
||||||
|
main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
int pause_me = 0;
|
||||||
|
Display *disp;
|
||||||
|
Window win;
|
||||||
|
XSetWindowAttributes attr;
|
||||||
|
XClassHint chint;
|
||||||
|
XSizeHints szhints;
|
||||||
|
|
||||||
|
disp = XOpenDisplay(NULL);
|
||||||
|
if (!disp)
|
||||||
|
{
|
||||||
|
printf("Error: cannot open display.\n");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
attr.backing_store = NotUseful;
|
||||||
|
attr.colormap = DefaultColormap(disp, DefaultScreen(disp));
|
||||||
|
attr.border_pixel = 0;
|
||||||
|
attr.background_pixmap = None;
|
||||||
|
attr.event_mask =
|
||||||
|
ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask |
|
||||||
|
StructureNotifyMask;
|
||||||
|
attr.bit_gravity = ForgetGravity;
|
||||||
|
win = XCreateWindow(disp, DefaultRootWindow(disp), 0, 0, win_w, win_h, 0,
|
||||||
|
DefaultDepth(disp, DefaultScreen(disp)), InputOutput,
|
||||||
|
DefaultVisual(disp, DefaultScreen(disp)),
|
||||||
|
CWBackingStore | CWColormap |
|
||||||
|
CWBackPixmap | CWBorderPixel |
|
||||||
|
CWBitGravity | CWEventMask, &attr);
|
||||||
|
XStoreName(disp, win, "Evas Software X11 Test");
|
||||||
|
chint.res_name = "Evas_Software_X11_Test";
|
||||||
|
chint.res_class = "Main";
|
||||||
|
XSetClassHint(disp, win, &chint);
|
||||||
|
#if 0
|
||||||
|
szhints.flags = PMinSize | PMaxSize | PSize | USSize;
|
||||||
|
szhints.min_width = szhints.max_width = win_w;
|
||||||
|
szhints.min_height = szhints.max_height = win_h;
|
||||||
|
XSetWMNormalHints(disp, win, &szhints);
|
||||||
|
#endif
|
||||||
|
XMapWindow(disp, win);
|
||||||
|
XSync(disp, False);
|
||||||
|
|
||||||
|
/* test evas_free.... :) */
|
||||||
|
evas = evas_new();
|
||||||
|
evas_output_method_set(evas, evas_render_method_lookup("software_x11"));
|
||||||
|
evas_output_size_set(evas, win_w, win_h);
|
||||||
|
evas_output_viewport_set(evas, 0, 0, win_w, win_h);
|
||||||
|
{
|
||||||
|
Evas_Engine_Info_Software_X11 *einfo;
|
||||||
|
|
||||||
|
einfo = (Evas_Engine_Info_Software_X11 *) evas_engine_info_get(evas);
|
||||||
|
|
||||||
|
/* the following is specific to the engine */
|
||||||
|
einfo->info.display = disp;
|
||||||
|
einfo->info.visual = DefaultVisual(disp, DefaultScreen(disp));
|
||||||
|
einfo->info.colormap = DefaultColormap(disp, DefaultScreen(disp));
|
||||||
|
einfo->info.drawable = win;
|
||||||
|
einfo->info.depth = DefaultDepth(disp, DefaultScreen(disp));
|
||||||
|
einfo->info.rotation = 0;
|
||||||
|
einfo->info.debug = 0;
|
||||||
|
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
|
||||||
|
}
|
||||||
|
setup();
|
||||||
|
printf("################ evas free\n");
|
||||||
|
evas_free(evas);
|
||||||
|
printf("evas freed. DONE\n");
|
||||||
|
|
||||||
|
evas = evas_new();
|
||||||
|
evas_output_method_set(evas, evas_render_method_lookup("software_x11"));
|
||||||
|
evas_output_size_set(evas, win_w, win_h);
|
||||||
|
evas_output_viewport_set(evas, 0, 0, win_w, win_h);
|
||||||
|
{
|
||||||
|
Evas_Engine_Info_Software_X11 *einfo;
|
||||||
|
|
||||||
|
einfo = (Evas_Engine_Info_Software_X11 *) evas_engine_info_get(evas);
|
||||||
|
|
||||||
|
/* the following is specific to the engine */
|
||||||
|
einfo->info.display = disp;
|
||||||
|
einfo->info.visual = DefaultVisual(disp, DefaultScreen(disp));
|
||||||
|
einfo->info.colormap = DefaultColormap(disp, DefaultScreen(disp));
|
||||||
|
einfo->info.drawable = win;
|
||||||
|
einfo->info.depth = DefaultDepth(disp, DefaultScreen(disp));
|
||||||
|
einfo->info.rotation = 0;
|
||||||
|
einfo->info.debug = 0;
|
||||||
|
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
|
||||||
|
}
|
||||||
|
setup();
|
||||||
|
printf("################ evas free\n");
|
||||||
|
evas_free(evas);
|
||||||
|
printf("evas freed. DONE\n");
|
||||||
|
|
||||||
|
evas = evas_new();
|
||||||
|
evas_output_method_set(evas, evas_render_method_lookup("software_x11"));
|
||||||
|
evas_output_size_set(evas, win_w, win_h);
|
||||||
|
evas_output_viewport_set(evas, 0, 0, win_w, win_h);
|
||||||
|
{
|
||||||
|
Evas_Engine_Info_Software_X11 *einfo;
|
||||||
|
|
||||||
|
einfo = (Evas_Engine_Info_Software_X11 *) evas_engine_info_get(evas);
|
||||||
|
|
||||||
|
/* the following is specific to the engine */
|
||||||
|
einfo->info.display = disp;
|
||||||
|
einfo->info.visual = DefaultVisual(disp, DefaultScreen(disp));
|
||||||
|
einfo->info.colormap = DefaultColormap(disp, DefaultScreen(disp));
|
||||||
|
einfo->info.drawable = win;
|
||||||
|
einfo->info.depth = DefaultDepth(disp, DefaultScreen(disp));
|
||||||
|
einfo->info.rotation = 0;
|
||||||
|
einfo->info.debug = 0;
|
||||||
|
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
|
||||||
|
}
|
||||||
|
setup();
|
||||||
|
printf("################ evas free\n");
|
||||||
|
evas_free(evas);
|
||||||
|
printf("evas freed. DONE\n");
|
||||||
|
|
||||||
|
evas = evas_new();
|
||||||
|
evas_output_method_set(evas, evas_render_method_lookup("software_x11"));
|
||||||
|
evas_output_size_set(evas, win_w, win_h);
|
||||||
|
evas_output_viewport_set(evas, 0, 0, win_w, win_h);
|
||||||
|
{
|
||||||
|
Evas_Engine_Info_Software_X11 *einfo;
|
||||||
|
|
||||||
|
einfo = (Evas_Engine_Info_Software_X11 *) evas_engine_info_get(evas);
|
||||||
|
|
||||||
|
/* the following is specific to the engine */
|
||||||
|
einfo->info.display = disp;
|
||||||
|
einfo->info.visual = DefaultVisual(disp, DefaultScreen(disp));
|
||||||
|
einfo->info.colormap = DefaultColormap(disp, DefaultScreen(disp));
|
||||||
|
einfo->info.drawable = win;
|
||||||
|
einfo->info.depth = DefaultDepth(disp, DefaultScreen(disp));
|
||||||
|
einfo->info.rotation = 0;
|
||||||
|
einfo->info.debug = 0;
|
||||||
|
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
|
||||||
|
}
|
||||||
|
setup();
|
||||||
|
printf("################ evas free\n");
|
||||||
|
evas_free(evas);
|
||||||
|
printf("evas freed. DONE\n");
|
||||||
|
|
||||||
|
evas = evas_new();
|
||||||
|
evas_output_method_set(evas, evas_render_method_lookup("software_x11"));
|
||||||
|
evas_output_size_set(evas, win_w, win_h);
|
||||||
|
evas_output_viewport_set(evas, 0, 0, win_w, win_h);
|
||||||
|
{
|
||||||
|
Evas_Engine_Info_Software_X11 *einfo;
|
||||||
|
|
||||||
|
einfo = (Evas_Engine_Info_Software_X11 *) evas_engine_info_get(evas);
|
||||||
|
|
||||||
|
/* the following is specific to the engine */
|
||||||
|
einfo->info.display = disp;
|
||||||
|
einfo->info.visual = DefaultVisual(disp, DefaultScreen(disp));
|
||||||
|
einfo->info.colormap = DefaultColormap(disp, DefaultScreen(disp));
|
||||||
|
einfo->info.drawable = win;
|
||||||
|
einfo->info.depth = DefaultDepth(disp, DefaultScreen(disp));
|
||||||
|
einfo->info.rotation = 0;
|
||||||
|
einfo->info.debug = 0;
|
||||||
|
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
|
||||||
|
}
|
||||||
|
setup();
|
||||||
|
orig_start_time = start_time = get_time();
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
XEvent ev;
|
||||||
|
|
||||||
|
while (XCheckMaskEvent(disp,
|
||||||
|
ExposureMask |
|
||||||
|
StructureNotifyMask |
|
||||||
|
KeyPressMask |
|
||||||
|
KeyReleaseMask |
|
||||||
|
ButtonPressMask |
|
||||||
|
ButtonReleaseMask | PointerMotionMask, &ev))
|
||||||
|
{
|
||||||
|
switch (ev.type)
|
||||||
|
{
|
||||||
|
case ButtonPress:
|
||||||
|
if (ev.xbutton.button == 3)
|
||||||
|
exit(0);
|
||||||
|
if (!pause_me)
|
||||||
|
pause_me = 1;
|
||||||
|
else if (pause_me == 1)
|
||||||
|
pause_me = 2;
|
||||||
|
else
|
||||||
|
pause_me = 1;
|
||||||
|
evas_event_feed_mouse_move(evas, ev.xbutton.x, ev.xbutton.y);
|
||||||
|
evas_event_feed_mouse_down(evas, ev.xbutton.button);
|
||||||
|
break;
|
||||||
|
case ButtonRelease:
|
||||||
|
evas_event_feed_mouse_move(evas, ev.xbutton.x, ev.xbutton.y);
|
||||||
|
evas_event_feed_mouse_up(evas, ev.xbutton.button);
|
||||||
|
break;
|
||||||
|
case MotionNotify:
|
||||||
|
evas_event_feed_mouse_move(evas, ev.xmotion.x, ev.xmotion.y);
|
||||||
|
break;
|
||||||
|
case Expose:
|
||||||
|
evas_damage_rectangle_add(evas,
|
||||||
|
ev.xexpose.x,
|
||||||
|
ev.xexpose.y,
|
||||||
|
ev.xexpose.width,
|
||||||
|
ev.xexpose.height);
|
||||||
|
break;
|
||||||
|
case ConfigureNotify:
|
||||||
|
evas_output_size_set(evas,
|
||||||
|
ev.xconfigure.width,
|
||||||
|
ev.xconfigure.height);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!(pause_me == 1))
|
||||||
|
{
|
||||||
|
loop();
|
||||||
|
evas_render(evas);
|
||||||
|
XFlush(disp);
|
||||||
|
}
|
||||||
|
if (pause_me == 2)
|
||||||
|
usleep(100000);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -0,0 +1,181 @@
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
#include <X11/Xutil.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#include "Evas.h"
|
||||||
|
#include "Evas_Engine_Software_X11.h"
|
||||||
|
|
||||||
|
Display *disp = NULL;
|
||||||
|
Window win = 0;
|
||||||
|
|
||||||
|
Evas *evas = NULL;
|
||||||
|
|
||||||
|
int win_w = 240;
|
||||||
|
int win_h = 240;
|
||||||
|
|
||||||
|
int
|
||||||
|
main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
int exposed = 0;
|
||||||
|
|
||||||
|
XSetWindowAttributes attr;
|
||||||
|
XClassHint chint;
|
||||||
|
XSizeHints szhints;
|
||||||
|
|
||||||
|
disp = XOpenDisplay(NULL);
|
||||||
|
if (!disp)
|
||||||
|
{
|
||||||
|
printf("Error: cannot open display.\n");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
attr.backing_store = NotUseful;
|
||||||
|
attr.colormap = DefaultColormap(disp, DefaultScreen(disp));
|
||||||
|
attr.border_pixel = 0;
|
||||||
|
attr.background_pixmap = None;
|
||||||
|
attr.event_mask =
|
||||||
|
ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask;
|
||||||
|
attr.bit_gravity = ForgetGravity;
|
||||||
|
win = XCreateWindow(disp, DefaultRootWindow(disp), 0, 0, win_w, win_h, 0,
|
||||||
|
DefaultDepth(disp, DefaultScreen(disp)), InputOutput,
|
||||||
|
DefaultVisual(disp, DefaultScreen(disp)),
|
||||||
|
CWBackingStore | CWColormap |
|
||||||
|
CWBackPixmap | CWBorderPixel |
|
||||||
|
CWBitGravity | CWEventMask, &attr);
|
||||||
|
XStoreName(disp, win, "Evas Performance Test");
|
||||||
|
chint.res_name = "Evas_Test";
|
||||||
|
chint.res_class = "Main";
|
||||||
|
XSetClassHint(disp, win, &chint);
|
||||||
|
szhints.flags = PMinSize | PMaxSize | PSize | USSize;
|
||||||
|
szhints.max_width = win_w;
|
||||||
|
szhints.max_height = win_h;
|
||||||
|
szhints.min_width = win_w;
|
||||||
|
szhints.min_height = win_h;
|
||||||
|
XSetWMNormalHints(disp, win, &szhints);
|
||||||
|
XMapWindow(disp, win);
|
||||||
|
|
||||||
|
evas = evas_new();
|
||||||
|
evas_output_method_set(evas, evas_render_method_lookup("software_x11"));
|
||||||
|
evas_output_size_set(evas, win_w, win_h);
|
||||||
|
evas_output_viewport_set(evas, 0, 0, win_w, win_h);
|
||||||
|
{
|
||||||
|
Evas_Engine_Info_Software_X11 *einfo;
|
||||||
|
|
||||||
|
einfo = (Evas_Engine_Info_Software_X11 *) evas_engine_info_get(evas);
|
||||||
|
|
||||||
|
/* the following is specific to the engine */
|
||||||
|
einfo->info.display = disp;
|
||||||
|
einfo->info.visual = DefaultVisual(disp, DefaultScreen(disp));
|
||||||
|
einfo->info.colormap = DefaultColormap(disp, DefaultScreen(disp));
|
||||||
|
einfo->info.drawable = win;
|
||||||
|
einfo->info.depth = DefaultDepth(disp, DefaultScreen(disp));
|
||||||
|
einfo->info.rotation = 0;
|
||||||
|
|
||||||
|
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
|
||||||
|
}
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
XEvent ev;
|
||||||
|
|
||||||
|
while (XCheckMaskEvent(disp,
|
||||||
|
ExposureMask |
|
||||||
|
StructureNotifyMask |
|
||||||
|
KeyPressMask |
|
||||||
|
KeyReleaseMask |
|
||||||
|
ButtonPressMask |
|
||||||
|
ButtonReleaseMask | PointerMotionMask, &ev))
|
||||||
|
{
|
||||||
|
switch (ev.type)
|
||||||
|
{
|
||||||
|
case ButtonPress:
|
||||||
|
/* evas_event_button_down(evas, ev.xbutton.x, ev.xbutton.y, ev.xbutton.button);*/
|
||||||
|
break;
|
||||||
|
case ButtonRelease:
|
||||||
|
/* evas_event_button_up(evas, ev.xbutton.x, ev.xbutton.y, ev.xbutton.button);*/
|
||||||
|
break;
|
||||||
|
case MotionNotify:
|
||||||
|
/* evas_event_move(evas, ev.xmotion.x, ev.xmotion.y);*/
|
||||||
|
break;
|
||||||
|
case Expose:
|
||||||
|
exposed = 1;
|
||||||
|
evas_damage_rectangle_add(evas,
|
||||||
|
ev.xexpose.x,
|
||||||
|
ev.xexpose.y,
|
||||||
|
ev.xexpose.width,
|
||||||
|
ev.xexpose.height);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
evas_render(evas);
|
||||||
|
XFlush(disp);
|
||||||
|
if (exposed)
|
||||||
|
{
|
||||||
|
Evas_Engine_Info_Software_X11 *einfo;
|
||||||
|
Evas_Performance *perf;
|
||||||
|
char buf[4096];
|
||||||
|
char *data, *key;
|
||||||
|
static mode_t default_mode =
|
||||||
|
S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH |
|
||||||
|
S_IXOTH;
|
||||||
|
FILE *f;
|
||||||
|
|
||||||
|
data = NULL;
|
||||||
|
einfo =
|
||||||
|
(Evas_Engine_Info_Software_X11 *) evas_engine_info_get(evas);
|
||||||
|
perf =
|
||||||
|
einfo->func.performance_new(evas, disp,
|
||||||
|
DefaultVisual(disp,
|
||||||
|
DefaultScreen(disp)),
|
||||||
|
DefaultColormap(disp,
|
||||||
|
DefaultScreen
|
||||||
|
(disp)), win,
|
||||||
|
DefaultDepth(disp,
|
||||||
|
DefaultScreen(disp)));
|
||||||
|
key = einfo->func.performance_key_get(perf);
|
||||||
|
snprintf(buf, sizeof(buf), "%s/.evas/%s", getenv("HOME"), key);
|
||||||
|
free(key);
|
||||||
|
f = fopen(buf, "r");
|
||||||
|
if (f)
|
||||||
|
{
|
||||||
|
char buf[4096];
|
||||||
|
size_t sz;
|
||||||
|
|
||||||
|
sz = fread(buf, 1, 4000, f);
|
||||||
|
if (sz > 0)
|
||||||
|
{
|
||||||
|
data = malloc(sz + 1);
|
||||||
|
if (data)
|
||||||
|
{
|
||||||
|
strncpy(data, buf, sz);
|
||||||
|
data[sz] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fclose(f);
|
||||||
|
}
|
||||||
|
if (data)
|
||||||
|
{
|
||||||
|
einfo->func.performance_build(perf, data);
|
||||||
|
einfo->func.performance_device_store(perf);
|
||||||
|
free(data);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("No cached performance values for your display.\n");
|
||||||
|
printf("Please run evas_perf_test to generate them.\n");
|
||||||
|
einfo->func.performance_free(perf);
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
einfo->func.performance_free(perf);
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -0,0 +1,162 @@
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
#include <X11/Xutil.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#include "Evas.h"
|
||||||
|
#include "Evas_Engine_Software_X11.h"
|
||||||
|
|
||||||
|
Display *disp = NULL;
|
||||||
|
Window win = 0;
|
||||||
|
|
||||||
|
Evas *evas = NULL;
|
||||||
|
|
||||||
|
int win_w = 240;
|
||||||
|
int win_h = 240;
|
||||||
|
|
||||||
|
int
|
||||||
|
main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
int exposed = 0;
|
||||||
|
|
||||||
|
XSetWindowAttributes attr;
|
||||||
|
XClassHint chint;
|
||||||
|
XSizeHints szhints;
|
||||||
|
|
||||||
|
disp = XOpenDisplay(NULL);
|
||||||
|
if (!disp)
|
||||||
|
{
|
||||||
|
printf("Error: cannot open display.\n");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
attr.backing_store = NotUseful;
|
||||||
|
attr.colormap = DefaultColormap(disp, DefaultScreen(disp));
|
||||||
|
attr.border_pixel = 0;
|
||||||
|
attr.background_pixmap = None;
|
||||||
|
attr.event_mask =
|
||||||
|
ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask;
|
||||||
|
attr.bit_gravity = ForgetGravity;
|
||||||
|
win = XCreateWindow(disp, DefaultRootWindow(disp), 0, 0, win_w, win_h, 0,
|
||||||
|
DefaultDepth(disp, DefaultScreen(disp)), InputOutput,
|
||||||
|
DefaultVisual(disp, DefaultScreen(disp)),
|
||||||
|
CWBackingStore | CWColormap |
|
||||||
|
CWBackPixmap | CWBorderPixel |
|
||||||
|
CWBitGravity | CWEventMask, &attr);
|
||||||
|
XStoreName(disp, win, "Evas Performance Test");
|
||||||
|
chint.res_name = "Evas_Test";
|
||||||
|
chint.res_class = "Main";
|
||||||
|
XSetClassHint(disp, win, &chint);
|
||||||
|
szhints.flags = PMinSize | PMaxSize | PSize | USSize;
|
||||||
|
szhints.max_width = win_w;
|
||||||
|
szhints.max_height = win_h;
|
||||||
|
szhints.min_width = win_w;
|
||||||
|
szhints.min_height = win_h;
|
||||||
|
XSetWMNormalHints(disp, win, &szhints);
|
||||||
|
XMapWindow(disp, win);
|
||||||
|
XSync(disp, False);
|
||||||
|
sleep(1);
|
||||||
|
|
||||||
|
evas = evas_new();
|
||||||
|
evas_output_method_set(evas, evas_render_method_lookup("software_x11"));
|
||||||
|
evas_output_size_set(evas, win_w, win_h);
|
||||||
|
evas_output_viewport_set(evas, 0, 0, win_w, win_h);
|
||||||
|
{
|
||||||
|
Evas_Engine_Info_Software_X11 *einfo;
|
||||||
|
|
||||||
|
einfo = (Evas_Engine_Info_Software_X11 *) evas_engine_info_get(evas);
|
||||||
|
|
||||||
|
/* the following is specific to the engine */
|
||||||
|
einfo->info.display = disp;
|
||||||
|
einfo->info.visual = DefaultVisual(disp, DefaultScreen(disp));
|
||||||
|
einfo->info.colormap = DefaultColormap(disp, DefaultScreen(disp));
|
||||||
|
einfo->info.drawable = win;
|
||||||
|
einfo->info.depth = DefaultDepth(disp, DefaultScreen(disp));
|
||||||
|
einfo->info.rotation = 0;
|
||||||
|
|
||||||
|
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
|
||||||
|
}
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
XEvent ev;
|
||||||
|
|
||||||
|
while (XCheckMaskEvent(disp,
|
||||||
|
ExposureMask |
|
||||||
|
StructureNotifyMask |
|
||||||
|
KeyPressMask |
|
||||||
|
KeyReleaseMask |
|
||||||
|
ButtonPressMask |
|
||||||
|
ButtonReleaseMask | PointerMotionMask, &ev))
|
||||||
|
{
|
||||||
|
switch (ev.type)
|
||||||
|
{
|
||||||
|
case ButtonPress:
|
||||||
|
/* evas_event_button_down(evas, ev.xbutton.x, ev.xbutton.y, ev.xbutton.button);*/
|
||||||
|
break;
|
||||||
|
case ButtonRelease:
|
||||||
|
/* evas_event_button_up(evas, ev.xbutton.x, ev.xbutton.y, ev.xbutton.button);*/
|
||||||
|
break;
|
||||||
|
case MotionNotify:
|
||||||
|
/* evas_event_move(evas, ev.xmotion.x, ev.xmotion.y);*/
|
||||||
|
break;
|
||||||
|
case Expose:
|
||||||
|
exposed = 1;
|
||||||
|
evas_damage_rectangle_add(evas,
|
||||||
|
ev.xexpose.x,
|
||||||
|
ev.xexpose.y,
|
||||||
|
ev.xexpose.width,
|
||||||
|
ev.xexpose.height);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
evas_render(evas);
|
||||||
|
XFlush(disp);
|
||||||
|
if (exposed)
|
||||||
|
{
|
||||||
|
Evas_Engine_Info_Software_X11 *einfo;
|
||||||
|
Evas_Performance *perf;
|
||||||
|
char buf[4096];
|
||||||
|
char *data, *key;
|
||||||
|
static mode_t default_mode =
|
||||||
|
S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH |
|
||||||
|
S_IXOTH;
|
||||||
|
FILE *f;
|
||||||
|
|
||||||
|
einfo =
|
||||||
|
(Evas_Engine_Info_Software_X11 *) evas_engine_info_get(evas);
|
||||||
|
perf =
|
||||||
|
einfo->func.performance_test(evas, disp,
|
||||||
|
DefaultVisual(disp,
|
||||||
|
DefaultScreen(disp)),
|
||||||
|
DefaultColormap(disp,
|
||||||
|
DefaultScreen
|
||||||
|
(disp)), win,
|
||||||
|
DefaultDepth(disp,
|
||||||
|
DefaultScreen(disp)));
|
||||||
|
einfo->func.performance_device_store(perf);
|
||||||
|
data = einfo->func.performance_data_get(perf);
|
||||||
|
key = einfo->func.performance_key_get(perf);
|
||||||
|
snprintf(buf, sizeof(buf), "%s/.evas", getenv("HOME"));
|
||||||
|
mkdir(buf, default_mode);
|
||||||
|
snprintf(buf, sizeof(buf), "%s/.evas/%s", getenv("HOME"), key);
|
||||||
|
free(key);
|
||||||
|
f = fopen(buf, "w");
|
||||||
|
if (f)
|
||||||
|
{
|
||||||
|
fprintf(f, "%s", data);
|
||||||
|
free(data);
|
||||||
|
fclose(f);
|
||||||
|
}
|
||||||
|
einfo->func.performance_free(perf);
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -0,0 +1,43 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
#ifndef _WIN32_WCE
|
||||||
|
# include <sys/time.h>
|
||||||
|
#else
|
||||||
|
# include <time.h>
|
||||||
|
# include <windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "Evas.h"
|
||||||
|
|
||||||
|
|
||||||
|
//_WIN32_WCE
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
extern Evas *evas;
|
||||||
|
extern int win_w;
|
||||||
|
extern int win_h;
|
||||||
|
|
||||||
|
extern int loop_count;
|
||||||
|
extern int orig_loop_count;
|
||||||
|
|
||||||
|
extern double start_time;
|
||||||
|
extern double orig_start_time;
|
||||||
|
|
||||||
|
extern Evas_Object *r1, *r2, *r3, *g1, *g2, *c1, *l1, *p1;
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
double get_time(void);
|
||||||
|
void loop(void);
|
||||||
|
void setup(void);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -0,0 +1,449 @@
|
||||||
|
#ifndef _EVAS_H
|
||||||
|
#define _EVAS_H
|
||||||
|
|
||||||
|
#ifndef EVAS_COMMON_H
|
||||||
|
#ifndef EVAS_PRIVATE_H
|
||||||
|
|
||||||
|
enum _Evas_Callback_Type
|
||||||
|
{
|
||||||
|
EVAS_CALLBACK_MOUSE_IN, /**< Mouse In Event */
|
||||||
|
EVAS_CALLBACK_MOUSE_OUT, /**< Mouse Out Event */
|
||||||
|
EVAS_CALLBACK_MOUSE_DOWN, /**< Mouse Button Down Event */
|
||||||
|
EVAS_CALLBACK_MOUSE_UP, /**< Mouse Button Up Event */
|
||||||
|
EVAS_CALLBACK_MOUSE_MOVE, /**< Mouse Move Event */
|
||||||
|
EVAS_CALLBACK_FREE, /**< Object Being Freed */
|
||||||
|
EVAS_CALLBACK_KEY_DOWN, /**< Key Press Event */
|
||||||
|
EVAS_CALLBACK_KEY_UP, /**< Key Release Event */
|
||||||
|
EVAS_CALLBACK_FOCUS_IN, /**< Focus In Event */
|
||||||
|
EVAS_CALLBACK_FOCUS_OUT /**< Focus Out Event */
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type of event to trigger the callback
|
||||||
|
*/
|
||||||
|
typedef enum _Evas_Callback_Type Evas_Callback_Type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A generic linked list node handle
|
||||||
|
*/
|
||||||
|
typedef struct _Evas_List Evas_List;
|
||||||
|
/**
|
||||||
|
* A generic rectangle handle
|
||||||
|
*/
|
||||||
|
typedef struct _Evas_Rectangle Evas_Rectangle;
|
||||||
|
|
||||||
|
struct _Evas_List
|
||||||
|
{
|
||||||
|
void *data; /**< Pointer to list element payload */
|
||||||
|
Evas_List *next; /**< Next member in the list */
|
||||||
|
Evas_List *prev; /**< Previous member in the list */
|
||||||
|
|
||||||
|
Evas_List *last; /**< Private member. Don't use this */
|
||||||
|
int count; /**< Private member. Don't use this */
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Evas_Rectangle
|
||||||
|
{
|
||||||
|
int x, y, w, h; /**< the co-ordinates of the rectangle, starting top-left and width and height */
|
||||||
|
};
|
||||||
|
|
||||||
|
/** A Hash table handle */
|
||||||
|
typedef void Evas_Hash;
|
||||||
|
/** An Evas canvas handle */
|
||||||
|
typedef void Evas;
|
||||||
|
/** An Evas Object handle */
|
||||||
|
typedef void Evas_Object;
|
||||||
|
/** An Evas Performance handle */
|
||||||
|
typedef void Evas_Performance;
|
||||||
|
/** An Evas Key */
|
||||||
|
typedef void Evas_Key;
|
||||||
|
/** An Evas Modifier */
|
||||||
|
typedef void Evas_Modifier;
|
||||||
|
/** An Evas Lock */
|
||||||
|
typedef void Evas_Lock;
|
||||||
|
/** An Evas Smart Object handle */
|
||||||
|
typedef void Evas_Smart;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** A generic Evas Engine information structure */
|
||||||
|
typedef struct _Evas_Engine_Info Evas_Engine_Info;
|
||||||
|
/** Event structure for #EVAS_CALLBACK_MOUSE_DOWN event callbacks */
|
||||||
|
typedef struct _Evas_Event_Mouse_Down Evas_Event_Mouse_Down;
|
||||||
|
/** Event structure for #EVAS_CALLBACK_MOUSE_UP event callbacks */
|
||||||
|
typedef struct _Evas_Event_Mouse_Up Evas_Event_Mouse_Up;
|
||||||
|
/** Event structure for #EVAS_CALLBACK_MOUSE_IN event callbacks */
|
||||||
|
typedef struct _Evas_Event_Mouse_In Evas_Event_Mouse_In;
|
||||||
|
/** Event structure for #EVAS_CALLBACK_MOUSE_OUT event callbacks */
|
||||||
|
typedef struct _Evas_Event_Mouse_Out Evas_Event_Mouse_Out;
|
||||||
|
/** Event structure for #EVAS_CALLBACK_MOUSE_MOVE event callbacks */
|
||||||
|
typedef struct _Evas_Event_Mouse_Move Evas_Event_Mouse_Move;
|
||||||
|
/** Event structure for #EVAS_CALLBACK_KEY_DOWN event callbacks */
|
||||||
|
typedef struct _Evas_Event_Key_Down Evas_Event_Key_Down;
|
||||||
|
/** Event structure for #EVAS_CALLBACK_KEY_UP event callbacks */
|
||||||
|
typedef struct _Evas_Event_Key_Up Evas_Event_Key_Up;
|
||||||
|
|
||||||
|
#define EVAS_LOAD_ERROR_NONE 0
|
||||||
|
#define EVAS_LOAD_ERROR_GENERIC 1
|
||||||
|
#define EVAS_LOAD_ERROR_DOES_NOT_EXIST 2
|
||||||
|
#define EVAS_LOAD_ERROR_PERMISSION_DENIED 3
|
||||||
|
#define EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED 4
|
||||||
|
#define EVAS_LOAD_ERROR_CORRUPT_FILE 5
|
||||||
|
#define EVAS_LOAD_ERROR_UNKNOWN_FORMAT 6
|
||||||
|
|
||||||
|
struct _Evas_Engine_Info
|
||||||
|
{
|
||||||
|
int magic;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Evas_Event_Mouse_Down
|
||||||
|
{
|
||||||
|
int button;
|
||||||
|
struct {
|
||||||
|
int x, y;
|
||||||
|
} output;
|
||||||
|
struct {
|
||||||
|
double x, y;
|
||||||
|
} canvas;
|
||||||
|
void *data;
|
||||||
|
Evas_Modifier *modifiers;
|
||||||
|
Evas_Lock *locks;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Evas_Event_Mouse_Up
|
||||||
|
{
|
||||||
|
int button;
|
||||||
|
struct {
|
||||||
|
int x, y;
|
||||||
|
} output;
|
||||||
|
struct {
|
||||||
|
double x, y;
|
||||||
|
} canvas;
|
||||||
|
void *data;
|
||||||
|
Evas_Modifier *modifiers;
|
||||||
|
Evas_Lock *locks;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Evas_Event_Mouse_In
|
||||||
|
{
|
||||||
|
int buttons;
|
||||||
|
struct {
|
||||||
|
int x, y;
|
||||||
|
} output;
|
||||||
|
struct {
|
||||||
|
double x, y;
|
||||||
|
} canvas;
|
||||||
|
void *data;
|
||||||
|
Evas_Modifier *modifiers;
|
||||||
|
Evas_Lock *locks;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Evas_Event_Mouse_Out
|
||||||
|
{
|
||||||
|
int buttons;
|
||||||
|
struct {
|
||||||
|
int x, y;
|
||||||
|
} output;
|
||||||
|
struct {
|
||||||
|
double x, y;
|
||||||
|
} canvas;
|
||||||
|
void *data;
|
||||||
|
Evas_Modifier *modifiers;
|
||||||
|
Evas_Lock *locks;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Evas_Event_Mouse_Move
|
||||||
|
{
|
||||||
|
int buttons;
|
||||||
|
struct {
|
||||||
|
struct {
|
||||||
|
int x, y;
|
||||||
|
} output;
|
||||||
|
struct {
|
||||||
|
double x, y;
|
||||||
|
} canvas;
|
||||||
|
} cur, prev;
|
||||||
|
void *data;
|
||||||
|
Evas_Modifier *modifiers;
|
||||||
|
Evas_Lock *locks;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Evas_Event_Key_Down
|
||||||
|
{
|
||||||
|
Evas_Key *key;
|
||||||
|
void *data;
|
||||||
|
Evas_Modifier *modifiers;
|
||||||
|
Evas_Lock *locks;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Evas_Event_Key_Up
|
||||||
|
{
|
||||||
|
Evas_Key *key;
|
||||||
|
void *data;
|
||||||
|
Evas_Modifier *modifiers;
|
||||||
|
Evas_Lock *locks;
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Evas_List *evas_list_append (Evas_List *list, void *data);
|
||||||
|
Evas_List *evas_list_prepend (Evas_List *list, void *data);
|
||||||
|
Evas_List *evas_list_append_relative (Evas_List *list, void *data, void *relative);
|
||||||
|
Evas_List *evas_list_prepend_relative (Evas_List *list, void *data, void *relative);
|
||||||
|
Evas_List *evas_list_remove (Evas_List *list, void *data);
|
||||||
|
Evas_List *evas_list_remove_list (Evas_List *list, Evas_List *remove_list);
|
||||||
|
void *evas_list_find (Evas_List *list, void *data);
|
||||||
|
Evas_List *evas_list_free (Evas_List *list);
|
||||||
|
Evas_List *evas_list_last (Evas_List *list);
|
||||||
|
Evas_List *evas_list_next (Evas_List *list);
|
||||||
|
Evas_List *evas_list_prev (Evas_List *list);
|
||||||
|
void *evas_list_data (Evas_List *list);
|
||||||
|
int evas_list_count (Evas_List *list);
|
||||||
|
void *evas_list_nth (Evas_List *list, int n);
|
||||||
|
Evas_List *evas_list_reverse (Evas_List *list);
|
||||||
|
|
||||||
|
/* FIXME: add:
|
||||||
|
* api to add find, del members by data, size not just string and also
|
||||||
|
* provide hash generation functions settable by the app
|
||||||
|
*
|
||||||
|
* do we really need this? hmmm - let me think... there may be a better way
|
||||||
|
*/
|
||||||
|
Evas_Hash *evas_hash_add (Evas_Hash *hash, const char *key, void *data);
|
||||||
|
Evas_Hash *evas_hash_del (Evas_Hash *hash, const char *key, void *data);
|
||||||
|
void *evas_hash_find (Evas_Hash *hash, const char *key);
|
||||||
|
int evas_hash_size (Evas_Hash *hash);
|
||||||
|
void evas_hash_free (Evas_Hash *hash);
|
||||||
|
void evas_hash_foreach (Evas_Hash *hash, int (*func) (Evas_Hash *hash, const char *key, void *data, void *fdata), void *fdata);
|
||||||
|
|
||||||
|
Evas *evas_new (void);
|
||||||
|
void evas_free (Evas *e);
|
||||||
|
|
||||||
|
int evas_render_method_lookup (const char *name);
|
||||||
|
Evas_List *evas_render_method_list (void);
|
||||||
|
void evas_render_method_list_free (Evas_List *list);
|
||||||
|
|
||||||
|
void evas_output_method_set (Evas *e, int render_method);
|
||||||
|
int evas_output_method_get (Evas *e);
|
||||||
|
|
||||||
|
Evas_Engine_Info *evas_engine_info_get (Evas *e);
|
||||||
|
void evas_engine_info_set (Evas *e, Evas_Engine_Info *info);
|
||||||
|
|
||||||
|
void evas_output_size_set (Evas *e, int w, int h);
|
||||||
|
void evas_output_size_get (Evas *e, int *w, int *h);
|
||||||
|
void evas_output_viewport_set (Evas *e, double x, double y, double w, double h);
|
||||||
|
void evas_output_viewport_get (Evas *e, double *x, double *y, double *w, double *h);
|
||||||
|
|
||||||
|
double evas_coord_screen_x_to_world (Evas *e, int x);
|
||||||
|
double evas_coord_screen_y_to_world (Evas *e, int y);
|
||||||
|
int evas_coord_world_x_to_screen (Evas *e, double x);
|
||||||
|
int evas_coord_world_y_to_screen (Evas *e, double y);
|
||||||
|
|
||||||
|
void evas_damage_rectangle_add (Evas *e, int x, int y, int w, int h);
|
||||||
|
void evas_obscured_rectangle_add (Evas *e, int x, int y, int w, int h);
|
||||||
|
void evas_obscured_clear (Evas *e);
|
||||||
|
Evas_List *evas_render_updates (Evas *e);
|
||||||
|
void evas_render_updates_free (Evas_List *updates);
|
||||||
|
void evas_render (Evas *e);
|
||||||
|
|
||||||
|
Evas_Object *evas_object_rectangle_add (Evas *e);
|
||||||
|
|
||||||
|
Evas_Object *evas_object_line_add (Evas *e);
|
||||||
|
void evas_object_line_xy_set (Evas_Object *obj, double x1, double y1, double x2, double y2);
|
||||||
|
void evas_object_line_xy_get (Evas_Object *obj, double *x1, double *y1, double *x2, double *y2);
|
||||||
|
|
||||||
|
Evas_Object *evas_object_gradient_add (Evas *e);
|
||||||
|
void evas_object_gradient_color_add (Evas_Object *obj, int r, int g, int b, int a, int distance);
|
||||||
|
void evas_object_gradient_colors_clear (Evas_Object *obj);
|
||||||
|
void evas_object_gradient_angle_set (Evas_Object *obj, double angle);
|
||||||
|
double evas_object_gradient_angle_get (Evas_Object *obj);
|
||||||
|
|
||||||
|
Evas_Object *evas_object_polygon_add (Evas *e);
|
||||||
|
void evas_object_polygon_point_add (Evas_Object *obj, double x, double y);
|
||||||
|
void evas_object_polygon_points_clear (Evas_Object *obj);
|
||||||
|
|
||||||
|
Evas_Object *evas_object_image_add (Evas *e);
|
||||||
|
void evas_object_image_file_set (Evas_Object *obj, char *file, char *key);
|
||||||
|
void evas_object_image_file_get (Evas_Object *obj, char **file, char **key);
|
||||||
|
void evas_object_image_border_set (Evas_Object *obj, int l, int r, int t, int b);
|
||||||
|
void evas_object_image_border_get (Evas_Object *obj, int *l, int *r, int *t, int *b);
|
||||||
|
void evas_object_image_fill_set (Evas_Object *obj, double x, double y, double w, double h);
|
||||||
|
void evas_object_image_fill_get (Evas_Object *obj, double *x, double *y, double *w, double *h);
|
||||||
|
void evas_object_image_size_set (Evas_Object *obj, int w, int h);
|
||||||
|
void evas_object_image_size_get (Evas_Object *obj, int *w, int *h);
|
||||||
|
int evas_object_image_load_error_get (Evas_Object *obj);
|
||||||
|
void evas_object_image_data_set (Evas_Object *obj, int *data);
|
||||||
|
int *evas_object_image_data_get (Evas_Object *obj, int for_writing);
|
||||||
|
void evas_object_image_data_copy_set (Evas_Object *obj, int *data);
|
||||||
|
void evas_object_image_data_update_add (Evas_Object *obj, int x, int y, int w, int h);
|
||||||
|
void evas_object_image_alpha_set (Evas_Object *obj, int has_alpha);
|
||||||
|
int evas_object_image_alpha_get (Evas_Object *obj);
|
||||||
|
void evas_object_image_smooth_scale_set(Evas_Object *obj, int smooth_scale);
|
||||||
|
int evas_object_image_smooth_scale_get(Evas_Object *obj);
|
||||||
|
void evas_object_image_reload (Evas_Object *obj);
|
||||||
|
|
||||||
|
void evas_object_image_cache_flush (Evas *e);
|
||||||
|
void evas_object_image_cache_reload (Evas *e);
|
||||||
|
void evas_object_image_cache_set (Evas *e, int size);
|
||||||
|
int evas_object_image_cache_get (Evas *e);
|
||||||
|
|
||||||
|
/* FIXME: add:
|
||||||
|
* multiple image format handler code (clean internal api)
|
||||||
|
* image loader (provided by app) code (callbacks)
|
||||||
|
* loadable image loader module query etc. code
|
||||||
|
*/
|
||||||
|
|
||||||
|
Evas_Object *evas_object_text_add (Evas *e);
|
||||||
|
void evas_object_text_font_set (Evas_Object *obj, char *font, double size);
|
||||||
|
void evas_object_text_font_get (Evas_Object *obj, char **font, double *size);
|
||||||
|
void evas_object_text_text_set (Evas_Object *obj, char *text);
|
||||||
|
char *evas_object_text_text_get (Evas_Object *obj);
|
||||||
|
double evas_object_text_ascent_get (Evas_Object *obj);
|
||||||
|
double evas_object_text_descent_get (Evas_Object *obj);
|
||||||
|
double evas_object_text_max_ascent_get (Evas_Object *obj);
|
||||||
|
double evas_object_text_max_descent_get (Evas_Object *obj);
|
||||||
|
double evas_object_text_horiz_advance_get(Evas_Object *obj);
|
||||||
|
double evas_object_text_vert_advance_get (Evas_Object *obj);
|
||||||
|
double evas_object_text_inset_get (Evas_Object *obj);
|
||||||
|
double evas_object_text_horiz_advance_get(Evas_Object *obj);
|
||||||
|
double evas_object_text_vert_advance_get (Evas_Object *obj);
|
||||||
|
int evas_object_text_char_pos_get (Evas_Object *obj, int pos, double *cx, double *cy, double *cw, double *ch);
|
||||||
|
int evas_object_text_char_coords_get (Evas_Object *obj, double x, double y, double *cx, double *cy, double *cw, double *ch);
|
||||||
|
|
||||||
|
/* FIXME: add:
|
||||||
|
* text outline & shadowing code
|
||||||
|
*/
|
||||||
|
|
||||||
|
void evas_object_font_path_clear (Evas *e);
|
||||||
|
void evas_object_font_path_append (Evas *e, char *path);
|
||||||
|
void evas_object_font_path_prepend (Evas *e, char *path);
|
||||||
|
Evas_List *evas_object_font_path_list (Evas *e);
|
||||||
|
|
||||||
|
void evas_object_font_cache_flush (Evas *e);
|
||||||
|
void evas_object_font_cache_set (Evas *e, int size);
|
||||||
|
int evas_object_font_cache_get (Evas *e);
|
||||||
|
|
||||||
|
void evas_object_del (Evas_Object *obj);
|
||||||
|
|
||||||
|
const char *evas_object_type_get (Evas_Object *obj);
|
||||||
|
|
||||||
|
void evas_object_layer_set (Evas_Object *obj, int l);
|
||||||
|
int evas_object_layer_get (Evas_Object *obj);
|
||||||
|
|
||||||
|
void evas_object_raise (Evas_Object *obj);
|
||||||
|
void evas_object_lower (Evas_Object *obj);
|
||||||
|
void evas_object_stack_above (Evas_Object *obj, Evas_Object *above);
|
||||||
|
void evas_object_stack_below (Evas_Object *obj, Evas_Object *below);
|
||||||
|
Evas_Object *evas_object_above_get (Evas_Object *obj);
|
||||||
|
Evas_Object *evas_object_below_get (Evas_Object *obj);
|
||||||
|
Evas_Object *evas_object_bottom_get (Evas *e);
|
||||||
|
Evas_Object *evas_object_top_get (Evas *e);
|
||||||
|
|
||||||
|
void evas_object_move (Evas_Object *obj, double x, double y);
|
||||||
|
void evas_object_resize (Evas_Object *obj, double w, double h);
|
||||||
|
void evas_object_geometry_get (Evas_Object *obj, double *x, double *y, double *w, double *h);
|
||||||
|
|
||||||
|
void evas_object_show (Evas_Object *obj);
|
||||||
|
void evas_object_hide (Evas_Object *obj);
|
||||||
|
int evas_object_visible_get (Evas_Object *obj);
|
||||||
|
|
||||||
|
void evas_object_color_set (Evas_Object *obj, int r, int g, int b, int a);
|
||||||
|
void evas_object_color_get (Evas_Object *obj, int *r, int *g, int *b, int *a);
|
||||||
|
|
||||||
|
void evas_object_clip_set (Evas_Object *obj, Evas_Object *clip);
|
||||||
|
Evas_Object *evas_object_clip_get (Evas_Object *obj);
|
||||||
|
void evas_object_clip_unset (Evas_Object *obj);
|
||||||
|
Evas_List *evas_object_clipees_get (Evas_Object *obj);
|
||||||
|
|
||||||
|
void evas_object_data_set (Evas_Object *obj, const char *key, void *data);
|
||||||
|
void *evas_object_data_get (Evas_Object *obj, const char *key);
|
||||||
|
void *evas_object_data_del (Evas_Object *obj, const char *key);
|
||||||
|
|
||||||
|
void evas_object_name_set (Evas_Object *obj, const char *name);
|
||||||
|
char *evas_object_name_get (Evas_Object *obj);
|
||||||
|
Evas_Object *evas_object_name_find (Evas *e, const char *name);
|
||||||
|
|
||||||
|
Evas *evas_object_evas_get (Evas_Object *obj);
|
||||||
|
|
||||||
|
Evas_Object *evas_object_top_at_xy_get (Evas *e, double x, double y, int include_pass_events_objects, int include_hidden_objects);
|
||||||
|
Evas_Object *evas_object_top_at_pointer_get (Evas *e);
|
||||||
|
Evas_Object *evas_object_top_in_rectangle_get (Evas *e, double x, double y, double w, double h, int include_pass_events_objects, int include_hidden_objects);
|
||||||
|
|
||||||
|
Evas_List *evas_objects_at_xy_get (Evas *e, double x, double y, int include_pass_events_objects, int include_hidden_objects);
|
||||||
|
Evas_List *evas_objects_in_rectangle_get (Evas *e, double x, double y, double w, double h, int include_pass_events_objects, int include_hidden_objects);
|
||||||
|
|
||||||
|
Evas_Smart *evas_smart_new (char *name, void (*func_add) (Evas_Object *o), void (*func_del) (Evas_Object *o), void (*func_layer_set) (Evas_Object *o, int l), void (*func_raise) (Evas_Object *o), void (*func_lower) (Evas_Object *o), void (*func_stack_above) (Evas_Object *o, Evas_Object *above), void (*func_stack_below) (Evas_Object *o, Evas_Object *below), void (*func_move) (Evas_Object *o, double x, double y), void (*func_resize) (Evas_Object *o, double w, double h), void (*func_show) (Evas_Object *o), void (*func_hide) (Evas_Object *o), void (*func_color_set) (Evas_Object *o, int r, int g, int b, int a), void (*func_clip_set) (Evas_Object *o, Evas_Object *clip), void (*func_clip_unset) (Evas_Object *o), void *data);
|
||||||
|
void evas_smart_free (Evas_Smart *s);
|
||||||
|
void *evas_smart_data_get (Evas_Smart *s);
|
||||||
|
|
||||||
|
Evas_Object *evas_object_smart_add (Evas *e, Evas_Smart *s);
|
||||||
|
void evas_object_smart_member_add (Evas_Object *obj, Evas_Object *smart_obj);
|
||||||
|
void evas_object_smart_member_del (Evas_Object *obj);
|
||||||
|
Evas_Smart *evas_object_smart_smart_get (Evas_Object *obj);
|
||||||
|
void *evas_object_smart_data_get (Evas_Object *obj);
|
||||||
|
void evas_object_smart_data_set (Evas_Object *obj, void *data);
|
||||||
|
void evas_object_smart_callback_add (Evas_Object *obj, char *event, void (*func) (void *data, Evas_Object *obj, void *event_info), void *data);
|
||||||
|
void *evas_object_smart_callback_del (Evas_Object *obj, char *event, void (*func) (void *data, Evas_Object *obj, void *event_info));
|
||||||
|
void evas_object_smart_callback_call (Evas_Object *obj, char *event, void *event_info);
|
||||||
|
|
||||||
|
void evas_pointer_output_xy_get (Evas *e, int *x, int *y);
|
||||||
|
void evas_pointer_canvas_xy_get (Evas *e, double *x, double *y);
|
||||||
|
int evas_pointer_button_down_mask_get (Evas *e);
|
||||||
|
int evas_pointer_inside_get (Evas *e);
|
||||||
|
|
||||||
|
void evas_event_freeze (Evas *e);
|
||||||
|
void evas_event_thaw (Evas *e);
|
||||||
|
int evas_event_freeze_get (Evas *e);
|
||||||
|
void evas_event_feed_mouse_down_data (Evas *e, int b, void *data);
|
||||||
|
void evas_event_feed_mouse_up_data (Evas *e, int b, void *data);
|
||||||
|
void evas_event_feed_mouse_move_data (Evas *e, int x, int y, void *data);
|
||||||
|
void evas_event_feed_mouse_in_data (Evas *e, void *data);
|
||||||
|
void evas_event_feed_mouse_out_data (Evas *e, void *data);
|
||||||
|
/* FIXME: implement...
|
||||||
|
void evas_event_feed_key_down_data (Evas *e, char *keyname, void *data);
|
||||||
|
void evas_event_feed_key_up_data (Evas *e, char *keyname, void *data);
|
||||||
|
...end implement */
|
||||||
|
void evas_event_feed_mouse_down (Evas *e, int b);
|
||||||
|
void evas_event_feed_mouse_up (Evas *e, int b);
|
||||||
|
void evas_event_feed_mouse_move (Evas *e, int x, int y);
|
||||||
|
void evas_event_feed_mouse_in (Evas *e);
|
||||||
|
void evas_event_feed_mouse_out (Evas *e);
|
||||||
|
/* FIXME: implement...
|
||||||
|
void evas_event_feed_key_down (Evas *e, char *keyname);
|
||||||
|
void evas_event_feed_key_up (Evas *e, char *keyname);
|
||||||
|
|
||||||
|
void evas_object_focus (Evas_Object *o);
|
||||||
|
|
||||||
|
char *evas_key_name_get (Evas_Key *k);
|
||||||
|
|
||||||
|
int evas_key_modifier_is_set_get (Evas_Modifier *m, char *keyname);
|
||||||
|
|
||||||
|
int evas_key_lock_is_set_get (Evas_Lock *l, char *keyname);
|
||||||
|
|
||||||
|
void evas_key_modifier_add (Evas *e, char *keyname);
|
||||||
|
void evas_key_modifier_del (Evas *e, char *keyname);
|
||||||
|
void evas_key_lock_add (Evas *e, char *keyname);
|
||||||
|
void evas_key_lock_del (Evas *e, char *keyname);
|
||||||
|
|
||||||
|
void evas_key_modifier_on (Evas *e, char *keyname);
|
||||||
|
void evas_key_modifier_off (Evas *e, char *keyname);
|
||||||
|
void evas_key_lock_on (Evas *e, char *keyname);
|
||||||
|
void evas_key_lock_off (Evas *e, char *keyname);
|
||||||
|
...end implement */
|
||||||
|
|
||||||
|
void evas_object_pass_events_set (Evas_Object *obj, int pass);
|
||||||
|
int evas_object_pass_events_get (Evas_Object *obj);
|
||||||
|
void evas_object_repeat_events_set (Evas_Object *obj, int repeat);
|
||||||
|
int evas_object_repeat_events_get (Evas_Object *obj);
|
||||||
|
|
||||||
|
void evas_object_event_callback_add (Evas_Object *obj, Evas_Callback_Type type, void (*func) (void *data, Evas *e, Evas_Object *obj, void *event_info), void *data);
|
||||||
|
void *evas_object_event_callback_del (Evas_Object *obj, Evas_Callback_Type type, void (*func) (void *data, Evas *e, Evas_Object *obj, void *event_info));
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
#ifndef _EVAS_ENGINE_DIRECTFB_H
|
||||||
|
#define _EVAS_ENGINE_DIRECTFB_H
|
||||||
|
#include <Evas.h>
|
||||||
|
|
||||||
|
#include <directfb.h>
|
||||||
|
|
||||||
|
typedef struct _Evas_Engine_Info_DirectFB Evas_Engine_Info_DirectFB;
|
||||||
|
|
||||||
|
struct _Evas_Engine_Info_DirectFB
|
||||||
|
{
|
||||||
|
/* PRIVATE - don't mess with this baby or evas will poke its tongue out */
|
||||||
|
/* at you and make nasty noises */
|
||||||
|
Evas_Engine_Info magic;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
IDirectFB *dfb;
|
||||||
|
IDirectFBSurface *surface;
|
||||||
|
DFBSurfaceDrawingFlags flags;
|
||||||
|
} info;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
#ifndef _EVAS_ENGINE_FB_H
|
||||||
|
#define _EVAS_ENGINE_FB_H
|
||||||
|
|
||||||
|
typedef struct _Evas_Engine_Info_FB Evas_Engine_Info_FB;
|
||||||
|
|
||||||
|
struct _Evas_Engine_Info_FB
|
||||||
|
{
|
||||||
|
/* PRIVATE - don't mess with this baby or evas will poke its tongue out */
|
||||||
|
/* at you and make nasty noises */
|
||||||
|
Evas_Engine_Info magic;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
|
||||||
|
int virtual_terminal;
|
||||||
|
int device_number;
|
||||||
|
int refresh;
|
||||||
|
int rotation;
|
||||||
|
} info;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
#ifndef _EVAS_ENGINE_GL_X11_H
|
||||||
|
#define _EVAS_ENGINE_GL_X11_H
|
||||||
|
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
#include <GL/gl.h>
|
||||||
|
#include <GL/glu.h>
|
||||||
|
#include <GL/glx.h>
|
||||||
|
|
||||||
|
typedef struct _Evas_Engine_Info_GL_X11 Evas_Engine_Info_GL_X11;
|
||||||
|
|
||||||
|
struct _Evas_Engine_Info_GL_X11
|
||||||
|
{
|
||||||
|
/* PRIVATE - don't mess with this baby or evas will poke its tongue out */
|
||||||
|
/* at you and make nasty noises */
|
||||||
|
Evas_Engine_Info magic;
|
||||||
|
|
||||||
|
/* engine specific data & parameters it needs to set up */
|
||||||
|
struct {
|
||||||
|
Display *display;
|
||||||
|
Drawable drawable;
|
||||||
|
Visual *visual;
|
||||||
|
Colormap colormap;
|
||||||
|
int depth;
|
||||||
|
} info;
|
||||||
|
/* engine specific function calls to query stuff about the destination */
|
||||||
|
/* engine (what visual & colormap & depth to use, performance info etc. */
|
||||||
|
struct {
|
||||||
|
Visual * (*best_visual_get) (Display *disp, int screen);
|
||||||
|
Colormap (*best_colormap_get) (Display *disp, int screen);
|
||||||
|
int (*best_depth_get) (Display *disp, int screen);
|
||||||
|
} func;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
#ifndef _EVAS_ENGINE_SOFTWARE_QTOPIA_H
|
||||||
|
#define _EVAS_ENGINE_SOFTWARE_QTOPIA_H
|
||||||
|
|
||||||
|
#ifdef EVAS_COMMON_H
|
||||||
|
#ifdef EVAS_PRIVATE_H
|
||||||
|
typedef void QWidget;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef EVAS_COMMON_H
|
||||||
|
#ifndef EVAS_PRIVATE_H
|
||||||
|
#include <qwidget.h>
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct _Evas_Engine_Info_Software_Qtopia Evas_Engine_Info_Software_Qtopia;
|
||||||
|
|
||||||
|
struct _Evas_Engine_Info_Software_Qtopia
|
||||||
|
{
|
||||||
|
/* PRIVATE - don't mess with this baby or evas will poke its tongue out */
|
||||||
|
/* at you and make nasty noises */
|
||||||
|
Evas_Engine_Info magic;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
QWidget *target;
|
||||||
|
int rotation;
|
||||||
|
} info;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
#ifndef _EVAS_ENGINE_SOFTWARE_WIN32_GDI_H
|
||||||
|
#define _EVAS_ENGINE_SOFTWARE_WIN32_GDI_H
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct _Evas_Engine_Info_Software_Win32_GDI Evas_Engine_Info_Software_Win32_GDI;
|
||||||
|
|
||||||
|
struct _Evas_Engine_Info_Software_Win32_GDI
|
||||||
|
{
|
||||||
|
/* PRIVATE - don't mess with this baby or evas will poke its tongue out */
|
||||||
|
/* at you and make nasty noises */
|
||||||
|
Evas_Engine_Info magic;
|
||||||
|
|
||||||
|
/* engine specific data & parameters it needs to set up */
|
||||||
|
struct {
|
||||||
|
HWND hwnd;
|
||||||
|
/*
|
||||||
|
Colormap colormap;
|
||||||
|
*/
|
||||||
|
|
||||||
|
int depth;
|
||||||
|
int rotation;
|
||||||
|
|
||||||
|
} info;
|
||||||
|
/* engine specific function calls to query stuff about the destination */
|
||||||
|
/* engine (what visual & colormap & depth to use, performance info etc. */
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
#ifndef _EVAS_ENGINE_SOFTWARE_X11_H
|
||||||
|
#define _EVAS_ENGINE_SOFTWARE_X11_H
|
||||||
|
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
|
||||||
|
typedef struct _Evas_Engine_Info_Software_X11 Evas_Engine_Info_Software_X11;
|
||||||
|
|
||||||
|
struct _Evas_Engine_Info_Software_X11
|
||||||
|
{
|
||||||
|
/* PRIVATE - don't mess with this baby or evas will poke its tongue out */
|
||||||
|
/* at you and make nasty noises */
|
||||||
|
Evas_Engine_Info magic;
|
||||||
|
|
||||||
|
/* engine specific data & parameters it needs to set up */
|
||||||
|
struct {
|
||||||
|
Display *display;
|
||||||
|
Drawable drawable;
|
||||||
|
Pixmap mask;
|
||||||
|
Visual *visual;
|
||||||
|
Colormap colormap;
|
||||||
|
int depth;
|
||||||
|
int rotation;
|
||||||
|
|
||||||
|
int alloc_grayscale : 1;
|
||||||
|
int debug : 1;
|
||||||
|
int shape_dither : 1;
|
||||||
|
|
||||||
|
int alloc_colors_max;
|
||||||
|
} info;
|
||||||
|
/* engine specific function calls to query stuff about the destination */
|
||||||
|
/* engine (what visual & colormap & depth to use, performance info etc. */
|
||||||
|
struct {
|
||||||
|
Visual * (*best_visual_get) (Display *disp, int screen);
|
||||||
|
Colormap (*best_colormap_get) (Display *disp, int screen);
|
||||||
|
int (*best_depth_get) (Display *disp, int screen);
|
||||||
|
|
||||||
|
Evas_Performance *(*performance_test) (Evas *e, Display *disp, Visual *vis, Colormap cmap, Drawable draw, int depth);
|
||||||
|
void (*performance_free) (Evas_Performance *perf);
|
||||||
|
char * (*performance_data_get) (Evas_Performance *perf);
|
||||||
|
char * (*performance_key_get) (Evas_Performance *perf);
|
||||||
|
Evas_Performance *(*performance_new) (Evas *e, Display *disp, Visual *vis, Colormap cmap, Drawable draw, int depth);
|
||||||
|
void (*performance_build) (Evas_Performance *perf, const char *data);
|
||||||
|
void (*performance_device_store) (Evas_Performance *perf);
|
||||||
|
} func;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,104 @@
|
||||||
|
## Process this file with automake to produce Makefile.in
|
||||||
|
|
||||||
|
SUBDIRS = canvas data file engines include
|
||||||
|
|
||||||
|
AUTOMAKE_OPTIONS = 1.4 foreign
|
||||||
|
|
||||||
|
# A list of all the files in the current directory which can be regenerated
|
||||||
|
MAINTAINERCLEANFILES = Makefile.in
|
||||||
|
|
||||||
|
LDFLAGS = -L/usr/local/lib
|
||||||
|
INCLUDES = -I/usr/local/include \
|
||||||
|
-I$(top_srcdir)/src/lib/include \
|
||||||
|
-I$(includedir) \
|
||||||
|
-I/usr/local/include \
|
||||||
|
@freetype_cflags@ @x_cflags@ @qt_cflags@ @DIRECTFB_CFLAGS@ @gl_cflags@
|
||||||
|
|
||||||
|
lib_LTLIBRARIES = libevas.la
|
||||||
|
|
||||||
|
EXTRA_DIST = \
|
||||||
|
Evas_Engine_Software_X11.h \
|
||||||
|
Evas_Engine_DirectFB.h \
|
||||||
|
Evas_Engine_FB.h \
|
||||||
|
Evas_Engine_Software_Win32_GDI.h \
|
||||||
|
Evas_Engine_Software_Qtopia.h \
|
||||||
|
Evas_Engine_GL_X11.h
|
||||||
|
|
||||||
|
if BUILD_ENGINE_SOFTWARE_X11
|
||||||
|
ENGINE_SOFTWARE_X11 = engines/software_x11/libevas_engine_software_x11.la
|
||||||
|
ENGINE_SOFTWARE_X11_INC = Evas_Engine_Software_X11.h
|
||||||
|
else
|
||||||
|
ENGINE_SOFTWARE_X11 =
|
||||||
|
ENGINE_SOFTWARE_X11_INC =
|
||||||
|
endif
|
||||||
|
|
||||||
|
if BUILD_ENGINE_DIRECTFB
|
||||||
|
ENGINE_DIRECTFB = engines/directfb/libevas_engine_directfb.la
|
||||||
|
ENGINE_DIRECTFB_INC = Evas_Engine_DirectFB.h
|
||||||
|
else
|
||||||
|
ENGINE_DIRECTFB =
|
||||||
|
ENGINE_DIRECTFB_INC =
|
||||||
|
endif
|
||||||
|
|
||||||
|
if BUILD_ENGINE_FB
|
||||||
|
ENGINE_FB = engines/fb/libevas_engine_fb.la
|
||||||
|
ENGINE_FB_INC = Evas_Engine_FB.h
|
||||||
|
else
|
||||||
|
ENGINE_FB =
|
||||||
|
ENGINE_FB_INC =
|
||||||
|
endif
|
||||||
|
|
||||||
|
if BUILD_ENGINE_SOFTWARE_QTOPIA
|
||||||
|
ENGINE_SOFTWARE_QTOPIA = engines/software_qtopia/libevas_engine_software_qtopia.la
|
||||||
|
ENGINE_SOFTWARE_QTOPIA_INC = Evas_Engine_Software_Qtopia.h
|
||||||
|
else
|
||||||
|
ENGINE_SOFTWARE_QTOPIA =
|
||||||
|
ENGINE_SOFTWARE_QTOPIA_INC =
|
||||||
|
endif
|
||||||
|
|
||||||
|
if BUILD_ENGINE_GL_X11
|
||||||
|
ENGINE_GL_X11 = engines/gl_x11/libevas_engine_gl_x11.la
|
||||||
|
ENGINE_GL_X11_INC = Evas_Engine_GL_X11.h
|
||||||
|
else
|
||||||
|
ENGINE_GL_X11 =
|
||||||
|
ENGINE_GL_X11_INC =
|
||||||
|
endif
|
||||||
|
|
||||||
|
include_HEADERS = \
|
||||||
|
Evas.h \
|
||||||
|
$(ENGINE_SOFTWARE_X11_INC) \
|
||||||
|
$(ENGINE_DIRECTFB_INC) \
|
||||||
|
$(ENGINE_FB_INC) \
|
||||||
|
$(ENGINE_SOFTWARE_QTOPIA_INC) \
|
||||||
|
$(ENGINE_GL_X11_INC)
|
||||||
|
|
||||||
|
libevas_la_SOURCES = \
|
||||||
|
main.c
|
||||||
|
|
||||||
|
libevas_la_LIBADD = $(LDFLAGS) \
|
||||||
|
canvas/libevas_canvas.la \
|
||||||
|
data/libevas_data.la \
|
||||||
|
file/libevas_file.la \
|
||||||
|
engines/common/libevas_engine_common.la \
|
||||||
|
@freetype_libs@ \
|
||||||
|
@png_libs@ @jpeg_libs@ @eet_libs@ @edb_libs@ \
|
||||||
|
$(ENGINE_SOFTWARE_X11) \
|
||||||
|
$(ENGINE_DIRECTFB) \
|
||||||
|
$(ENGINE_FB) \
|
||||||
|
$(ENGINE_SOFTWARE_QTOPIA) \
|
||||||
|
$(ENGINE_GL_X11)
|
||||||
|
|
||||||
|
|
||||||
|
libevas_la_DEPENDENCIES = \
|
||||||
|
$(top_builddir)/config.h \
|
||||||
|
canvas/libevas_canvas.la \
|
||||||
|
data/libevas_data.la \
|
||||||
|
file/libevas_file.la \
|
||||||
|
engines/common/libevas_engine_common.la \
|
||||||
|
$(ENGINE_SOFTWARE_X11) \
|
||||||
|
$(ENGINE_DIRECTFB) \
|
||||||
|
$(ENGINE_FB) \
|
||||||
|
$(ENGINE_SOFTWARE_QTOPIA) \
|
||||||
|
$(ENGINE_GL_X11)
|
||||||
|
|
||||||
|
libevas_la_LDFLAGS = -version-info 1:0:0
|
|
@ -0,0 +1,40 @@
|
||||||
|
## Process this file with automake to produce Makefile.in
|
||||||
|
|
||||||
|
AUTOMAKE_OPTIONS = 1.4 foreign
|
||||||
|
|
||||||
|
# A list of all the files in the current directory which can be regenerated
|
||||||
|
MAINTAINERCLEANFILES = Makefile.in
|
||||||
|
|
||||||
|
LDFLAGS = -L/usr/local/lib
|
||||||
|
INCLUDES = \
|
||||||
|
-I. \
|
||||||
|
-I$(top_srcdir)/src/lib \
|
||||||
|
-I$(top_srcdir)/src/lib/include \
|
||||||
|
-I$(includedir) \
|
||||||
|
-I/usr/local/include \
|
||||||
|
@freetype_cflags@ @x_cflags@ @DIRECTFB_CFLAGS@
|
||||||
|
|
||||||
|
noinst_LTLIBRARIES = libevas_canvas.la
|
||||||
|
libevas_canvas_la_SOURCES = \
|
||||||
|
evas_callbacks.c \
|
||||||
|
evas_clip.c \
|
||||||
|
evas_data.c \
|
||||||
|
evas_events.c \
|
||||||
|
evas_layer.c \
|
||||||
|
evas_main.c \
|
||||||
|
evas_name.c \
|
||||||
|
evas_object_gradient.c \
|
||||||
|
evas_object_image.c \
|
||||||
|
evas_object_main.c \
|
||||||
|
evas_object_line.c \
|
||||||
|
evas_object_polygon.c \
|
||||||
|
evas_object_rectangle.c \
|
||||||
|
evas_object_smart.c \
|
||||||
|
evas_object_text.c \
|
||||||
|
evas_rectangle.c \
|
||||||
|
evas_render.c \
|
||||||
|
evas_smart.c \
|
||||||
|
evas_stack.c
|
||||||
|
|
||||||
|
libevas_canvas_la_LIBADD = $(LDFLAGS)
|
||||||
|
libevas_canvas_la_DEPENDENCIES = $(top_builddir)/config.h
|
|
@ -0,0 +1,139 @@
|
||||||
|
#include "evas_common.h"
|
||||||
|
#include "evas_private.h"
|
||||||
|
#include "Evas.h"
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_event_callback_call(Evas_Object *obj, Evas_Callback_Type type, void *event_info)
|
||||||
|
{
|
||||||
|
Evas_Object_List **l_mod, *l;
|
||||||
|
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case EVAS_CALLBACK_MOUSE_IN:
|
||||||
|
l_mod = &(obj->callbacks.in);
|
||||||
|
break;
|
||||||
|
case EVAS_CALLBACK_MOUSE_OUT:
|
||||||
|
l_mod = &(obj->callbacks.out);
|
||||||
|
break;
|
||||||
|
case EVAS_CALLBACK_MOUSE_DOWN:
|
||||||
|
l_mod = &(obj->callbacks.down);
|
||||||
|
break;
|
||||||
|
case EVAS_CALLBACK_MOUSE_UP:
|
||||||
|
l_mod = &(obj->callbacks.up);
|
||||||
|
break;
|
||||||
|
case EVAS_CALLBACK_MOUSE_MOVE:
|
||||||
|
l_mod = &(obj->callbacks.move);
|
||||||
|
break;
|
||||||
|
case EVAS_CALLBACK_FREE:
|
||||||
|
l_mod = &(obj->callbacks.free);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
for (l = *l_mod; l; l = l->next)
|
||||||
|
{
|
||||||
|
Evas_Func_Node *fn;
|
||||||
|
|
||||||
|
fn = (Evas_Func_Node *)l;
|
||||||
|
fn->func(fn->data, obj->layer->evas, obj, event_info);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* public functions */
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_event_callback_add(Evas_Object *obj, Evas_Callback_Type type, void (*func) (void *data, Evas *e, Evas_Object *obj, void *event_info), void *data)
|
||||||
|
{
|
||||||
|
Evas_Func_Node *fn;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
|
if (!func) return;
|
||||||
|
if (obj->smart.smart) return;
|
||||||
|
|
||||||
|
fn = calloc(1, sizeof(Evas_Func_Node));
|
||||||
|
if (!fn) return;
|
||||||
|
fn->func = func;
|
||||||
|
fn->data = data;
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case EVAS_CALLBACK_MOUSE_IN:
|
||||||
|
obj->callbacks.in = evas_object_list_prepend(obj->callbacks.in, fn);
|
||||||
|
break;
|
||||||
|
case EVAS_CALLBACK_MOUSE_OUT:
|
||||||
|
obj->callbacks.out = evas_object_list_prepend(obj->callbacks.out, fn);
|
||||||
|
break;
|
||||||
|
case EVAS_CALLBACK_MOUSE_DOWN:
|
||||||
|
obj->callbacks.down = evas_object_list_prepend(obj->callbacks.down, fn);
|
||||||
|
break;
|
||||||
|
case EVAS_CALLBACK_MOUSE_UP:
|
||||||
|
obj->callbacks.up = evas_object_list_prepend(obj->callbacks.up, fn);
|
||||||
|
break;
|
||||||
|
case EVAS_CALLBACK_MOUSE_MOVE:
|
||||||
|
obj->callbacks.move = evas_object_list_prepend(obj->callbacks.move, fn);
|
||||||
|
break;
|
||||||
|
case EVAS_CALLBACK_FREE:
|
||||||
|
obj->callbacks.free = evas_object_list_prepend(obj->callbacks.free, fn);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
evas_object_event_callback_del(Evas_Object *obj, Evas_Callback_Type type, void (*func) (void *data, Evas *e, Evas_Object *obj, void *event_info))
|
||||||
|
{
|
||||||
|
Evas_Object_List **l_mod, *l;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
|
if (!func) return NULL;
|
||||||
|
if (obj->smart.smart) return NULL;
|
||||||
|
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case EVAS_CALLBACK_MOUSE_IN:
|
||||||
|
l_mod = &(obj->callbacks.in);
|
||||||
|
break;
|
||||||
|
case EVAS_CALLBACK_MOUSE_OUT:
|
||||||
|
l_mod = &(obj->callbacks.out);
|
||||||
|
break;
|
||||||
|
case EVAS_CALLBACK_MOUSE_DOWN:
|
||||||
|
l_mod = &(obj->callbacks.down);
|
||||||
|
break;
|
||||||
|
case EVAS_CALLBACK_MOUSE_UP:
|
||||||
|
l_mod = &(obj->callbacks.up);
|
||||||
|
break;
|
||||||
|
case EVAS_CALLBACK_MOUSE_MOVE:
|
||||||
|
l_mod = &(obj->callbacks.move);
|
||||||
|
break;
|
||||||
|
case EVAS_CALLBACK_FREE:
|
||||||
|
l_mod = &(obj->callbacks.free);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return NULL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
for (l = *l_mod; l; l = l->next)
|
||||||
|
{
|
||||||
|
Evas_Func_Node *fn;
|
||||||
|
|
||||||
|
fn = (Evas_Func_Node *)l;
|
||||||
|
if (fn->func == func)
|
||||||
|
{
|
||||||
|
void *data;
|
||||||
|
|
||||||
|
data = fn->data;
|
||||||
|
*l_mod = evas_object_list_remove(*l_mod, fn);
|
||||||
|
free(fn);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
|
@ -0,0 +1,174 @@
|
||||||
|
#include "evas_common.h"
|
||||||
|
#include "evas_private.h"
|
||||||
|
#include "Evas.h"
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_clip_recalc(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
int cx, cy, cw, ch, cvis, cr, cg, cb, ca;
|
||||||
|
int nx, ny, nw, nh, nvis, nr, ng, nb, na;
|
||||||
|
|
||||||
|
evas_object_coords_recalc(obj);
|
||||||
|
cx = obj->cur.cache.geometry.x; cy = obj->cur.cache.geometry.y;
|
||||||
|
cw = obj->cur.cache.geometry.w; ch = obj->cur.cache.geometry.h;
|
||||||
|
if (obj->cur.color.a == 0) cvis = 0;
|
||||||
|
else cvis = obj->cur.visible;
|
||||||
|
cr = obj->cur.color.r; cg = obj->cur.color.g;
|
||||||
|
cb = obj->cur.color.b; ca = obj->cur.color.a;
|
||||||
|
if (obj->cur.clipper)
|
||||||
|
{
|
||||||
|
evas_object_clip_recalc(obj->cur.clipper);
|
||||||
|
nx = obj->cur.clipper->cur.cache.clip.x;
|
||||||
|
ny = obj->cur.clipper->cur.cache.clip.y;
|
||||||
|
nw = obj->cur.clipper->cur.cache.clip.w;
|
||||||
|
nh = obj->cur.clipper->cur.cache.clip.h;
|
||||||
|
nvis = obj->cur.clipper->cur.cache.clip.visible;
|
||||||
|
nr = obj->cur.clipper->cur.cache.clip.r;
|
||||||
|
ng = obj->cur.clipper->cur.cache.clip.g;
|
||||||
|
nb = obj->cur.clipper->cur.cache.clip.b;
|
||||||
|
na = obj->cur.clipper->cur.cache.clip.a;
|
||||||
|
RECTS_CLIP_TO_RECT(cx, cy, cw, ch, nx, ny, nw, nh);
|
||||||
|
cvis = cvis * nvis;
|
||||||
|
cr = (cr * (nr + 1)) >> 8;
|
||||||
|
cg = (cg * (ng + 1)) >> 8;
|
||||||
|
cb = (cb * (nb + 1)) >> 8;
|
||||||
|
ca = (ca * (na + 1)) >> 8;
|
||||||
|
}
|
||||||
|
if ((ca == 0) || (cw <= 0) || (ch <= 0)) cvis = 0;
|
||||||
|
obj->cur.cache.clip.x = cx;
|
||||||
|
obj->cur.cache.clip.y = cy;
|
||||||
|
obj->cur.cache.clip.w = cw;
|
||||||
|
obj->cur.cache.clip.h = ch;
|
||||||
|
obj->cur.cache.clip.visible = cvis;
|
||||||
|
obj->cur.cache.clip.r = cr;
|
||||||
|
obj->cur.cache.clip.g = cg;
|
||||||
|
obj->cur.cache.clip.b = cb;
|
||||||
|
obj->cur.cache.clip.a = ca;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_recalc_clippees(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_List *l;
|
||||||
|
|
||||||
|
evas_object_clip_recalc(obj);
|
||||||
|
for (l = obj->clip.clipees; l; l = l->next)
|
||||||
|
{
|
||||||
|
evas_object_recalc_clippees(l->data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
evas_object_clippers_is_visible(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
if (obj->cur.visible)
|
||||||
|
{
|
||||||
|
if (obj->cur.clipper)
|
||||||
|
return evas_object_clippers_is_visible(obj->cur.clipper);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
evas_object_clippers_was_visible(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
if (obj->prev.visible)
|
||||||
|
{
|
||||||
|
if (obj->prev.clipper)
|
||||||
|
return evas_object_clippers_is_visible(obj->prev.clipper);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* public functions */
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_clip_set(Evas_Object *obj, Evas_Object *clip)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (!clip)
|
||||||
|
{
|
||||||
|
evas_object_clip_unset(obj);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MAGIC_CHECK(clip, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (obj->cur.clipper == clip) return;
|
||||||
|
if (obj->smart.smart)
|
||||||
|
{
|
||||||
|
if (obj->smart.smart->func_clip_set)
|
||||||
|
obj->smart.smart->func_clip_set(obj, clip);
|
||||||
|
}
|
||||||
|
if (obj->cur.clipper)
|
||||||
|
{
|
||||||
|
/* unclip */
|
||||||
|
obj->cur.clipper->clip.clipees = evas_list_remove(obj->cur.clipper->clip.clipees, obj);
|
||||||
|
evas_object_change(obj);
|
||||||
|
obj->cur.clipper = NULL;
|
||||||
|
}
|
||||||
|
/* clip me */
|
||||||
|
obj->cur.clipper = clip;
|
||||||
|
clip->clip.clipees = evas_list_append(clip->clip.clipees, obj);
|
||||||
|
evas_object_change(obj);
|
||||||
|
evas_object_recalc_clippees(obj);
|
||||||
|
if (!obj->smart.smart)
|
||||||
|
{
|
||||||
|
if (evas_object_is_in_output_rect(obj,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y, 1, 1))
|
||||||
|
evas_event_feed_mouse_move(obj->layer->evas,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_Object *
|
||||||
|
evas_object_clip_get(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return obj->cur.clipper;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_clip_unset(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (!obj->cur.clipper) return;
|
||||||
|
/* unclip */
|
||||||
|
if (obj->smart.smart)
|
||||||
|
{
|
||||||
|
if (obj->smart.smart->func_clip_unset)
|
||||||
|
obj->smart.smart->func_clip_unset(obj);
|
||||||
|
}
|
||||||
|
obj->cur.clipper->clip.clipees = evas_list_remove(obj->cur.clipper->clip.clipees, obj);
|
||||||
|
obj->cur.clipper = NULL;
|
||||||
|
evas_object_change(obj);
|
||||||
|
evas_object_recalc_clippees(obj);
|
||||||
|
if (!obj->smart.smart)
|
||||||
|
{
|
||||||
|
if (evas_object_is_in_output_rect(obj,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y, 1, 1))
|
||||||
|
evas_event_feed_mouse_move(obj->layer->evas,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_List *
|
||||||
|
evas_object_clipees_get(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return obj->clip.clipees;
|
||||||
|
}
|
|
@ -0,0 +1,74 @@
|
||||||
|
#include "evas_common.h"
|
||||||
|
#include "evas_private.h"
|
||||||
|
#include "Evas.h"
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_data_set(Evas_Object *obj, const char *key, void *data)
|
||||||
|
{
|
||||||
|
Evas_Data_Node *node;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (!key) return;
|
||||||
|
|
||||||
|
evas_object_data_del(obj, key);
|
||||||
|
|
||||||
|
node = malloc(sizeof(Evas_Data_Node));
|
||||||
|
node->key = strdup(key);
|
||||||
|
node->data = data;
|
||||||
|
obj->data.elements = evas_list_prepend(obj->data.elements, node);
|
||||||
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
evas_object_data_get(Evas_Object *obj, const char *key)
|
||||||
|
{
|
||||||
|
Evas_List *l;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (!key) return NULL;
|
||||||
|
|
||||||
|
for (l = obj->data.elements; l; l = l->next)
|
||||||
|
{
|
||||||
|
Evas_Data_Node *node;
|
||||||
|
|
||||||
|
node = l->data;
|
||||||
|
if (!strcmp(node->key, key))
|
||||||
|
{
|
||||||
|
obj->data.elements = evas_list_remove(obj->data.elements, node);
|
||||||
|
obj->data.elements = evas_list_prepend(obj->data.elements, node);
|
||||||
|
return node->data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
evas_object_data_del(Evas_Object *obj, const char *key)
|
||||||
|
{
|
||||||
|
Evas_List *l;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (!key) return NULL;
|
||||||
|
for (l = obj->data.elements; l; l = l->next)
|
||||||
|
{
|
||||||
|
Evas_Data_Node *node;
|
||||||
|
|
||||||
|
node = l->data;
|
||||||
|
if (!strcmp(node->key, key))
|
||||||
|
{
|
||||||
|
void *data;
|
||||||
|
|
||||||
|
data = node->data;
|
||||||
|
obj->data.elements = evas_list_remove(obj->data.elements, node);
|
||||||
|
free(node->key);
|
||||||
|
free(node);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
|
@ -0,0 +1,470 @@
|
||||||
|
#include "evas_common.h"
|
||||||
|
#include "evas_private.h"
|
||||||
|
#include "Evas.h"
|
||||||
|
|
||||||
|
Evas_List *
|
||||||
|
evas_event_objects_event_list(Evas *e, Evas_Object *stop, int x, int y)
|
||||||
|
{
|
||||||
|
Evas_Object_List *l;
|
||||||
|
Evas_List *in = NULL;
|
||||||
|
|
||||||
|
if (!e->layers) return NULL;
|
||||||
|
for (l = ((Evas_Object_List *)(e->layers))->last; l; l = l->prev)
|
||||||
|
{
|
||||||
|
Evas_Object_List *l2;
|
||||||
|
Evas_Layer *lay;
|
||||||
|
|
||||||
|
lay = (Evas_Layer *)l;
|
||||||
|
for (l2 = ((Evas_Object_List *)(lay->objects))->last; l2; l2 = l2->prev)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
|
||||||
|
obj = (Evas_Object *)l2;
|
||||||
|
if (obj == stop) goto done;
|
||||||
|
if ((!obj->pass_events) && (!obj->smart.smart))
|
||||||
|
{
|
||||||
|
evas_object_clip_recalc(obj);
|
||||||
|
if ((evas_object_is_in_output_rect(obj, x, y, 1, 1)) &&
|
||||||
|
(obj->cur.visible) &&
|
||||||
|
(obj->delete_me == 0) &&
|
||||||
|
(evas_object_clippers_is_visible(obj)) &&
|
||||||
|
(!obj->clip.clipees))
|
||||||
|
{
|
||||||
|
in = evas_list_append(in, obj);
|
||||||
|
if (!obj->repeat_events) goto done;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
done:
|
||||||
|
return in;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Evas_List *evas_event_list_copy(Evas_List *list);
|
||||||
|
static Evas_List *
|
||||||
|
evas_event_list_copy(Evas_List *list)
|
||||||
|
{
|
||||||
|
Evas_List *l, *new_l = NULL;
|
||||||
|
|
||||||
|
for (l = list; l; l = l->next)
|
||||||
|
new_l = evas_list_append(new_l, l->data);
|
||||||
|
return new_l;
|
||||||
|
}
|
||||||
|
/* public functions */
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_event_freeze(Evas *e)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
e->events_frozen++;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_event_thaw(Evas *e)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
e->events_frozen--;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
evas_event_freeze_get(Evas *e)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return e->events_frozen;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_event_feed_mouse_down_data(Evas *e, int b, void *data)
|
||||||
|
{
|
||||||
|
Evas_List *l, *copy;
|
||||||
|
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
|
if ((b < 1) || (b > 32)) return;
|
||||||
|
|
||||||
|
e->pointer.button |= (1 << (b - 1));
|
||||||
|
|
||||||
|
if (e->events_frozen > 0) return;
|
||||||
|
|
||||||
|
copy = evas_event_list_copy(e->pointer.object.in);
|
||||||
|
for (l = copy; l; l = l->next)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
Evas_Event_Mouse_Down ev;
|
||||||
|
|
||||||
|
obj = l->data;
|
||||||
|
obj->mouse_grabbed = 1;
|
||||||
|
e->pointer.mouse_grabbed = 1;
|
||||||
|
|
||||||
|
ev.button = b;
|
||||||
|
ev.output.x = e->pointer.x;
|
||||||
|
ev.output.y = e->pointer.y;
|
||||||
|
ev.canvas.x = e->pointer.canvas_x;
|
||||||
|
ev.canvas.y = e->pointer.canvas_y;
|
||||||
|
ev.data = data;
|
||||||
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_DOWN, &ev);
|
||||||
|
}
|
||||||
|
if (copy) copy = evas_list_free(copy);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_event_feed_mouse_up_data(Evas *e, int b, void *data)
|
||||||
|
{
|
||||||
|
Evas_List *l, *copy;
|
||||||
|
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
|
if ((b < 1) || (b > 32)) return;
|
||||||
|
|
||||||
|
e->pointer.button &= ~(1 << (b - 1));
|
||||||
|
|
||||||
|
if (e->events_frozen > 0) return;
|
||||||
|
|
||||||
|
copy = evas_event_list_copy(e->pointer.object.in);
|
||||||
|
for (l = copy; l; l = l->next)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
Evas_Event_Mouse_Up ev;
|
||||||
|
|
||||||
|
obj = l->data;
|
||||||
|
if (!e->pointer.button) obj->mouse_grabbed = 0;
|
||||||
|
ev.button = b;
|
||||||
|
ev.output.x = e->pointer.x;
|
||||||
|
ev.output.y = e->pointer.y;
|
||||||
|
ev.canvas.x = e->pointer.canvas_x;
|
||||||
|
ev.canvas.y = e->pointer.canvas_y;
|
||||||
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_UP, &ev);
|
||||||
|
}
|
||||||
|
if (copy) copy = evas_list_free(copy);
|
||||||
|
if (!e->pointer.button)
|
||||||
|
{
|
||||||
|
Evas_List *ins;
|
||||||
|
Evas_List *l;
|
||||||
|
|
||||||
|
e->pointer.mouse_grabbed = 0;
|
||||||
|
/* get new list of ins */
|
||||||
|
ins = evas_event_objects_event_list(e, NULL, e->pointer.x, e->pointer.y);
|
||||||
|
/* go thru old list of in objects */
|
||||||
|
copy = evas_event_list_copy(e->pointer.object.in);
|
||||||
|
for (l = copy; l; l = l->next)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
|
||||||
|
obj = l->data;
|
||||||
|
obj->mouse_grabbed = 0;
|
||||||
|
if (!evas_list_find(ins, obj))
|
||||||
|
{
|
||||||
|
Evas_Event_Mouse_Out ev;
|
||||||
|
|
||||||
|
obj->mouse_in = 0;
|
||||||
|
ev.buttons = e->pointer.button;
|
||||||
|
ev.output.x = e->pointer.x;
|
||||||
|
ev.output.y = e->pointer.y;
|
||||||
|
ev.canvas.x = e->pointer.canvas_x;
|
||||||
|
ev.canvas.y = e->pointer.canvas_y;
|
||||||
|
ev.data = data;
|
||||||
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (copy) copy = evas_list_free(copy);
|
||||||
|
for (l = ins; l; l = l->next)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
|
||||||
|
obj = l->data;
|
||||||
|
|
||||||
|
if (!evas_list_find(e->pointer.object.in, obj))
|
||||||
|
{
|
||||||
|
Evas_Event_Mouse_In ev;
|
||||||
|
|
||||||
|
obj->mouse_in = 1;
|
||||||
|
ev.buttons = e->pointer.button;
|
||||||
|
ev.output.x = e->pointer.x;
|
||||||
|
ev.output.y = e->pointer.y;
|
||||||
|
ev.canvas.x = e->pointer.canvas_x;
|
||||||
|
ev.canvas.y = e->pointer.canvas_y;
|
||||||
|
ev.data = data;
|
||||||
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_IN, &ev);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* free our old list of ins */
|
||||||
|
e->pointer.object.in = evas_list_free(e->pointer.object.in);
|
||||||
|
/* and set up the new one */
|
||||||
|
e->pointer.object.in = ins;
|
||||||
|
evas_event_feed_mouse_move_data(e, e->pointer.x, e->pointer.y, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_event_feed_mouse_move_data(Evas *e, int x, int y, void *data)
|
||||||
|
{
|
||||||
|
int px, py;
|
||||||
|
double pcx, pcy;
|
||||||
|
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
|
px = e->pointer.x;
|
||||||
|
py = e->pointer.y;
|
||||||
|
pcx = e->pointer.canvas_x;
|
||||||
|
pcy = e->pointer.canvas_y;
|
||||||
|
|
||||||
|
if (e->events_frozen > 0) return;
|
||||||
|
|
||||||
|
e->pointer.x = x;
|
||||||
|
e->pointer.y = y;
|
||||||
|
e->pointer.canvas_x = evas_coord_screen_x_to_world(e, x);
|
||||||
|
e->pointer.canvas_y = evas_coord_screen_x_to_world(e, y);
|
||||||
|
/* if our mouse button is grabbed to any objects */
|
||||||
|
if (e->pointer.mouse_grabbed)
|
||||||
|
{
|
||||||
|
/* go thru old list of in objects */
|
||||||
|
Evas_List *outs = NULL;
|
||||||
|
Evas_List *l, *copy;
|
||||||
|
|
||||||
|
copy = evas_event_list_copy(e->pointer.object.in);
|
||||||
|
for (l = copy; l; l = l->next)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
|
||||||
|
obj = l->data;
|
||||||
|
if ((obj->cur.visible) &&
|
||||||
|
(evas_object_clippers_is_visible(obj)) &&
|
||||||
|
(!obj->pass_events) &&
|
||||||
|
(!obj->smart.smart) &&
|
||||||
|
(!obj->clip.clipees))
|
||||||
|
{
|
||||||
|
if ((px != x) || (py != y))
|
||||||
|
{
|
||||||
|
Evas_Event_Mouse_Move ev;
|
||||||
|
|
||||||
|
ev.buttons = e->pointer.button;
|
||||||
|
ev.cur.output.x = e->pointer.x;
|
||||||
|
ev.cur.output.y = e->pointer.y;
|
||||||
|
ev.cur.canvas.x = e->pointer.canvas_x;
|
||||||
|
ev.cur.canvas.y = e->pointer.canvas_y;
|
||||||
|
ev.prev.output.x = px;
|
||||||
|
ev.prev.output.y = py;
|
||||||
|
ev.prev.canvas.x = pcx;
|
||||||
|
ev.prev.canvas.y = pcy;
|
||||||
|
ev.data = data;
|
||||||
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_MOVE, &ev);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
outs = evas_list_append(outs, obj);
|
||||||
|
}
|
||||||
|
if (copy) copy = evas_list_free(copy);
|
||||||
|
while (outs)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
|
||||||
|
obj = outs->data;
|
||||||
|
outs = evas_list_remove(outs, obj);
|
||||||
|
e->pointer.object.in = evas_list_remove(e->pointer.object.in, obj);
|
||||||
|
{
|
||||||
|
Evas_Event_Mouse_Out ev;
|
||||||
|
|
||||||
|
obj->mouse_in = 0;
|
||||||
|
ev.buttons = e->pointer.button;
|
||||||
|
ev.output.x = e->pointer.x;
|
||||||
|
ev.output.y = e->pointer.y;
|
||||||
|
ev.canvas.x = e->pointer.canvas_x;
|
||||||
|
ev.canvas.y = e->pointer.canvas_y;
|
||||||
|
ev.data = data;
|
||||||
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Evas_List *ins;
|
||||||
|
Evas_List *l, *copy;
|
||||||
|
|
||||||
|
/* get all new in objects */
|
||||||
|
ins = evas_event_objects_event_list(e, NULL, x, y);
|
||||||
|
/* go thru old list of in objects */
|
||||||
|
copy = evas_event_list_copy(e->pointer.object.in);
|
||||||
|
for (l = copy; l; l = l->next)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
|
||||||
|
obj = l->data;
|
||||||
|
/* if its under the pointer and its visible and its in the new */
|
||||||
|
/* in list */
|
||||||
|
evas_object_clip_recalc(obj);
|
||||||
|
if (evas_object_is_in_output_rect(obj, x, y, 1, 1) &&
|
||||||
|
(obj->cur.visible) &&
|
||||||
|
(evas_object_clippers_is_visible(obj)) &&
|
||||||
|
(evas_list_find(ins, obj)) &&
|
||||||
|
(!obj->pass_events) &&
|
||||||
|
(!obj->smart.smart) &&
|
||||||
|
(!obj->clip.clipees))
|
||||||
|
{
|
||||||
|
if ((px != x) || (py != y))
|
||||||
|
{
|
||||||
|
Evas_Event_Mouse_Move ev;
|
||||||
|
|
||||||
|
ev.buttons = e->pointer.button;
|
||||||
|
ev.cur.output.x = e->pointer.x;
|
||||||
|
ev.cur.output.y = e->pointer.y;
|
||||||
|
ev.cur.canvas.x = e->pointer.canvas_x;
|
||||||
|
ev.cur.canvas.y = e->pointer.canvas_y;
|
||||||
|
ev.prev.output.x = px;
|
||||||
|
ev.prev.output.y = py;
|
||||||
|
ev.prev.canvas.x = pcx;
|
||||||
|
ev.prev.canvas.y = pcy;
|
||||||
|
ev.data = data;
|
||||||
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_MOVE, &ev);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* otherwise it has left the object */
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Evas_Event_Mouse_Out ev;
|
||||||
|
|
||||||
|
obj->mouse_in = 0;
|
||||||
|
ev.buttons = e->pointer.button;
|
||||||
|
ev.output.x = e->pointer.x;
|
||||||
|
ev.output.y = e->pointer.y;
|
||||||
|
ev.canvas.x = e->pointer.canvas_x;
|
||||||
|
ev.canvas.y = e->pointer.canvas_y;
|
||||||
|
ev.data = data;
|
||||||
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (copy) copy = evas_list_free(copy);
|
||||||
|
/* go thru out current list of ins */
|
||||||
|
for (l = ins; l; l = l->next)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
|
||||||
|
obj = l->data;
|
||||||
|
/* if its not in the old list of ins send an enter event */
|
||||||
|
if (!evas_list_find(e->pointer.object.in, obj))
|
||||||
|
{
|
||||||
|
Evas_Event_Mouse_In ev;
|
||||||
|
|
||||||
|
obj->mouse_in = 1;
|
||||||
|
ev.buttons = e->pointer.button;
|
||||||
|
ev.output.x = e->pointer.x;
|
||||||
|
ev.output.y = e->pointer.y;
|
||||||
|
ev.canvas.x = e->pointer.canvas_x;
|
||||||
|
ev.canvas.y = e->pointer.canvas_y;
|
||||||
|
ev.data = data;
|
||||||
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_IN, &ev);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* free our old list of ins */
|
||||||
|
e->pointer.object.in = evas_list_free(e->pointer.object.in);
|
||||||
|
/* and set up the new one */
|
||||||
|
e->pointer.object.in = ins;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_event_feed_mouse_in_data(Evas *e, void *data)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
e->pointer.inside = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_event_feed_mouse_out_data(Evas *e, void *data)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
e->pointer.inside = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_event_feed_mouse_down(Evas *e, int b)
|
||||||
|
{
|
||||||
|
evas_event_feed_mouse_down_data(e, b, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_event_feed_mouse_up(Evas *e, int b)
|
||||||
|
{
|
||||||
|
evas_event_feed_mouse_up_data(e, b, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_event_feed_mouse_move(Evas *e, int x, int y)
|
||||||
|
{
|
||||||
|
evas_event_feed_mouse_move_data(e, x, y, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_event_feed_mouse_in(Evas *e)
|
||||||
|
{
|
||||||
|
evas_event_feed_mouse_in_data(e, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_event_feed_mouse_out(Evas *e)
|
||||||
|
{
|
||||||
|
evas_event_feed_mouse_out_data(e, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_pass_events_set(Evas_Object *obj, int pass)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
obj->pass_events = pass;
|
||||||
|
if (evas_object_is_in_output_rect(obj,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y, 1, 1))
|
||||||
|
evas_event_feed_mouse_move(obj->layer->evas,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
evas_object_pass_events_get(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return obj->pass_events;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_repeat_events_set(Evas_Object *obj, int repeat)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
obj->repeat_events = repeat;
|
||||||
|
if (evas_object_is_in_output_rect(obj,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y, 1, 1))
|
||||||
|
evas_event_feed_mouse_move(obj->layer->evas,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
evas_object_repeat_events_get(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return obj->repeat_events;
|
||||||
|
}
|
|
@ -0,0 +1,151 @@
|
||||||
|
#include "evas_common.h"
|
||||||
|
#include "evas_private.h"
|
||||||
|
#include "Evas.h"
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_inject(Evas_Object *obj, Evas *e)
|
||||||
|
{
|
||||||
|
Evas_Layer *lay;
|
||||||
|
|
||||||
|
lay = evas_layer_find(e, obj->cur.layer);
|
||||||
|
if (!lay)
|
||||||
|
{
|
||||||
|
lay = evas_layer_new(e);
|
||||||
|
lay->layer = obj->cur.layer;
|
||||||
|
evas_layer_add(lay);
|
||||||
|
}
|
||||||
|
lay->objects = evas_object_list_append(lay->objects, obj);
|
||||||
|
obj->layer = lay;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_release(Evas_Object *obj, int clean_layer)
|
||||||
|
{
|
||||||
|
obj->layer->objects = evas_object_list_remove(obj->layer->objects, obj);
|
||||||
|
if (clean_layer)
|
||||||
|
{
|
||||||
|
if (!obj->layer->objects)
|
||||||
|
{
|
||||||
|
evas_layer_del(obj->layer);
|
||||||
|
evas_layer_free(obj->layer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
obj->layer = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_Layer *
|
||||||
|
evas_layer_new(Evas *e)
|
||||||
|
{
|
||||||
|
Evas_Layer *lay;
|
||||||
|
|
||||||
|
lay = calloc(1, sizeof(Evas_Layer));
|
||||||
|
if (!lay) return NULL;
|
||||||
|
lay->evas = e;
|
||||||
|
return lay;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_layer_free(Evas_Layer *lay)
|
||||||
|
{
|
||||||
|
while (lay->objects)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
|
||||||
|
obj = (Evas_Object *)lay->objects;
|
||||||
|
if (obj->smart.smart) evas_object_smart_del(obj);
|
||||||
|
evas_object_free(obj, 0);
|
||||||
|
}
|
||||||
|
free(lay);
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_Layer *
|
||||||
|
evas_layer_find(Evas *e, int layer_num)
|
||||||
|
{
|
||||||
|
Evas_Object_List *list;
|
||||||
|
|
||||||
|
for (list = (Evas_Object_List *)e->layers; list; list = list->next)
|
||||||
|
{
|
||||||
|
Evas_Layer *layer;
|
||||||
|
|
||||||
|
layer = (Evas_Layer *)list;
|
||||||
|
if (layer->layer == layer_num) return layer;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_layer_add(Evas_Layer *lay)
|
||||||
|
{
|
||||||
|
Evas_Object_List *list;
|
||||||
|
|
||||||
|
for (list = (Evas_Object_List *)lay->evas->layers; list; list = list->next)
|
||||||
|
{
|
||||||
|
Evas_Layer *layer;
|
||||||
|
|
||||||
|
layer = (Evas_Layer *)list;
|
||||||
|
if (layer->layer > lay->layer)
|
||||||
|
{
|
||||||
|
lay->evas->layers = evas_object_list_prepend_relative(lay->evas->layers, lay, layer);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lay->evas->layers = evas_object_list_append(lay->evas->layers, lay);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_layer_del(Evas_Layer *lay)
|
||||||
|
{
|
||||||
|
Evas_Object_List *ol;
|
||||||
|
Evas *e;
|
||||||
|
|
||||||
|
ol = (Evas_Object_List *)lay;
|
||||||
|
e = lay->evas;
|
||||||
|
e->layers = evas_object_list_remove(e->layers, lay);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* public functions */
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_layer_set(Evas_Object *obj, int l)
|
||||||
|
{
|
||||||
|
Evas *e;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (obj->cur.layer == l)
|
||||||
|
{
|
||||||
|
evas_object_raise(obj);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (obj->smart.smart)
|
||||||
|
{
|
||||||
|
if (obj->smart.smart->func_layer_set)
|
||||||
|
obj->smart.smart->func_layer_set(obj, l);
|
||||||
|
}
|
||||||
|
e = obj->layer->evas;
|
||||||
|
evas_object_release(obj, 1);
|
||||||
|
obj->cur.layer = l;
|
||||||
|
evas_object_inject(obj, e);
|
||||||
|
obj->restack = 1;
|
||||||
|
if (obj->clip.clipees) return;
|
||||||
|
if (!obj->smart.smart)
|
||||||
|
{
|
||||||
|
evas_object_change(obj);
|
||||||
|
if (evas_object_is_in_output_rect(obj,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y, 1, 1) &&
|
||||||
|
obj->cur.visible)
|
||||||
|
if (evas_list_find(obj->layer->evas->pointer.object.in, obj))
|
||||||
|
evas_event_feed_mouse_move(obj->layer->evas, obj->layer->evas->pointer.x, obj->layer->evas->pointer.y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
evas_object_layer_get(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return obj->cur.layer;
|
||||||
|
}
|
|
@ -0,0 +1,897 @@
|
||||||
|
#include "evas_common.h"
|
||||||
|
#include "evas_private.h"
|
||||||
|
#ifdef BUILD_ENGINE_SOFTWARE_X11
|
||||||
|
#include "evas_engine_api_software_x11.h"
|
||||||
|
#endif
|
||||||
|
#ifdef BUILD_ENGINE_DIRECTFB
|
||||||
|
#include "evas_engine_api_directfb.h"
|
||||||
|
#endif
|
||||||
|
#ifdef BUILD_ENGINE_FB
|
||||||
|
#include "evas_engine_api_fb.h"
|
||||||
|
#endif
|
||||||
|
#ifdef BUILD_ENGINE_SOFTWARE_WIN32_GDI
|
||||||
|
#include "evas_engine_api_software_win32_gdi.h"
|
||||||
|
#endif
|
||||||
|
#ifdef BUILD_ENGINE_SOFTWARE_QTOPIA
|
||||||
|
#include "evas_engine_api_software_qtopia.h"
|
||||||
|
#endif
|
||||||
|
#ifdef BUILD_ENGINE_GL_X11
|
||||||
|
#include "evas_engine_api_gl_x11.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "Evas.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allocate and new Evas empty canvas.
|
||||||
|
* @return A zeroed out Evas, or NULL on failure
|
||||||
|
*
|
||||||
|
* This function creates a new Evas Canvas object that is completely
|
||||||
|
* uninitialised. You cannot sensibly use this until it has been initialised.
|
||||||
|
* You need to set up the rendering engine first for the canvas before you can
|
||||||
|
* add any objects to the canvas or render it.
|
||||||
|
*
|
||||||
|
* This function will always succeed and return a valid canvas pointer unless
|
||||||
|
* the memory allocation fails, in which case NULL will be returned.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* @code
|
||||||
|
* Evas *evas;
|
||||||
|
*
|
||||||
|
* evas = evas_new();
|
||||||
|
* @endcode
|
||||||
|
*/
|
||||||
|
Evas *
|
||||||
|
evas_new(void)
|
||||||
|
{
|
||||||
|
Evas *e;
|
||||||
|
|
||||||
|
e = calloc(1, sizeof(Evas));
|
||||||
|
if (!e) return NULL;
|
||||||
|
|
||||||
|
e->magic = MAGIC_EVAS;
|
||||||
|
e->output.render_method = RENDER_METHOD_INVALID;
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Free an Evas.
|
||||||
|
* @param e The Pointer to the Evas to be freed
|
||||||
|
*
|
||||||
|
* When called this function frees the Evas Canvas @p e and All Evas Objects
|
||||||
|
* created on this canvas. As the objects are freed if they have free callbacks
|
||||||
|
* set, they will be called during the execution of this function.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* @code
|
||||||
|
* extern Evas *evas;
|
||||||
|
*
|
||||||
|
* evas_free(evas);
|
||||||
|
* @endcode
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
evas_free(Evas *e)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
|
evas_object_font_path_clear(e);
|
||||||
|
|
||||||
|
e->pointer.object.in = evas_list_free(e->pointer.object.in);
|
||||||
|
while (e->layers)
|
||||||
|
{
|
||||||
|
Evas_Layer *lay;
|
||||||
|
|
||||||
|
lay = e->layers;
|
||||||
|
evas_layer_del(lay);
|
||||||
|
evas_layer_free(lay);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e->name_hash) evas_hash_free(e->name_hash);
|
||||||
|
|
||||||
|
while (e->damages)
|
||||||
|
{
|
||||||
|
free(e->damages->data);
|
||||||
|
e->damages = evas_list_remove(e->damages, e->damages->data);
|
||||||
|
}
|
||||||
|
while (e->obscures)
|
||||||
|
{
|
||||||
|
free(e->obscures->data);
|
||||||
|
e->obscures = evas_list_remove(e->obscures, e->obscures->data);
|
||||||
|
}
|
||||||
|
|
||||||
|
e->engine.func->info_free(e, e->engine.info);
|
||||||
|
e->engine.func->context_free(e->engine.data.output, e->engine.data.context);
|
||||||
|
e->engine.func->output_free(e->engine.data.output);
|
||||||
|
|
||||||
|
e->magic = 0;
|
||||||
|
free(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the output method (engine) for the Evas.
|
||||||
|
* @param e The pointer to the Evas Canvas have its engine set
|
||||||
|
* @param render_method The numeric engine value to use.
|
||||||
|
*
|
||||||
|
* This call sets up which engine an Evas Canvas is to use from then on. This
|
||||||
|
* can only be done once and following calls of this function once called once
|
||||||
|
* will do nothing. The render method numeric value can be obtained using the
|
||||||
|
* evas_render_method_lookup() call.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* @code
|
||||||
|
* int engine_id;
|
||||||
|
* Evas *evas;
|
||||||
|
*
|
||||||
|
* evas = evas_new();
|
||||||
|
* engine_id = evas_render_method_lookup("software_x11");
|
||||||
|
* evas_output_method_set(evas, engine_id);
|
||||||
|
* @endcode
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
evas_output_method_set(Evas *e, int render_method)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
|
/* if our engine to set it to is invalid - abort */
|
||||||
|
if (render_method == RENDER_METHOD_INVALID) return;
|
||||||
|
/* if the engine is alreayd set up - abort */
|
||||||
|
if (e->output.render_method != RENDER_METHOD_INVALID) return;
|
||||||
|
/* set the render method */
|
||||||
|
e->output.render_method = render_method;
|
||||||
|
#ifdef BUILD_ENGINE_SOFTWARE_X11
|
||||||
|
if (e->output.render_method == RENDER_METHOD_SOFTWARE_X11)
|
||||||
|
e->engine.func = &evas_engine_software_x11_func;
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
#ifdef BUILD_ENGINE_GL_X11
|
||||||
|
if (e->output.render_method == RENDER_METHOD_GL_X11)
|
||||||
|
e->engine.func = &evas_engine_gl_x11_func;
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
#ifdef BUILD_ENGINE_DIRECTFB
|
||||||
|
if (e->output.render_method == RENDER_METHOD_DIRECTFB)
|
||||||
|
e->engine.func = &evas_engine_directfb_func;
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
#ifdef BUILD_ENGINE_FB
|
||||||
|
if (e->output.render_method == RENDER_METHOD_FB)
|
||||||
|
e->engine.func = &evas_engine_fb_func;
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
#ifdef BUILD_ENGINE_SOFTWARE_WIN32_GDI
|
||||||
|
if (e->output.render_method == RENDER_METHOD_SOFTWARE_WIN32_GDI)
|
||||||
|
e->engine.func = &evas_engine_software_win32_gdi_func;
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
#ifdef BUILD_ENGINE_SOFTWARE_QTOPIA
|
||||||
|
if (e->output.render_method == RENDER_METHOD_SOFTWARE_QTOPIA)
|
||||||
|
e->engine.func = &evas_engine_software_qtopia_func;
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
return;
|
||||||
|
/* get the engine info struct */
|
||||||
|
if (e->output.render_method != RENDER_METHOD_INVALID)
|
||||||
|
{
|
||||||
|
if (e->engine.func->info) e->engine.info = e->engine.func->info(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the output method (engine) for the Evas.
|
||||||
|
* @param e The pointer to the Evas Canvas
|
||||||
|
* @return A numeric engine value
|
||||||
|
*
|
||||||
|
* This function returns the rendering engine currently used bu the given Evas
|
||||||
|
* Canvas passed in. On success the rendering engine used by the Canvas is
|
||||||
|
* returned. On failue 0 is returned.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* @code
|
||||||
|
* extern Evas *evas;
|
||||||
|
* int engine_id;
|
||||||
|
*
|
||||||
|
* engine_id = evas_output_method_get(evas);
|
||||||
|
*
|
||||||
|
* @endcode
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
evas_output_method_get(Evas *e)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return RENDER_METHOD_INVALID;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
|
return e->output.render_method;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the render engine info struct from the canvas.
|
||||||
|
* @param e The pointer to the Evas Canvas
|
||||||
|
* @return A pointer to the Engine Info structure
|
||||||
|
*
|
||||||
|
* Calling this function returns a pointer to a publicly modifyable structure
|
||||||
|
* that the rendering engine for the given canvas has set up. Callin this
|
||||||
|
* function before the rendering engine has been set will result in NULL being
|
||||||
|
* returned, as will calling this function on an invalid canvas. The caller
|
||||||
|
* does no need to free this structure and shoudl only assume that the pointer
|
||||||
|
* tois is valid until evas_engine_info_set() is called or until evas_render()
|
||||||
|
* is called. After these calls the contents of this structure and the pointer
|
||||||
|
* to it are not guaranteed to be valid.
|
||||||
|
*
|
||||||
|
* With some engines calling this call and modifying structure parameters,
|
||||||
|
* then calling evas_engine_info_set() is used to modify engine parameters
|
||||||
|
* whilst the canvas is alive.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* @code
|
||||||
|
* Evas *evas;
|
||||||
|
* Evas_Engine_Info_Software_X11 *einfo;
|
||||||
|
* extern Display *display;
|
||||||
|
* extern Window win;
|
||||||
|
*
|
||||||
|
* evas = evas_new();
|
||||||
|
* evas_output_method_set(evas, evas_render_method_lookup("software_x11"));
|
||||||
|
* evas_output_size_set(evas, 640, 480);
|
||||||
|
* evas_output_viewport_set(evas, 0, 0, 640, 480);
|
||||||
|
* einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(evas);
|
||||||
|
* einfo->info.display = display;
|
||||||
|
* einfo->info.visual = DefaultVisual(display, DefaultScreen(display));
|
||||||
|
* einfo->info.colormap = DefaultColormap(display, DefaultScreen(display));
|
||||||
|
* einfo->info.drawable = win;
|
||||||
|
* einfo->info.depth = DefaultDepth(display, DefaultScreen(display));
|
||||||
|
* evas_engine_info_set(evas, (Evas_Engine_Info *)einfo);
|
||||||
|
* @endcode
|
||||||
|
*/
|
||||||
|
Evas_Engine_Info *
|
||||||
|
evas_engine_info_get(Evas *e)
|
||||||
|
{
|
||||||
|
Evas_Engine_Info *info;
|
||||||
|
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
|
info = e->engine.info;
|
||||||
|
e->engine.info_magic = info->magic;
|
||||||
|
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set up the Engine Info from the info structure.
|
||||||
|
* @param e The pointer to the Evas Canvas
|
||||||
|
* @param info The pointer to the Engine Info to use
|
||||||
|
*
|
||||||
|
* This function takes any parameters set in the provided info structure and
|
||||||
|
* applies them to the rendering engine. You need to use the Engine Info
|
||||||
|
* structure pointer provided by evas_engine_info_get() and not anything else.
|
||||||
|
*
|
||||||
|
* You need to set up the Engine Info at least once before doing any rendering
|
||||||
|
* or creating any objects on the Evas Canvas. Some engines support the
|
||||||
|
* changing of engine parameters during runtime and so the application
|
||||||
|
* should call evas_engine_info_get(), modify parameters that need to be
|
||||||
|
* modified, and then call evas_engine_info_set() again to have those changes
|
||||||
|
* take effect.
|
||||||
|
*
|
||||||
|
* Once evas_engine_info_set() is called the Engine Info structure pointer
|
||||||
|
* should be considered invalid and should not be used again. Use
|
||||||
|
* evas_engine_info_get(0 to fetch it again if needed.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* @code
|
||||||
|
* Evas *evas;
|
||||||
|
* Evas_Engine_Info_Software_X11 *einfo;
|
||||||
|
* extern Display *display;
|
||||||
|
* extern Window win;
|
||||||
|
*
|
||||||
|
* evas = evas_new();
|
||||||
|
* evas_output_method_set(evas, evas_render_method_lookup("software_x11"));
|
||||||
|
* evas_output_size_set(evas, 640, 480);
|
||||||
|
* evas_output_viewport_set(evas, 0, 0, 640, 480);
|
||||||
|
* einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(evas);
|
||||||
|
* einfo->info.display = display;
|
||||||
|
* einfo->info.visual = DefaultVisual(display, DefaultScreen(display));
|
||||||
|
* einfo->info.colormap = DefaultColormap(display, DefaultScreen(display));
|
||||||
|
* einfo->info.drawable = win;
|
||||||
|
* einfo->info.depth = DefaultDepth(display, DefaultScreen(display));
|
||||||
|
* evas_engine_info_set(evas, (Evas_Engine_Info *)einfo);
|
||||||
|
* @endcode
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
evas_engine_info_set(Evas *e, Evas_Engine_Info *info)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (!info) return;
|
||||||
|
if (info != e->engine.info) return;
|
||||||
|
if (info->magic != e->engine.info_magic) return;
|
||||||
|
e->engine.func->setup(e, info);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the render engine's output size in output units.
|
||||||
|
* @param e The pointer to the Evas Canvas
|
||||||
|
* @param w The width in output units
|
||||||
|
* @param h The height in output units
|
||||||
|
*
|
||||||
|
* This function sets the output display size for the Evas Canvas indicated to
|
||||||
|
* be the size (for most engines in pixels). The Canvas will render to a
|
||||||
|
* rectangle of this size on the output target once this call is called. This
|
||||||
|
* is independant of the viewport (view into the canvas world) and will simply
|
||||||
|
* stretch the viewport to fill the rectangle indicated by this call.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* @code
|
||||||
|
* extern Evas *evas;
|
||||||
|
*
|
||||||
|
* evas_output_size_set(evas, 640, 480);
|
||||||
|
* @endcode
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
evas_output_size_set(Evas *e, int w, int h)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
|
if ((w == e->output.w) && (h == e->output.h)) return;
|
||||||
|
if (w < 1) w = 1;
|
||||||
|
if (h < 1) h = 1;
|
||||||
|
e->output.w = w;
|
||||||
|
e->output.h = h;
|
||||||
|
e->output.changed = 1;
|
||||||
|
e->output_validity++;
|
||||||
|
e->changed = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the render engine's output size in output units.
|
||||||
|
* @param e The pointer to the Evas Canvas
|
||||||
|
* @param w The pointer to a width variable to be filled in
|
||||||
|
* @param h The pointer to a height variable to be filled in
|
||||||
|
*
|
||||||
|
* Calling this function writes the current canvas output size values into the
|
||||||
|
* variables pointed to by @p w and @p h. On success the variables have the
|
||||||
|
* output size values written to them in output units. If either @p w or @p h
|
||||||
|
* is NULL, it will not be written to. If @p e is invalid, the results are
|
||||||
|
* undefined.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* @code
|
||||||
|
* extern Evas *evas;
|
||||||
|
* int width, height;
|
||||||
|
*
|
||||||
|
* evas_output_size_get(evas, &width, &height);
|
||||||
|
* @endcode
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
evas_output_size_get(Evas *e, int *w, int *h)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
if (w) *w = 0;
|
||||||
|
if (h) *h = 0;
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
|
if (w) *w = e->output.w;
|
||||||
|
if (h) *h = e->output.h;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the render engine's output viewport in canvas units.
|
||||||
|
* @param e The pointer to the Evas Canvas
|
||||||
|
* @param x The top-left corner x value of the viewport
|
||||||
|
* @param y The top-left corner y value of the viewport
|
||||||
|
* @param w The width of the viewport
|
||||||
|
* @param h The height of the viewport
|
||||||
|
*
|
||||||
|
* This function sets the viewport (in canvas co-ordinate space) that will
|
||||||
|
* be visible in the canvas ouput. The width and height of the viewport must
|
||||||
|
* both be greater than 0. The rectangle described by the co-ordinates is the
|
||||||
|
* rectangular region of the canvas co-ordinate space that is visibly mapped
|
||||||
|
* and stretched to fill the output target of the canvas when rendering is
|
||||||
|
* performed.
|
||||||
|
*
|
||||||
|
* Co-ordinates do not have to map 1 to 1, but it is generally advised for
|
||||||
|
* ease of use that canvas co-ordinates to match output target units for
|
||||||
|
* better control, but this is not required.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* @code
|
||||||
|
* extern Evas *evas;
|
||||||
|
*
|
||||||
|
* evas_output_viewport_set(evas, 0, 0, 640, 480);
|
||||||
|
* @endcode
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
evas_output_viewport_set(Evas *e, double x, double y, double w, double h)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
|
if ((x == e->viewport.x) && (y == e->viewport.y) &&
|
||||||
|
(w == e->viewport.w) && (h == e->viewport.h)) return;
|
||||||
|
if (w <= 0) return;
|
||||||
|
if (h <= 0) return;
|
||||||
|
e->viewport.x = x;
|
||||||
|
e->viewport.y = y;
|
||||||
|
e->viewport.w = w;
|
||||||
|
e->viewport.h = h;
|
||||||
|
e->viewport.changed = 1;
|
||||||
|
e->output_validity++;
|
||||||
|
e->changed = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the render engine's output viewport co-ordinates in canvas units.
|
||||||
|
* @param e The pointer to the Evas Canvas
|
||||||
|
* @param x The pointer to a x variable to be filled in
|
||||||
|
* @param y The pointer to a y variable to be filled in
|
||||||
|
* @param w The pointer to a width variable to be filled in
|
||||||
|
* @param h The pointer to a height variable to be filled in
|
||||||
|
*
|
||||||
|
* Calling this function writes the current canvas output viewport size and
|
||||||
|
* location values into the variables pointed to by @p x, @p y, @p w and @p h.
|
||||||
|
* On success the variables have the output location and size values written
|
||||||
|
* to them in canvas units. If either @p x, @p y, @p w or @p h are NULL, it
|
||||||
|
* they will not be written to. If @p e is invalid, the results are
|
||||||
|
* undefined.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* @code
|
||||||
|
* extern Evas *evas;
|
||||||
|
* double x, y, width, height;
|
||||||
|
*
|
||||||
|
* evas_output_viewport_get(evas, &x, &y, &w, &h);
|
||||||
|
* @endcode
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
evas_output_viewport_get(Evas *e, double *x, double *y, double *w, double *h)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
if (x) *x = 0;
|
||||||
|
if (y) *y = 0;
|
||||||
|
if (w) *w = 0;
|
||||||
|
if (h) *h = 0;
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
|
if (x) *x = e->viewport.x;
|
||||||
|
if (y) *y = e->viewport.y;
|
||||||
|
if (w) *w = e->viewport.w;
|
||||||
|
if (h) *h = e->viewport.h;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert/scale an ouput screen co-ordinate into canvas co-ordinates
|
||||||
|
*
|
||||||
|
* @param e The pointer to the Evas Canvas
|
||||||
|
* @param x The screen/output x co-ordinate
|
||||||
|
* @return The screen co-ordinate translated to canvas unit co-ordinates
|
||||||
|
*
|
||||||
|
* This function takes in a horizontal co-ordinate as the @p x parameter and
|
||||||
|
* converts it into canvas units, accounting for output size, viewport size
|
||||||
|
* and location, returning it as the function return value. If @p e is
|
||||||
|
* invalid, the results are undefined.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* @code
|
||||||
|
* extern Evas *evas;
|
||||||
|
* extern int screen_x;
|
||||||
|
* double canvas_x;
|
||||||
|
*
|
||||||
|
* canvas_x = evas_coord_screen_x_to_world(evas, screen_x);
|
||||||
|
* @endcode
|
||||||
|
*/
|
||||||
|
double
|
||||||
|
evas_coord_screen_x_to_world(Evas *e, int x)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return e->viewport.x + (((double)x * e->viewport.w) / (double)e->output.w);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert/scale an ouput screen co-ordinate into canvas co-ordinates
|
||||||
|
*
|
||||||
|
* @param e The pointer to the Evas Canvas
|
||||||
|
* @param y The screen/output y co-ordinate
|
||||||
|
* @return The screen co-ordinate translated to canvas unit co-ordinates
|
||||||
|
*
|
||||||
|
* This function takes in a vertical co-ordinate as the @p y parameter and
|
||||||
|
* converts it into canvas units, accounting for output size, viewport size
|
||||||
|
* and location, returning it as the function return value. If @p e is
|
||||||
|
* invalid, the results are undefined.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* @code
|
||||||
|
* extern Evas *evas;
|
||||||
|
* extern int screen_y;
|
||||||
|
* double canvas_y;
|
||||||
|
*
|
||||||
|
* canvas_y = evas_coord_screen_y_to_world(evas, screen_y);
|
||||||
|
* @endcode
|
||||||
|
*/
|
||||||
|
double
|
||||||
|
evas_coord_screen_y_to_world(Evas *e, int y)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return e->viewport.y + (((double)y * e->viewport.h) / (double)e->output.h);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert/scale a canvas co-ordinate into output screen co-ordinates
|
||||||
|
*
|
||||||
|
* @param e The pointer to the Evas Canvas
|
||||||
|
* @param x The canvas x co-ordinate
|
||||||
|
* @return The output/screen co-ordinate translated to output co-ordinates
|
||||||
|
*
|
||||||
|
* This function takes in a horizontal co-ordinate as the @p x parameter and
|
||||||
|
* converts it into output units, accounting for output size, viewport size
|
||||||
|
* and location, returning it as the function return value. If @p e is
|
||||||
|
* invalid, the results are undefined.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* @code
|
||||||
|
* extern Evas *evas;
|
||||||
|
* int screen_x;
|
||||||
|
* extern double canvas_x;
|
||||||
|
*
|
||||||
|
* screen_x = evas_coord_world_x_to_screen(evas, canvas_x);
|
||||||
|
* @endcode
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
evas_coord_world_x_to_screen(Evas *e, double x)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return (int)(((x - e->viewport.x) * (double)e->output.w) / e->viewport.w);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert/scale a canvas co-ordinate into output screen co-ordinates
|
||||||
|
*
|
||||||
|
* @param e The pointer to the Evas Canvas
|
||||||
|
* @param y The canvas y co-ordinate
|
||||||
|
* @return The output/screen co-ordinate translated to output co-ordinates
|
||||||
|
*
|
||||||
|
* This function takes in a vertical co-ordinate as the @p x parameter and
|
||||||
|
* converts it into output units, accounting for output size, viewport size
|
||||||
|
* and location, returning it as the function return value. If @p e is
|
||||||
|
* invalid, the results are undefined.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* @code
|
||||||
|
* extern Evas *evas;
|
||||||
|
* int screen_y;
|
||||||
|
* extern double canvas_y;
|
||||||
|
*
|
||||||
|
* screen_y = evas_coord_world_y_to_screen(evas, canvas_y);
|
||||||
|
* @endcode
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
evas_coord_world_y_to_screen(Evas *e, double y)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return (int)(((y - e->viewport.y) * (double)e->output.h) / e->viewport.h);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Look up a numeric ID from a string name of a rendering engine.
|
||||||
|
*
|
||||||
|
* @param name The string name of an engine
|
||||||
|
* @return A numeric (opaque) ID for the rendering engine
|
||||||
|
*
|
||||||
|
* This function looks up a numeric return value for the named engine in the
|
||||||
|
* string @p name. This is a normal C string, NUL byte terminated. The name
|
||||||
|
* is case sensitive. If the rendering engine is available, a numeric ID for
|
||||||
|
* that engine is returned that is no 0, if the engine is not available, 0
|
||||||
|
* is returned, indicating an invalid engine.
|
||||||
|
*
|
||||||
|
* The programmer should NEVER rely on the numeric ID an engine unless it is
|
||||||
|
* returned by this function. Programs should NOT be written accessing render
|
||||||
|
* method ID's directly, without first obtaining it from this function.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* @code
|
||||||
|
* int engine_id;
|
||||||
|
* Evas *evas;
|
||||||
|
*
|
||||||
|
* evas = evas_new();
|
||||||
|
* if (!evas)
|
||||||
|
* {
|
||||||
|
* fprintf(stderr, "ERROR: Canvas creation failed. Fatal error.\n");
|
||||||
|
* exit(-1);
|
||||||
|
* }
|
||||||
|
* engine_id = evas_render_method_lookup("software_x11");
|
||||||
|
* if (!engine_id)
|
||||||
|
* {
|
||||||
|
* fprintf(stderr, "ERROR: Requested rendering engine is absent.\n");
|
||||||
|
* exit(-1);
|
||||||
|
* }
|
||||||
|
* evas_output_method_set(evas, engine_id);
|
||||||
|
* @endcode
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
evas_render_method_lookup(const char *name)
|
||||||
|
{
|
||||||
|
if (!name) return RENDER_METHOD_INVALID;
|
||||||
|
|
||||||
|
#ifdef BUILD_ENGINE_SOFTWARE_X11
|
||||||
|
if (!strcmp(name, "software_x11")) return RENDER_METHOD_SOFTWARE_X11;
|
||||||
|
#endif
|
||||||
|
#ifdef BUILD_ENGINE_GL_X11
|
||||||
|
if (!strcmp(name, "gl_x11")) return RENDER_METHOD_GL_X11;
|
||||||
|
#endif
|
||||||
|
#ifdef BUILD_ENGINE_DIRECTFB
|
||||||
|
if (!strcmp(name, "directfb")) return RENDER_METHOD_DIRECTFB;
|
||||||
|
#endif
|
||||||
|
#ifdef BUILD_ENGINE_FB
|
||||||
|
if (!strcmp(name, "fb")) return RENDER_METHOD_FB;
|
||||||
|
#endif
|
||||||
|
#ifdef BUILD_ENGINE_SOFTWARE_WIN32_GDI
|
||||||
|
if (!strcmp(name, "software_win32_gdi")) return RENDER_METHOD_SOFTWARE_WIN32_GDI;
|
||||||
|
#endif
|
||||||
|
#ifdef BUILD_ENGINE_SOFTWARE_QTOPIA
|
||||||
|
if (!strcmp(name, "software_qtopia")) return RENDER_METHOD_SOFTWARE_QTOPIA;
|
||||||
|
#endif
|
||||||
|
return RENDER_METHOD_INVALID;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List all the rendering engines compiled into the copy of the Evas library
|
||||||
|
*
|
||||||
|
* @return A linked lst whose data members are C strings of engine names
|
||||||
|
*
|
||||||
|
* Calling this will return the program a handle (pointer) to an Evas linked
|
||||||
|
* list. Each node in the linked lists will have the data pointer be a char *
|
||||||
|
* pointer to the string name of the rendering engine available. The strings
|
||||||
|
* should never be modified, neither should the list be modified. This list
|
||||||
|
* should be cleaned up as soon as the program no longer needs it using
|
||||||
|
* evas_render_method_list_free(). If no engines are available from Evas, NULL
|
||||||
|
* will be returned.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* @code
|
||||||
|
* Evas_List *engine_list, *l;
|
||||||
|
*
|
||||||
|
* engine_list = evas_render_method_list();
|
||||||
|
* if (!engine_list)
|
||||||
|
* {
|
||||||
|
* fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n");
|
||||||
|
* exit(-1);
|
||||||
|
* }
|
||||||
|
* printf("Availible Evas Engines:\n");
|
||||||
|
* for (l = engine_list; l; l = l->next)
|
||||||
|
* {
|
||||||
|
* char *engine_name;
|
||||||
|
*
|
||||||
|
* engine_name = l->data;
|
||||||
|
* printf("%s\n", engine_name);
|
||||||
|
* }
|
||||||
|
* evas_render_method_list_free(engine_list);
|
||||||
|
* @endcode
|
||||||
|
*/
|
||||||
|
Evas_List *
|
||||||
|
evas_render_method_list(void)
|
||||||
|
{
|
||||||
|
Evas_List *methods = NULL;
|
||||||
|
|
||||||
|
#ifdef BUILD_ENGINE_SOFTWARE_X11
|
||||||
|
methods = evas_list_append(methods, strdup("software_x11"));
|
||||||
|
#endif
|
||||||
|
#ifdef BUILD_ENGINE_GL_X11
|
||||||
|
methods = evas_list_append(methods, strdup("gl_x11"));
|
||||||
|
#endif
|
||||||
|
#ifdef BUILD_ENGINE_DIRECTFB
|
||||||
|
methods = evas_list_append(methods, strdup("directfb"));
|
||||||
|
#endif
|
||||||
|
#ifdef BUILD_ENGINE_FB
|
||||||
|
methods = evas_list_append(methods, strdup("fb"));
|
||||||
|
#endif
|
||||||
|
#ifdef BBUILD_ENGINE_SOFTWARE_WIN32_GDI
|
||||||
|
methods = evas_list_append(methods, strdup("software_win32_gdi"));
|
||||||
|
#endif
|
||||||
|
#ifdef BBUILD_ENGINE_SOFTWARE_QTOPIA
|
||||||
|
methods = evas_list_append(methods, strdup("software_qtopia"));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function should be called to free a list of engine names
|
||||||
|
*
|
||||||
|
* @param list The Evas_List base pointer for the engine list to be freed
|
||||||
|
*
|
||||||
|
* When this function is called it will free the engine list passed in as
|
||||||
|
* @p list. The list should only be a list of engines generated by calling
|
||||||
|
* evas_render_method_list(). If @p list is NULL, nothing will happen.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* @code
|
||||||
|
* Evas_List *engine_list, *l;
|
||||||
|
*
|
||||||
|
* engine_list = evas_render_method_list();
|
||||||
|
* if (!engine_list)
|
||||||
|
* {
|
||||||
|
* fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n");
|
||||||
|
* exit(-1);
|
||||||
|
* }
|
||||||
|
* printf("Availible Evas Engines:\n");
|
||||||
|
* for (l = engine_list; l; l = l->next)
|
||||||
|
* {
|
||||||
|
* char *engine_name;
|
||||||
|
*
|
||||||
|
* engine_name = l->data;
|
||||||
|
* printf("%s\n", engine_name);
|
||||||
|
* }
|
||||||
|
* evas_render_method_list_free(engine_list);
|
||||||
|
* @endcode
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
evas_render_method_list_free(Evas_List *list)
|
||||||
|
{
|
||||||
|
while (list)
|
||||||
|
{
|
||||||
|
free(list->data);
|
||||||
|
list = evas_list_remove(list, list->data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function returns the current known pointer co-ordinates
|
||||||
|
*
|
||||||
|
* @param e The pointer to the Evas Canvas
|
||||||
|
* @param x The pointer to an integer to be filled in
|
||||||
|
* @param y The pointer to an integer to be filled in
|
||||||
|
*
|
||||||
|
* This function returns the current known screen/output co-ordinates of the
|
||||||
|
* mouse pointer and sets the contents of the integers pointed to by @p x
|
||||||
|
* and @p y to contain these co-ordinates. If @p e is not a valid canvas the
|
||||||
|
* results of this function are undefined.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* @code
|
||||||
|
* extern Evas *evas;
|
||||||
|
* int mouse_x, mouse_y;
|
||||||
|
*
|
||||||
|
* evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y);
|
||||||
|
* printf("Mouse is at screen position %i, %i\n", mouse_x, mouse_y);
|
||||||
|
* @endcode
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
evas_pointer_output_xy_get(Evas *e, int *x, int *y)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
if (x) *x = 0;
|
||||||
|
if (y) *y = 0;
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (x) *x = e->pointer.x;
|
||||||
|
if (y) *y = e->pointer.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function returns the current known pointer co-ordinates
|
||||||
|
*
|
||||||
|
* @param e The pointer to the Evas Canvas
|
||||||
|
* @param x The pointer to a double to be filled in
|
||||||
|
* @param y The pointer to a double to be filled in
|
||||||
|
*
|
||||||
|
* This function returns the current known canvas unit co-ordinates of the
|
||||||
|
* mouse pointer and sets the contents of the doubles pointed to by @p x
|
||||||
|
* and @p y to contain these co-ordinates. If @p e is not a valid canvas the
|
||||||
|
* results of this function are undefined.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* @code
|
||||||
|
* extern Evas *evas;
|
||||||
|
* double mouse_x, mouse_y;
|
||||||
|
*
|
||||||
|
* evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y);
|
||||||
|
* printf("Mouse is at canvas position %f, %f\n", mouse_x, mouse_y);
|
||||||
|
* @endcode
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
evas_pointer_canvas_xy_get(Evas *e, double *x, double *y)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
if (x) *x = 0;
|
||||||
|
if (y) *y = 0;
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (x) *x = e->pointer.x;
|
||||||
|
if (y) *y = e->pointer.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a bitmask with the mouse buttons currently pressed, set to 1
|
||||||
|
*
|
||||||
|
* @param e The pointer to the Evas Canvas
|
||||||
|
* @return A bitmask of the currently depressed buttons on the cavas
|
||||||
|
*
|
||||||
|
* Calling this function will retunr a 32-bit integer with the appropriate bits
|
||||||
|
* set to 1 that correspond to a mouse button being depressed. This limits
|
||||||
|
* Evas to a mouse devices with a maximum of 32 buttons, but that is generally
|
||||||
|
* in excess of any host systems pointing device abilities.
|
||||||
|
*
|
||||||
|
* A canvas by default begins with no mouse buttons being pressed and only
|
||||||
|
* calls to evas_event_feed_mouse_down(), evas_event_feed_mouse_down_data(),
|
||||||
|
* evas_event_feed_mouse_up() and evas_event_feed_mouse_up_data() will alter
|
||||||
|
* that.
|
||||||
|
*
|
||||||
|
* The least significant bit corresponds to the first mouse button (button 1)
|
||||||
|
* and the most significant bit corresponds to the last mouse button
|
||||||
|
* (button 32).
|
||||||
|
*
|
||||||
|
* If @p e is not a valid canvas, the return value is undefined.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* @code
|
||||||
|
* extern Evas *evas;
|
||||||
|
* int button_mask, i;
|
||||||
|
*
|
||||||
|
* button_mask = evas_pointer_button_down_mask_get(evas);
|
||||||
|
* printf("Buttons currently pressed:\n");
|
||||||
|
* for (i = 0; i < 32; i++)
|
||||||
|
* {
|
||||||
|
* if ((button_mask & (1 << i)) != 0) printf("Button %i\n", i + 1);
|
||||||
|
* }
|
||||||
|
* @endcode
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
evas_pointer_button_down_mask_get(Evas *e)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return (int)e->pointer.button;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns if the mouse pointer is logically inside the canvas
|
||||||
|
*
|
||||||
|
* @param e The pointer to the Evas Canvas
|
||||||
|
* @return An integer (0 or 1) corresponding to the outside/inside pointer
|
||||||
|
*
|
||||||
|
* When this function is called it will return a value of either 0 or 1,
|
||||||
|
* depending on if evas_event_feed_mouse_in(), evas_event_feed_mouse_in_data(),
|
||||||
|
* or evas_event_feed_mouse_out(), evas_event_feed_mouse_out_data() have been
|
||||||
|
* called to feed in a mouse enter event into the canvas.
|
||||||
|
*
|
||||||
|
* A return value of 1 indicates the mouse is logically inside the canvas, and
|
||||||
|
* 0 implies it is logically outside the canvas.
|
||||||
|
*
|
||||||
|
* A canvas begins with the mouse being assumed outside (0).
|
||||||
|
*
|
||||||
|
* If @p e is not a valid canvas, the return value is undefined.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* @code
|
||||||
|
* extern Evas *evas;
|
||||||
|
*
|
||||||
|
* if (evas_pointer_inside_get(evas)) printf("Mouse is in!\n");
|
||||||
|
* else printf("Mouse is out\n");
|
||||||
|
* @endcode
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
evas_pointer_inside_get(Evas *e)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return (int)e->pointer.inside;
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
#include "evas_common.h"
|
||||||
|
#include "evas_private.h"
|
||||||
|
#include "Evas.h"
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_name_set(Evas_Object *obj, const char *name)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (obj->name)
|
||||||
|
{
|
||||||
|
obj->layer->evas->name_hash = evas_hash_del(obj->layer->evas->name_hash, obj->name, obj);
|
||||||
|
free(obj->name);
|
||||||
|
}
|
||||||
|
if (!name) obj->name = NULL;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
obj->name = strdup(name);
|
||||||
|
obj->layer->evas->name_hash = evas_hash_add(obj->layer->evas->name_hash, obj->name, obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
evas_object_name_get(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return obj->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_Object *
|
||||||
|
evas_object_name_find(Evas *e, const char *name)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (!name) return NULL;
|
||||||
|
return (Evas_Object *)evas_hash_find(e->name_hash, name);
|
||||||
|
}
|
|
@ -0,0 +1,373 @@
|
||||||
|
#include "evas_common.h"
|
||||||
|
#include "evas_private.h"
|
||||||
|
#include "Evas.h"
|
||||||
|
|
||||||
|
/* private magic number for gradient objects */
|
||||||
|
static const char o_type[] = "gradient";
|
||||||
|
|
||||||
|
/* private struct for gradient object internal data */
|
||||||
|
typedef struct _Evas_Object_Gradient Evas_Object_Gradient;
|
||||||
|
|
||||||
|
struct _Evas_Object_Gradient
|
||||||
|
{
|
||||||
|
DATA32 magic;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
double angle;
|
||||||
|
} cur, prev;
|
||||||
|
int changed : 1;
|
||||||
|
int gradient_changed : 1;
|
||||||
|
int gradient_opaque : 1;
|
||||||
|
|
||||||
|
void *engine_data;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* private methods for gradient objects */
|
||||||
|
static void evas_object_gradient_init(Evas_Object *obj);
|
||||||
|
static void *evas_object_gradient_new(void);
|
||||||
|
static void evas_object_gradient_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y);
|
||||||
|
static void evas_object_gradient_free(Evas_Object *obj);
|
||||||
|
static void evas_object_gradient_render_pre(Evas_Object *obj);
|
||||||
|
static void evas_object_gradient_render_post(Evas_Object *obj);
|
||||||
|
|
||||||
|
static int evas_object_gradient_is_opaque(Evas_Object *obj);
|
||||||
|
static int evas_object_gradient_was_opaque(Evas_Object *obj);
|
||||||
|
|
||||||
|
static Evas_Object_Func object_func =
|
||||||
|
{
|
||||||
|
/* methods (compulsory) */
|
||||||
|
evas_object_gradient_free,
|
||||||
|
evas_object_gradient_render,
|
||||||
|
evas_object_gradient_render_pre,
|
||||||
|
evas_object_gradient_render_post,
|
||||||
|
/* these are optional. NULL = nothing */
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
evas_object_gradient_is_opaque,
|
||||||
|
evas_object_gradient_was_opaque,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
/* the actual api call to add a rect */
|
||||||
|
/* it has no other api calls as all properties are standard */
|
||||||
|
Evas_Object *
|
||||||
|
evas_object_gradient_add(Evas *e)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
obj = evas_object_new();
|
||||||
|
evas_object_gradient_init(obj);
|
||||||
|
evas_object_inject(obj, e);
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_gradient_color_add(Evas_Object *obj, int r, int g, int b, int a, int distance)
|
||||||
|
{
|
||||||
|
Evas_Object_Gradient *o;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Gradient *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Gradient, MAGIC_OBJ_GRADIENT);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o->engine_data = obj->layer->evas->engine.func->gradient_color_add(obj->layer->evas->engine.data.output,
|
||||||
|
obj->layer->evas->engine.data.context,
|
||||||
|
o->engine_data,
|
||||||
|
r, g, b, a,
|
||||||
|
distance);
|
||||||
|
o->gradient_changed = 1;
|
||||||
|
if (a != 255) o->gradient_opaque = 0;
|
||||||
|
evas_object_change(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_gradient_colors_clear(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Gradient *o;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Gradient *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Gradient, MAGIC_OBJ_GRADIENT);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o->engine_data = obj->layer->evas->engine.func->gradient_colors_clear(obj->layer->evas->engine.data.output,
|
||||||
|
obj->layer->evas->engine.data.context,
|
||||||
|
o->engine_data);
|
||||||
|
o->gradient_changed = 1;
|
||||||
|
o->gradient_opaque = 1;
|
||||||
|
evas_object_change(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_gradient_angle_set(Evas_Object *obj, double angle)
|
||||||
|
{
|
||||||
|
Evas_Object_Gradient *o;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Gradient *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Gradient, MAGIC_OBJ_GRADIENT);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (angle == o->cur.angle) return;
|
||||||
|
o->cur.angle = angle;
|
||||||
|
o->changed = 1;
|
||||||
|
evas_object_change(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
double
|
||||||
|
evas_object_gradient_angle_get(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Gradient *o;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return 0.0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Gradient *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Gradient, MAGIC_OBJ_GRADIENT);
|
||||||
|
return 0.0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return o->cur.angle;
|
||||||
|
evas_object_change(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* all nice and private */
|
||||||
|
static void
|
||||||
|
evas_object_gradient_init(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
/* alloc image ob, setup methods and default values */
|
||||||
|
obj->object_data = evas_object_gradient_new();
|
||||||
|
/* set up default settings for this kind of object */
|
||||||
|
obj->cur.color.r = 255;
|
||||||
|
obj->cur.color.g = 255;
|
||||||
|
obj->cur.color.b = 255;
|
||||||
|
obj->cur.color.a = 255;
|
||||||
|
obj->cur.geometry.x = 0.0;
|
||||||
|
obj->cur.geometry.y = 0.0;
|
||||||
|
obj->cur.geometry.w = 32.0;
|
||||||
|
obj->cur.geometry.h = 32.0;
|
||||||
|
obj->cur.layer = 0;
|
||||||
|
/* set up object-specific settings */
|
||||||
|
obj->prev = obj->cur;
|
||||||
|
/* set up methods (compulsory) */
|
||||||
|
obj->func = &object_func;
|
||||||
|
obj->type = o_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void *
|
||||||
|
evas_object_gradient_new(void)
|
||||||
|
{
|
||||||
|
Evas_Object_Gradient *o;
|
||||||
|
|
||||||
|
/* alloc obj private data */
|
||||||
|
o = calloc(1, sizeof(Evas_Object_Gradient));
|
||||||
|
o->magic = MAGIC_OBJ_GRADIENT;
|
||||||
|
o->cur.angle = 0.0;
|
||||||
|
o->prev = o->cur;
|
||||||
|
o->gradient_opaque = 1;
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_object_gradient_free(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Gradient *o;
|
||||||
|
|
||||||
|
/* frees private object data. very simple here */
|
||||||
|
o = (Evas_Object_Gradient *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Gradient, MAGIC_OBJ_GRADIENT);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
/* free obj */
|
||||||
|
o->engine_data = obj->layer->evas->engine.func->gradient_colors_clear(obj->layer->evas->engine.data.output,
|
||||||
|
obj->layer->evas->engine.data.context,
|
||||||
|
o->engine_data);
|
||||||
|
o->magic = 0;
|
||||||
|
free(o);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_object_gradient_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y)
|
||||||
|
{
|
||||||
|
Evas_Object_Gradient *o;
|
||||||
|
|
||||||
|
/* render object to surface with context, and offxet by x,y */
|
||||||
|
o = (Evas_Object_Gradient *)(obj->object_data);
|
||||||
|
obj->layer->evas->engine.func->context_color_set(output,
|
||||||
|
context,
|
||||||
|
255, 255, 255, 255);
|
||||||
|
if ((obj->cur.cache.clip.r == 255) &&
|
||||||
|
(obj->cur.cache.clip.g == 255) &&
|
||||||
|
(obj->cur.cache.clip.b == 255) &&
|
||||||
|
(obj->cur.cache.clip.a == 255))
|
||||||
|
obj->layer->evas->engine.func->context_multiplier_unset(output,
|
||||||
|
context);
|
||||||
|
else
|
||||||
|
obj->layer->evas->engine.func->context_multiplier_set(output,
|
||||||
|
context,
|
||||||
|
obj->cur.cache.clip.r,
|
||||||
|
obj->cur.cache.clip.g,
|
||||||
|
obj->cur.cache.clip.b,
|
||||||
|
obj->cur.cache.clip.a);
|
||||||
|
if (o->engine_data)
|
||||||
|
obj->layer->evas->engine.func->gradient_draw(output,
|
||||||
|
context,
|
||||||
|
surface,
|
||||||
|
o->engine_data,
|
||||||
|
obj->cur.cache.geometry.x + x,
|
||||||
|
obj->cur.cache.geometry.y + y,
|
||||||
|
obj->cur.cache.geometry.w,
|
||||||
|
obj->cur.cache.geometry.h,
|
||||||
|
o->cur.angle);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_object_gradient_render_pre(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_List *updates = NULL;
|
||||||
|
Evas_Object_Gradient *o;
|
||||||
|
int is_v, was_v;
|
||||||
|
|
||||||
|
/* dont pre-render the obj twice! */
|
||||||
|
if (obj->pre_render_done) return;
|
||||||
|
obj->pre_render_done = 1;
|
||||||
|
/* pre-render phase. this does anything an object needs to do just before */
|
||||||
|
/* rendering. this could mean loading the image data, retrieving it from */
|
||||||
|
/* elsewhere, decoding video etc. */
|
||||||
|
/* then when this is done the object needs to figure if it changed and */
|
||||||
|
/* if so what and where and add thr appropriate redraw rectangles */
|
||||||
|
o = (Evas_Object_Gradient *)(obj->object_data);
|
||||||
|
/* if someone is clipping this obj - go calculate the clipper */
|
||||||
|
if (obj->cur.clipper)
|
||||||
|
{
|
||||||
|
evas_object_clip_recalc(obj->cur.clipper);
|
||||||
|
obj->cur.clipper->func->render_pre(obj->cur.clipper);
|
||||||
|
}
|
||||||
|
/* now figure what changed and add draw rects */
|
||||||
|
/* if it just became visible or invisible */
|
||||||
|
is_v = evas_object_is_visible(obj);
|
||||||
|
was_v = evas_object_was_visible(obj);
|
||||||
|
if (is_v != was_v)
|
||||||
|
{
|
||||||
|
updates = evas_object_render_pre_visible_change(updates, obj, is_v, was_v);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
/* its not visible - we accounted for it appearing or not so just abort */
|
||||||
|
if (!is_v) goto done;
|
||||||
|
/* clipper changed this is in addition to anything else for obj */
|
||||||
|
updates = evas_object_render_pre_clipper_change(updates, obj);
|
||||||
|
/* if we restacked (layer or just within a layer) and dont clip anyone */
|
||||||
|
if (obj->restack)
|
||||||
|
{
|
||||||
|
updates = evas_object_render_pre_prev_cur_add(updates, obj);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
/* if it changed color */
|
||||||
|
if ((obj->cur.color.r != obj->prev.color.r) ||
|
||||||
|
(obj->cur.color.g != obj->prev.color.g) ||
|
||||||
|
(obj->cur.color.b != obj->prev.color.b) ||
|
||||||
|
(obj->cur.color.a != obj->prev.color.a))
|
||||||
|
{
|
||||||
|
updates = evas_object_render_pre_prev_cur_add(updates, obj);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
/* if it changed geometry - and obviously not visibility or color */
|
||||||
|
/* caluclate differences since we have a constant color fill */
|
||||||
|
/* we really only need to update the differences */
|
||||||
|
if ((obj->cur.geometry.x != obj->prev.geometry.x) ||
|
||||||
|
(obj->cur.geometry.y != obj->prev.geometry.y) ||
|
||||||
|
(obj->cur.geometry.w != obj->prev.geometry.w) ||
|
||||||
|
(obj->cur.geometry.h != obj->prev.geometry.h))
|
||||||
|
{
|
||||||
|
updates = evas_object_render_pre_prev_cur_add(updates, obj);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
/* angle changed */
|
||||||
|
if ((o->changed) && (o->cur.angle != o->prev.angle))
|
||||||
|
{
|
||||||
|
updates = evas_object_render_pre_prev_cur_add(updates, obj);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
/* angle changed */
|
||||||
|
if (o->gradient_changed)
|
||||||
|
{
|
||||||
|
updates = evas_object_render_pre_prev_cur_add(updates, obj);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
/* it obviously didn't change - add a NO obscure - this "unupdates" this */
|
||||||
|
/* area so if there were updates for it they get wiped. don't do it if we */
|
||||||
|
/* arent fully opaque and we are visible */
|
||||||
|
if (evas_object_is_visible(obj) &&
|
||||||
|
evas_object_is_opaque(obj))
|
||||||
|
obj->layer->evas->engine.func->output_redraws_rect_del(obj->layer->evas->engine.data.output,
|
||||||
|
obj->cur.cache.clip.x,
|
||||||
|
obj->cur.cache.clip.y,
|
||||||
|
obj->cur.cache.clip.w,
|
||||||
|
obj->cur.cache.clip.h);
|
||||||
|
done:
|
||||||
|
evas_object_render_pre_effect_updates(updates, obj, is_v, was_v);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_object_gradient_render_post(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Gradient *o;
|
||||||
|
|
||||||
|
/* this moves the current data to the previous state parts of the object */
|
||||||
|
/* in whatever way is safest for the object. also if we don't need object */
|
||||||
|
/* data anymore we can free it if the object deems this is a good idea */
|
||||||
|
o = (Evas_Object_Gradient *)(obj->object_data);
|
||||||
|
/* remove those pesky changes */
|
||||||
|
while (obj->clip.changes)
|
||||||
|
{
|
||||||
|
Evas_Rectangle *r;
|
||||||
|
|
||||||
|
r = (Evas_Rectangle *)obj->clip.changes->data;
|
||||||
|
obj->clip.changes = evas_list_remove(obj->clip.changes, r);
|
||||||
|
free(r);
|
||||||
|
}
|
||||||
|
/* move cur to prev safely for object data */
|
||||||
|
obj->prev = obj->cur;
|
||||||
|
o->prev = o->cur;
|
||||||
|
o->changed = 0;
|
||||||
|
o->gradient_changed = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
evas_object_gradient_is_opaque(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Gradient *o;
|
||||||
|
|
||||||
|
/* this returns 1 if the internal object data implies that the object is */
|
||||||
|
/* currently fulyl opque over the entire gradient it occupies */
|
||||||
|
o = (Evas_Object_Gradient *)(obj->object_data);
|
||||||
|
return o->gradient_opaque;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
evas_object_gradient_was_opaque(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Gradient *o;
|
||||||
|
|
||||||
|
/* this returns 1 if the internal object data implies that the object was */
|
||||||
|
/* currently fulyl opque over the entire gradient it occupies */
|
||||||
|
o = (Evas_Object_Gradient *)(obj->object_data);
|
||||||
|
return o->gradient_opaque;
|
||||||
|
}
|
|
@ -0,0 +1,399 @@
|
||||||
|
#include "evas_common.h"
|
||||||
|
#include "evas_private.h"
|
||||||
|
#include "Evas.h"
|
||||||
|
|
||||||
|
/* private magic number for line objects */
|
||||||
|
static const char o_type[] = "line";
|
||||||
|
|
||||||
|
/* private struct for line object internal data */
|
||||||
|
typedef struct _Evas_Object_Line Evas_Object_Line;
|
||||||
|
|
||||||
|
struct _Evas_Object_Line
|
||||||
|
{
|
||||||
|
DATA32 magic;
|
||||||
|
struct {
|
||||||
|
struct {
|
||||||
|
int x1, y1, x2, y2;
|
||||||
|
struct {
|
||||||
|
double w, h;
|
||||||
|
} object;
|
||||||
|
} cache;
|
||||||
|
double x1, y1, x2, y2;
|
||||||
|
} cur, prev;
|
||||||
|
int changed : 1;
|
||||||
|
|
||||||
|
void *engine_data;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* private methods for line objects */
|
||||||
|
static void evas_object_line_init(Evas_Object *obj);
|
||||||
|
static void *evas_object_line_new(void);
|
||||||
|
static void evas_object_line_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y);
|
||||||
|
static void evas_object_line_free(Evas_Object *obj);
|
||||||
|
static void evas_object_line_render_pre(Evas_Object *obj);
|
||||||
|
static void evas_object_line_render_post(Evas_Object *obj);
|
||||||
|
|
||||||
|
static int evas_object_line_is_opaque(Evas_Object *obj);
|
||||||
|
static int evas_object_line_was_opaque(Evas_Object *obj);
|
||||||
|
static int evas_object_line_is_inside(Evas_Object *obj, double x, double y);
|
||||||
|
static int evas_object_line_was_inside(Evas_Object *obj, double x, double y);
|
||||||
|
static void evas_object_line_coords_recalc(Evas_Object *obj);
|
||||||
|
|
||||||
|
static Evas_Object_Func object_func =
|
||||||
|
{
|
||||||
|
/* methods (compulsory) */
|
||||||
|
evas_object_line_free,
|
||||||
|
evas_object_line_render,
|
||||||
|
evas_object_line_render_pre,
|
||||||
|
evas_object_line_render_post,
|
||||||
|
/* these are optional. NULL = nothing */
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
evas_object_line_is_opaque,
|
||||||
|
evas_object_line_was_opaque,
|
||||||
|
evas_object_line_is_inside,
|
||||||
|
evas_object_line_was_inside,
|
||||||
|
evas_object_line_coords_recalc
|
||||||
|
};
|
||||||
|
|
||||||
|
/* the actual api call to add a rect */
|
||||||
|
/* it has no other api calls as all properties are standard */
|
||||||
|
Evas_Object *
|
||||||
|
evas_object_line_add(Evas *e)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
obj = evas_object_new();
|
||||||
|
evas_object_line_init(obj);
|
||||||
|
evas_object_inject(obj, e);
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_line_xy_set(Evas_Object *obj, double x1, double y1, double x2, double y2)
|
||||||
|
{
|
||||||
|
Evas_Object_Line *o;
|
||||||
|
double min_x, max_x, min_y, max_y;
|
||||||
|
int is, was;
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Line *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Line, MAGIC_OBJ_LINE);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if ((x1 == o->cur.x1) && (y1 == o->cur.y1) &&
|
||||||
|
(x2 == o->cur.x2) && (y2 == o->cur.y2)) return;
|
||||||
|
was = evas_object_is_in_output_rect(obj,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y, 1, 1);
|
||||||
|
if (x1 < x2)
|
||||||
|
{
|
||||||
|
min_x = x1;
|
||||||
|
max_x = x2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
min_x = x2;
|
||||||
|
max_x = x1;
|
||||||
|
}
|
||||||
|
if (y1 < y2)
|
||||||
|
{
|
||||||
|
min_y = y1;
|
||||||
|
max_y = y2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
min_y = y2;
|
||||||
|
max_y = y1;
|
||||||
|
}
|
||||||
|
obj->cur.geometry.x = min_x;
|
||||||
|
obj->cur.geometry.y = min_y;
|
||||||
|
obj->cur.geometry.w = max_x - min_x + 2.0;
|
||||||
|
obj->cur.geometry.h = max_y - min_y + 2.0;
|
||||||
|
obj->cur.cache.geometry.validity = 0;
|
||||||
|
o->cur.x1 = x1 - min_x;
|
||||||
|
o->cur.y1 = y1 - min_y;
|
||||||
|
o->cur.x2 = x2 - min_x;
|
||||||
|
o->cur.y2 = y2 - min_y;
|
||||||
|
o->changed = 1;
|
||||||
|
evas_object_change(obj);
|
||||||
|
evas_object_coords_recalc(obj);
|
||||||
|
is = evas_object_is_in_output_rect(obj,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y, 1, 1);
|
||||||
|
if ((is ^ was) && obj->cur.visible)
|
||||||
|
evas_event_feed_mouse_move(obj->layer->evas,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_line_xy_get(Evas_Object *obj, double *x1, double *y1, double *x2, double *y2)
|
||||||
|
{
|
||||||
|
Evas_Object_Line *o;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
if (x1) *x1 = 0.0;
|
||||||
|
if (y1) *y1 = 0.0;
|
||||||
|
if (x2) *x2 = 0.0;
|
||||||
|
if (y2) *y2 = 0.0;
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Line *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Line, MAGIC_OBJ_LINE);
|
||||||
|
if (x1) *x1 = 0.0;
|
||||||
|
if (y1) *y1 = 0.0;
|
||||||
|
if (x2) *x2 = 0.0;
|
||||||
|
if (y2) *y2 = 0.0;
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (x1) *x1 = obj->cur.geometry.x + o->cur.x1;
|
||||||
|
if (y1) *y1 = obj->cur.geometry.y + o->cur.y1;
|
||||||
|
if (x2) *x2 = obj->cur.geometry.x + o->cur.x2;
|
||||||
|
if (y2) *y2 = obj->cur.geometry.y + o->cur.y2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* all nice and private */
|
||||||
|
static void
|
||||||
|
evas_object_line_init(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
/* alloc image ob, setup methods and default values */
|
||||||
|
obj->object_data = evas_object_line_new();
|
||||||
|
/* set up default settings for this kind of object */
|
||||||
|
obj->cur.color.r = 255;
|
||||||
|
obj->cur.color.g = 255;
|
||||||
|
obj->cur.color.b = 255;
|
||||||
|
obj->cur.color.a = 255;
|
||||||
|
obj->cur.geometry.x = 0.0;
|
||||||
|
obj->cur.geometry.y = 0.0;
|
||||||
|
obj->cur.geometry.w = 32.0;
|
||||||
|
obj->cur.geometry.h = 32.0;
|
||||||
|
obj->cur.layer = 0;
|
||||||
|
/* set up object-specific settings */
|
||||||
|
obj->prev = obj->cur;
|
||||||
|
/* set up methods (compulsory) */
|
||||||
|
obj->func = &object_func;
|
||||||
|
obj->type = o_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void *
|
||||||
|
evas_object_line_new(void)
|
||||||
|
{
|
||||||
|
Evas_Object_Line *o;
|
||||||
|
|
||||||
|
/* alloc obj private data */
|
||||||
|
o = calloc(1, sizeof(Evas_Object_Line));
|
||||||
|
o->magic = MAGIC_OBJ_LINE;
|
||||||
|
o->cur.x1 = 0.0;
|
||||||
|
o->cur.y1 = 0.0;
|
||||||
|
o->cur.x2 = 31.0;
|
||||||
|
o->cur.y2 = 31.0;
|
||||||
|
o->prev = o->cur;
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_object_line_free(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Line *o;
|
||||||
|
|
||||||
|
/* frees private object data. very simple here */
|
||||||
|
o = (Evas_Object_Line *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Line, MAGIC_OBJ_LINE);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
/* free obj */
|
||||||
|
o->magic = 0;
|
||||||
|
free(o);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_object_line_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y)
|
||||||
|
{
|
||||||
|
Evas_Object_Line *o;
|
||||||
|
|
||||||
|
/* render object to surface with context, and offxet by x,y */
|
||||||
|
o = (Evas_Object_Line *)(obj->object_data);
|
||||||
|
obj->layer->evas->engine.func->context_color_set(output,
|
||||||
|
context,
|
||||||
|
obj->cur.cache.clip.r,
|
||||||
|
obj->cur.cache.clip.g,
|
||||||
|
obj->cur.cache.clip.b,
|
||||||
|
obj->cur.cache.clip.a);
|
||||||
|
obj->layer->evas->engine.func->context_multiplier_unset(output,
|
||||||
|
context);
|
||||||
|
obj->layer->evas->engine.func->line_draw(output,
|
||||||
|
context,
|
||||||
|
surface,
|
||||||
|
o->cur.cache.x1 + x,
|
||||||
|
o->cur.cache.y1 + y,
|
||||||
|
o->cur.cache.x2 + x,
|
||||||
|
o->cur.cache.y2 + y);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_object_line_render_pre(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_List *updates = NULL;
|
||||||
|
Evas_Object_Line *o;
|
||||||
|
int is_v, was_v;
|
||||||
|
|
||||||
|
/* dont pre-render the obj twice! */
|
||||||
|
if (obj->pre_render_done) return;
|
||||||
|
obj->pre_render_done = 1;
|
||||||
|
/* pre-render phase. this does anything an object needs to do just before */
|
||||||
|
/* rendering. this could mean loading the image data, retrieving it from */
|
||||||
|
/* elsewhere, decoding video etc. */
|
||||||
|
/* then when this is done the object needs to figure if it changed and */
|
||||||
|
/* if so what and where and add thr appropriate redraw lines */
|
||||||
|
o = (Evas_Object_Line *)(obj->object_data);
|
||||||
|
/* if someone is clipping this obj - go calculate the clipper */
|
||||||
|
if (obj->cur.clipper)
|
||||||
|
{
|
||||||
|
evas_object_clip_recalc(obj->cur.clipper);
|
||||||
|
obj->cur.clipper->func->render_pre(obj->cur.clipper);
|
||||||
|
}
|
||||||
|
/* now figure what changed and add draw rects */
|
||||||
|
/* if it just became visible or invisible */
|
||||||
|
is_v = evas_object_is_visible(obj);
|
||||||
|
was_v = evas_object_was_visible(obj);
|
||||||
|
if (is_v != was_v)
|
||||||
|
{
|
||||||
|
updates = evas_object_render_pre_visible_change(updates, obj, is_v, was_v);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
/* its not visible - we accounted for it appearing or not so just abort */
|
||||||
|
if (!is_v) goto done;
|
||||||
|
/* clipper changed this is in addition to anything else for obj */
|
||||||
|
updates = evas_object_render_pre_clipper_change(updates, obj);
|
||||||
|
/* if we restacked (layer or just within a layer) */
|
||||||
|
if (obj->restack)
|
||||||
|
{
|
||||||
|
updates = evas_object_render_pre_prev_cur_add(updates, obj);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
/* if it changed color */
|
||||||
|
if ((obj->cur.color.r != obj->prev.color.r) ||
|
||||||
|
(obj->cur.color.g != obj->prev.color.g) ||
|
||||||
|
(obj->cur.color.b != obj->prev.color.b) ||
|
||||||
|
(obj->cur.color.a != obj->prev.color.a))
|
||||||
|
{
|
||||||
|
updates = evas_object_render_pre_prev_cur_add(updates, obj);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
/* if it changed geometry - and obviously not visibility or color */
|
||||||
|
/* caluclate differences since we have a constant color fill */
|
||||||
|
/* we really only need to update the differences */
|
||||||
|
if ((obj->cur.geometry.x != obj->prev.geometry.x) ||
|
||||||
|
(obj->cur.geometry.y != obj->prev.geometry.y) ||
|
||||||
|
(obj->cur.geometry.w != obj->prev.geometry.w) ||
|
||||||
|
(obj->cur.geometry.h != obj->prev.geometry.h) ||
|
||||||
|
((o->changed) &&
|
||||||
|
((o->cur.x1 != o->prev.x1) ||
|
||||||
|
(o->cur.y1 != o->prev.y1) ||
|
||||||
|
(o->cur.x2 != o->prev.x2) ||
|
||||||
|
(o->cur.y2 != o->prev.y2)))
|
||||||
|
)
|
||||||
|
{
|
||||||
|
updates = evas_object_render_pre_prev_cur_add(updates, obj);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
done:
|
||||||
|
evas_object_render_pre_effect_updates(updates, obj, is_v, was_v);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_object_line_render_post(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Line *o;
|
||||||
|
|
||||||
|
/* this moves the current data to the previous state parts of the object */
|
||||||
|
/* in whatever way is safest for the object. also if we don't need object */
|
||||||
|
/* data anymore we can free it if the object deems this is a good idea */
|
||||||
|
o = (Evas_Object_Line *)(obj->object_data);
|
||||||
|
/* remove those pesky changes */
|
||||||
|
while (obj->clip.changes)
|
||||||
|
{
|
||||||
|
Evas_Rectangle *r;
|
||||||
|
|
||||||
|
r = (Evas_Rectangle *)obj->clip.changes->data;
|
||||||
|
obj->clip.changes = evas_list_remove(obj->clip.changes, r);
|
||||||
|
free(r);
|
||||||
|
}
|
||||||
|
/* move cur to prev safely for object data */
|
||||||
|
obj->prev = obj->cur;
|
||||||
|
o->prev = o->cur;
|
||||||
|
o->changed = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
evas_object_line_is_opaque(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Line *o;
|
||||||
|
|
||||||
|
/* this returns 1 if the internal object data implies that the object is */
|
||||||
|
/* currently fulyl opque over the entire line it occupies */
|
||||||
|
o = (Evas_Object_Line *)(obj->object_data);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
evas_object_line_was_opaque(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Line *o;
|
||||||
|
|
||||||
|
/* this returns 1 if the internal object data implies that the object was */
|
||||||
|
/* currently fulyl opque over the entire line it occupies */
|
||||||
|
o = (Evas_Object_Line *)(obj->object_data);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
evas_object_line_is_inside(Evas_Object *obj, double x, double y)
|
||||||
|
{
|
||||||
|
Evas_Object_Line *o;
|
||||||
|
|
||||||
|
/* this returns 1 if the canvas co-ordinates are inside the object based */
|
||||||
|
/* on object private data. not much use for rects, but for polys images */
|
||||||
|
/* and other complex objects it might be */
|
||||||
|
o = (Evas_Object_Line *)(obj->object_data);
|
||||||
|
return 1;
|
||||||
|
x = 0;
|
||||||
|
y = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
evas_object_line_was_inside(Evas_Object *obj, double x, double y)
|
||||||
|
{
|
||||||
|
Evas_Object_Line *o;
|
||||||
|
|
||||||
|
/* this returns 1 if the canvas co-ordinates were inside the object based */
|
||||||
|
/* on object private data. not much use for rects, but for polys images */
|
||||||
|
/* and other complex objects it might be */
|
||||||
|
o = (Evas_Object_Line *)(obj->object_data);
|
||||||
|
return 1;
|
||||||
|
x = 0;
|
||||||
|
y = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_object_line_coords_recalc(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Line *o;
|
||||||
|
|
||||||
|
o = (Evas_Object_Line *)(obj->object_data);
|
||||||
|
o->cur.cache.x1 = evas_coord_world_x_to_screen(obj->layer->evas, obj->cur.geometry.x + o->cur.x1);
|
||||||
|
o->cur.cache.y1 = evas_coord_world_y_to_screen(obj->layer->evas, obj->cur.geometry.y + o->cur.y1);
|
||||||
|
o->cur.cache.x2 = evas_coord_world_x_to_screen(obj->layer->evas, obj->cur.geometry.x + o->cur.x2);
|
||||||
|
o->cur.cache.y2 = evas_coord_world_y_to_screen(obj->layer->evas, obj->cur.geometry.y + o->cur.y2);
|
||||||
|
o->cur.cache.object.w = obj->cur.geometry.w;
|
||||||
|
o->cur.cache.object.h = obj->cur.geometry.h;
|
||||||
|
}
|
|
@ -0,0 +1,833 @@
|
||||||
|
#include "evas_common.h"
|
||||||
|
#include "evas_private.h"
|
||||||
|
#include "Evas.h"
|
||||||
|
|
||||||
|
/* evas internal stuff */
|
||||||
|
Evas_Object *
|
||||||
|
evas_object_new(void)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
|
||||||
|
obj = calloc(1, sizeof(Evas_Object));
|
||||||
|
if (!obj) return NULL;
|
||||||
|
|
||||||
|
obj->magic = MAGIC_OBJ;
|
||||||
|
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_free(Evas_Object *obj, int clean_layer)
|
||||||
|
{
|
||||||
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_FREE, NULL);
|
||||||
|
evas_object_smart_cleanup(obj);
|
||||||
|
obj->func->free(obj);
|
||||||
|
if (obj->name)
|
||||||
|
evas_object_name_set(obj, NULL);
|
||||||
|
evas_object_release(obj, clean_layer);
|
||||||
|
if (obj->name)
|
||||||
|
{
|
||||||
|
free(obj->name);
|
||||||
|
obj->name = NULL;
|
||||||
|
}
|
||||||
|
if (obj->clip.clipees)
|
||||||
|
evas_list_free(obj->clip.clipees);
|
||||||
|
while (obj->clip.changes)
|
||||||
|
{
|
||||||
|
Evas_Rectangle *r;
|
||||||
|
|
||||||
|
r = (Evas_Rectangle *)obj->clip.changes->data;
|
||||||
|
obj->clip.changes = evas_list_remove(obj->clip.changes, r);
|
||||||
|
free(r);
|
||||||
|
}
|
||||||
|
while (obj->callbacks.in)
|
||||||
|
{
|
||||||
|
Evas_Func_Node *fn;
|
||||||
|
|
||||||
|
fn = (Evas_Func_Node *)obj->callbacks.in;
|
||||||
|
obj->callbacks.in = evas_object_list_remove(obj->callbacks.in, fn);
|
||||||
|
free(fn);
|
||||||
|
}
|
||||||
|
while (obj->callbacks.out)
|
||||||
|
{
|
||||||
|
Evas_Func_Node *fn;
|
||||||
|
|
||||||
|
fn = (Evas_Func_Node *)obj->callbacks.out;
|
||||||
|
obj->callbacks.out = evas_object_list_remove(obj->callbacks.out, fn);
|
||||||
|
free(fn);
|
||||||
|
}
|
||||||
|
while (obj->callbacks.down)
|
||||||
|
{
|
||||||
|
Evas_Func_Node *fn;
|
||||||
|
|
||||||
|
fn = (Evas_Func_Node *)obj->callbacks.down;
|
||||||
|
obj->callbacks.down = evas_object_list_remove(obj->callbacks.down, fn);
|
||||||
|
free(fn);
|
||||||
|
}
|
||||||
|
while (obj->callbacks.up)
|
||||||
|
{
|
||||||
|
Evas_Func_Node *fn;
|
||||||
|
|
||||||
|
fn = (Evas_Func_Node *)obj->callbacks.up;
|
||||||
|
obj->callbacks.up = evas_object_list_remove(obj->callbacks.up, fn);
|
||||||
|
free(fn);
|
||||||
|
}
|
||||||
|
while (obj->callbacks.move)
|
||||||
|
{
|
||||||
|
Evas_Func_Node *fn;
|
||||||
|
|
||||||
|
fn = (Evas_Func_Node *)obj->callbacks.move;
|
||||||
|
obj->callbacks.move = evas_object_list_remove(obj->callbacks.move, fn);
|
||||||
|
free(fn);
|
||||||
|
}
|
||||||
|
while (obj->callbacks.free)
|
||||||
|
{
|
||||||
|
Evas_Func_Node *fn;
|
||||||
|
|
||||||
|
fn = (Evas_Func_Node *)obj->callbacks.free;
|
||||||
|
obj->callbacks.free = evas_object_list_remove(obj->callbacks.free, fn);
|
||||||
|
free(fn);
|
||||||
|
}
|
||||||
|
while (obj->data.elements)
|
||||||
|
{
|
||||||
|
Evas_Data_Node *node;
|
||||||
|
|
||||||
|
node = obj->data.elements->data;
|
||||||
|
obj->data.elements = evas_list_remove(obj->data.elements, node);
|
||||||
|
free(node->key);
|
||||||
|
free(node);
|
||||||
|
}
|
||||||
|
obj->magic = 0;
|
||||||
|
free(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_change(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_List *l;
|
||||||
|
|
||||||
|
if (obj->smart.smart) return;
|
||||||
|
if (!((obj->cur.visible != obj->prev.visible) || (obj->cur.visible)))
|
||||||
|
return;
|
||||||
|
if (obj->changed) return;
|
||||||
|
obj->changed = 1;
|
||||||
|
obj->layer->evas->changed = 1;
|
||||||
|
/* set changed flag on all objects this one clips too */
|
||||||
|
for (l = obj->clip.clipees; l; l = l->next)
|
||||||
|
{
|
||||||
|
Evas_Object *o;
|
||||||
|
|
||||||
|
o = (Evas_Object *)l->data;
|
||||||
|
evas_object_change(o);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_List *
|
||||||
|
evas_object_render_pre_visible_change(Evas_List *updates, Evas_Object *obj, int is_v, int was_v)
|
||||||
|
{
|
||||||
|
Evas_Rectangle *r;
|
||||||
|
|
||||||
|
if (obj->smart.smart) return updates;
|
||||||
|
if (is_v == was_v) return updates;
|
||||||
|
if (is_v)
|
||||||
|
{
|
||||||
|
NEW_RECT(r,
|
||||||
|
obj->cur.cache.clip.x,
|
||||||
|
obj->cur.cache.clip.y,
|
||||||
|
obj->cur.cache.clip.w,
|
||||||
|
obj->cur.cache.clip.h);
|
||||||
|
if (r) updates = evas_list_append(updates, r);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NEW_RECT(r,
|
||||||
|
obj->prev.cache.clip.x,
|
||||||
|
obj->prev.cache.clip.y,
|
||||||
|
obj->prev.cache.clip.w,
|
||||||
|
obj->prev.cache.clip.h);
|
||||||
|
if (r) updates = evas_list_append(updates, r);
|
||||||
|
}
|
||||||
|
return updates;
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_List *
|
||||||
|
evas_object_render_pre_clipper_change(Evas_List *updates, Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Rectangle *r;
|
||||||
|
Evas_List *rl;
|
||||||
|
|
||||||
|
if (obj->smart.smart) return updates;
|
||||||
|
if (obj->cur.clipper == obj->prev.clipper) return updates;
|
||||||
|
if ((obj->cur.clipper) && (obj->prev.clipper))
|
||||||
|
{
|
||||||
|
/* get difference rects between clippers */
|
||||||
|
rl = evas_rects_return_difference_rects(obj->cur.clipper->cur.cache.clip.x,
|
||||||
|
obj->cur.clipper->cur.cache.clip.y,
|
||||||
|
obj->cur.clipper->cur.cache.clip.w,
|
||||||
|
obj->cur.clipper->cur.cache.clip.h,
|
||||||
|
obj->prev.clipper->prev.cache.clip.x,
|
||||||
|
obj->prev.clipper->prev.cache.clip.y,
|
||||||
|
obj->prev.clipper->prev.cache.clip.w,
|
||||||
|
obj->prev.clipper->prev.cache.clip.h);
|
||||||
|
/* go thru every difference rect */
|
||||||
|
while (rl)
|
||||||
|
{
|
||||||
|
r = rl->data;
|
||||||
|
rl = evas_list_remove(rl, r);
|
||||||
|
updates = evas_list_append(updates, r);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (obj->cur.clipper)
|
||||||
|
{
|
||||||
|
rl = evas_rects_return_difference_rects(obj->cur.cache.geometry.x,
|
||||||
|
obj->cur.cache.geometry.y,
|
||||||
|
obj->cur.cache.geometry.w,
|
||||||
|
obj->cur.cache.geometry.h,
|
||||||
|
obj->cur.clipper->cur.cache.clip.x,
|
||||||
|
obj->cur.clipper->cur.cache.clip.y,
|
||||||
|
obj->cur.clipper->cur.cache.clip.w,
|
||||||
|
obj->cur.clipper->cur.cache.clip.h);
|
||||||
|
while (rl)
|
||||||
|
{
|
||||||
|
r = rl->data;
|
||||||
|
rl = evas_list_remove(rl, r);
|
||||||
|
updates = evas_list_append(updates, r);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (obj->prev.clipper)
|
||||||
|
{
|
||||||
|
rl = evas_rects_return_difference_rects(obj->prev.cache.geometry.x,
|
||||||
|
obj->prev.cache.geometry.y,
|
||||||
|
obj->prev.cache.geometry.w,
|
||||||
|
obj->prev.cache.geometry.h,
|
||||||
|
obj->prev.clipper->prev.cache.clip.x,
|
||||||
|
obj->prev.clipper->prev.cache.clip.y,
|
||||||
|
obj->prev.clipper->prev.cache.clip.w,
|
||||||
|
obj->prev.clipper->prev.cache.clip.h);
|
||||||
|
while (rl)
|
||||||
|
{
|
||||||
|
r = rl->data;
|
||||||
|
rl = evas_list_remove(rl, r);
|
||||||
|
updates = evas_list_append(updates, r);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return updates;
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_List *
|
||||||
|
evas_object_render_pre_prev_cur_add(Evas_List *updates, Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Rectangle *r;
|
||||||
|
|
||||||
|
NEW_RECT(r,
|
||||||
|
obj->cur.cache.geometry.x,
|
||||||
|
obj->cur.cache.geometry.y,
|
||||||
|
obj->cur.cache.geometry.w,
|
||||||
|
obj->cur.cache.geometry.h);
|
||||||
|
if (r) updates = evas_list_append(updates, r);
|
||||||
|
NEW_RECT(r,
|
||||||
|
obj->prev.cache.geometry.x,
|
||||||
|
obj->prev.cache.geometry.y,
|
||||||
|
obj->prev.cache.geometry.w,
|
||||||
|
obj->prev.cache.geometry.h);
|
||||||
|
if (r) updates = evas_list_append(updates, r);
|
||||||
|
return updates;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_render_pre_effect_updates(Evas_List *updates, Evas_Object *obj, int is_v, int was_v)
|
||||||
|
{
|
||||||
|
Evas_Rectangle *r;
|
||||||
|
int x, y, w, h;
|
||||||
|
Evas_Object *clipper;
|
||||||
|
Evas_List *l;
|
||||||
|
|
||||||
|
if (obj->smart.smart) return;
|
||||||
|
/* FIXME: was_v isn't used... why? */
|
||||||
|
was_v = 0;
|
||||||
|
if (!obj->clip.clipees)
|
||||||
|
{
|
||||||
|
while (updates)
|
||||||
|
{
|
||||||
|
r = (Evas_Rectangle *)(updates->data);
|
||||||
|
updates = evas_list_remove(updates, r);
|
||||||
|
/* get updates and clip to current clip */
|
||||||
|
x = r->x; y = r->y; w = r->w; h = r->h;
|
||||||
|
RECTS_CLIP_TO_RECT(x, y, w, h,
|
||||||
|
obj->cur.cache.clip.x,
|
||||||
|
obj->cur.cache.clip.y,
|
||||||
|
obj->cur.cache.clip.w,
|
||||||
|
obj->cur.cache.clip.h);
|
||||||
|
if ((w > 0) && (h > 0))
|
||||||
|
obj->layer->evas->engine.func->output_redraws_rect_add(obj->layer->evas->engine.data.output,
|
||||||
|
x, y, w, h);
|
||||||
|
/* get updates and clip to previous clip */
|
||||||
|
x = r->x; y = r->y; w = r->w; h = r->h;
|
||||||
|
RECTS_CLIP_TO_RECT(x, y, w, h,
|
||||||
|
obj->prev.cache.clip.x,
|
||||||
|
obj->prev.cache.clip.y,
|
||||||
|
obj->prev.cache.clip.w,
|
||||||
|
obj->prev.cache.clip.h);
|
||||||
|
if ((w > 0) && (h > 0))
|
||||||
|
obj->layer->evas->engine.func->output_redraws_rect_add(obj->layer->evas->engine.data.output,
|
||||||
|
x, y, w, h);
|
||||||
|
free(r);
|
||||||
|
r = NULL;
|
||||||
|
}
|
||||||
|
/* if the object is actually visible, take any parent clip changes */
|
||||||
|
if (is_v)
|
||||||
|
{
|
||||||
|
clipper = obj->cur.clipper;
|
||||||
|
while (clipper)
|
||||||
|
{
|
||||||
|
for (l = clipper->clip.changes; l; l = l->next)
|
||||||
|
{
|
||||||
|
r = (Evas_Rectangle *)(l->data);
|
||||||
|
/* get updates and clip to current clip */
|
||||||
|
x = r->x; y = r->y; w = r->w; h = r->h;
|
||||||
|
RECTS_CLIP_TO_RECT(x, y, w, h,
|
||||||
|
obj->cur.cache.clip.x,
|
||||||
|
obj->cur.cache.clip.y,
|
||||||
|
obj->cur.cache.clip.w,
|
||||||
|
obj->cur.cache.clip.h);
|
||||||
|
if ((w > 0) && (h > 0))
|
||||||
|
obj->layer->evas->engine.func->output_redraws_rect_add(obj->layer->evas->engine.data.output,
|
||||||
|
x, y, w, h);
|
||||||
|
/* get updates and clip to previous clip */
|
||||||
|
x = r->x; y = r->y; w = r->w; h = r->h;
|
||||||
|
RECTS_CLIP_TO_RECT(x, y, w, h,
|
||||||
|
obj->prev.cache.clip.x,
|
||||||
|
obj->prev.cache.clip.y,
|
||||||
|
obj->prev.cache.clip.w,
|
||||||
|
obj->prev.cache.clip.h);
|
||||||
|
if ((w > 0) && (h > 0))
|
||||||
|
obj->layer->evas->engine.func->output_redraws_rect_add(obj->layer->evas->engine.data.output,
|
||||||
|
x, y, w, h);
|
||||||
|
}
|
||||||
|
clipper = clipper->cur.clipper;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while (obj->clip.changes)
|
||||||
|
{
|
||||||
|
free(obj->clip.changes->data);
|
||||||
|
obj->clip.changes = evas_list_remove(obj->clip.changes, obj->clip.changes->data);
|
||||||
|
}
|
||||||
|
obj->clip.changes = updates;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_coords_recalc(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
if (obj->smart.smart) return;
|
||||||
|
if (obj->cur.cache.geometry.validity == obj->layer->evas->output_validity)
|
||||||
|
return;
|
||||||
|
obj->cur.cache.geometry.x =
|
||||||
|
evas_coord_world_x_to_screen(obj->layer->evas, obj->cur.geometry.x);
|
||||||
|
obj->cur.cache.geometry.y =
|
||||||
|
evas_coord_world_y_to_screen(obj->layer->evas, obj->cur.geometry.y);
|
||||||
|
obj->cur.cache.geometry.w =
|
||||||
|
evas_coord_world_x_to_screen(obj->layer->evas,
|
||||||
|
obj->cur.geometry.x + obj->cur.geometry.w)
|
||||||
|
- obj->cur.cache.geometry.x;
|
||||||
|
obj->cur.cache.geometry.h =
|
||||||
|
evas_coord_world_x_to_screen(obj->layer->evas,
|
||||||
|
obj->cur.geometry.y + obj->cur.geometry.h)
|
||||||
|
- obj->cur.cache.geometry.y;
|
||||||
|
if (obj->func->coords_recalc) obj->func->coords_recalc(obj);
|
||||||
|
obj->cur.cache.geometry.validity = obj->layer->evas->output_validity;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
evas_object_is_active(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
if (obj->smart.smart) return 0;
|
||||||
|
if ((evas_object_is_in_output_rect(obj, 0, 0,
|
||||||
|
obj->layer->evas->output.w,
|
||||||
|
obj->layer->evas->output.h) ||
|
||||||
|
evas_object_was_in_output_rect(obj, 0, 0,
|
||||||
|
obj->layer->evas->output.w,
|
||||||
|
obj->layer->evas->output.h)) &&
|
||||||
|
(evas_object_is_visible(obj) ||
|
||||||
|
evas_object_was_visible(obj)))
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
evas_object_is_in_output_rect(Evas_Object *obj, int x, int y, int w, int h)
|
||||||
|
{
|
||||||
|
if (obj->smart.smart) return 0;
|
||||||
|
/* assumes coords have been recalced */
|
||||||
|
if ((RECTS_INTERSECT(x, y, w, h,
|
||||||
|
obj->cur.cache.clip.x,
|
||||||
|
obj->cur.cache.clip.y,
|
||||||
|
obj->cur.cache.clip.w,
|
||||||
|
obj->cur.cache.clip.h)))
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
evas_object_was_in_output_rect(Evas_Object *obj, int x, int y, int w, int h)
|
||||||
|
{
|
||||||
|
if (obj->smart.smart) return 0;
|
||||||
|
/* assumes coords have been recalced */
|
||||||
|
if ((RECTS_INTERSECT(x, y, w, h,
|
||||||
|
obj->prev.cache.clip.x,
|
||||||
|
obj->prev.cache.clip.y,
|
||||||
|
obj->prev.cache.clip.w,
|
||||||
|
obj->prev.cache.clip.h)))
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
evas_object_is_visible(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
if (obj->smart.smart) return 0;
|
||||||
|
if ((obj->cur.visible) &&
|
||||||
|
(obj->cur.cache.clip.visible) &&
|
||||||
|
(obj->cur.cache.clip.a > 0))
|
||||||
|
{
|
||||||
|
if (obj->func->is_visible)
|
||||||
|
return obj->func->is_visible(obj);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
evas_object_was_visible(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
if (obj->smart.smart) return 0;
|
||||||
|
if ((obj->prev.visible) &&
|
||||||
|
(obj->prev.cache.clip.visible) &&
|
||||||
|
(obj->prev.cache.clip.a > 0))
|
||||||
|
{
|
||||||
|
if (obj->func->was_visible)
|
||||||
|
return obj->func->was_visible(obj);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
evas_object_is_opaque(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
if (obj->smart.smart) return 0;
|
||||||
|
if (obj->cur.cache.clip.a == 255)
|
||||||
|
{
|
||||||
|
if (obj->func->is_opaque)
|
||||||
|
return obj->func->is_opaque(obj);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
evas_object_was_opaque(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
if (obj->smart.smart) return 0;
|
||||||
|
if (obj->prev.cache.clip.a == 255)
|
||||||
|
{
|
||||||
|
if (obj->func->was_opaque)
|
||||||
|
return obj->func->was_opaque(obj);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* routines apps will call */
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_del(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (!obj->layer)
|
||||||
|
{
|
||||||
|
evas_object_free(obj, 1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
evas_object_hide(obj);
|
||||||
|
while (obj->clip.clipees) evas_object_clip_unset(obj->clip.clipees->data);
|
||||||
|
if (obj->cur.clipper) evas_object_clip_unset(obj);
|
||||||
|
evas_object_change(obj);
|
||||||
|
obj->delete_me = 1;
|
||||||
|
if (obj->smart.smart) evas_object_smart_del(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_move(Evas_Object *obj, double x, double y)
|
||||||
|
{
|
||||||
|
int is, was;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (obj->smart.smart)
|
||||||
|
{
|
||||||
|
if (obj->smart.smart->func_move)
|
||||||
|
obj->smart.smart->func_move(obj, x, y);
|
||||||
|
}
|
||||||
|
if ((obj->cur.geometry.x == x) &&
|
||||||
|
(obj->cur.geometry.y == y)) return;
|
||||||
|
was = evas_object_is_in_output_rect(obj,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y, 1, 1);
|
||||||
|
obj->cur.geometry.x = x;
|
||||||
|
obj->cur.geometry.y = y;
|
||||||
|
obj->cur.cache.geometry.validity = 0;
|
||||||
|
evas_object_change(obj);
|
||||||
|
evas_object_recalc_clippees(obj);
|
||||||
|
if (!obj->smart.smart)
|
||||||
|
{
|
||||||
|
is = evas_object_is_in_output_rect(obj,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y, 1, 1);
|
||||||
|
if ((is ^ was) && obj->cur.visible)
|
||||||
|
evas_event_feed_mouse_move(obj->layer->evas,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_resize(Evas_Object *obj, double w, double h)
|
||||||
|
{
|
||||||
|
int is, was;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (w < 0.0) w = 0.0; if (h < 0.0) h = 0.0;
|
||||||
|
if (obj->smart.smart)
|
||||||
|
{
|
||||||
|
if (obj->smart.smart->func_resize)
|
||||||
|
obj->smart.smart->func_resize(obj, w, h);
|
||||||
|
}
|
||||||
|
if ((obj->cur.geometry.w == w) &&
|
||||||
|
(obj->cur.geometry.h == h)) return;
|
||||||
|
was = evas_object_is_in_output_rect(obj,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y, 1, 1);
|
||||||
|
obj->cur.geometry.w = w;
|
||||||
|
obj->cur.geometry.h = h;
|
||||||
|
obj->cur.cache.geometry.validity = 0;
|
||||||
|
evas_object_change(obj);
|
||||||
|
evas_object_recalc_clippees(obj);
|
||||||
|
if (!obj->smart.smart)
|
||||||
|
{
|
||||||
|
is = evas_object_is_in_output_rect(obj,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y, 1, 1);
|
||||||
|
if ((is ^ was) && (obj->cur.visible))
|
||||||
|
evas_event_feed_mouse_move(obj->layer->evas,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_geometry_get(Evas_Object *obj, double *x, double *y, double *w, double *h)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
if (x) *x = 0; if (y) *y = 0; if (w) *w = 0; if (h) *h = 0;
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (x) *x = obj->cur.geometry.x;
|
||||||
|
if (y) *y = obj->cur.geometry.y;
|
||||||
|
if (w) *w = obj->cur.geometry.w;
|
||||||
|
if (h) *h = obj->cur.geometry.h;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_show(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (obj->smart.smart)
|
||||||
|
{
|
||||||
|
if (obj->smart.smart->func_show)
|
||||||
|
obj->smart.smart->func_show(obj);
|
||||||
|
}
|
||||||
|
if (obj->cur.visible) return;
|
||||||
|
obj->cur.visible = 1;
|
||||||
|
evas_object_change(obj);
|
||||||
|
evas_object_recalc_clippees(obj);
|
||||||
|
if (!obj->smart.smart)
|
||||||
|
{
|
||||||
|
if (evas_object_is_in_output_rect(obj,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y, 1, 1))
|
||||||
|
evas_event_feed_mouse_move(obj->layer->evas,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_hide(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (obj->smart.smart)
|
||||||
|
{
|
||||||
|
if (obj->smart.smart->func_hide)
|
||||||
|
obj->smart.smart->func_hide(obj);
|
||||||
|
}
|
||||||
|
if (!obj->cur.visible) return;
|
||||||
|
obj->cur.visible = 0;
|
||||||
|
evas_object_change(obj);
|
||||||
|
evas_object_recalc_clippees(obj);
|
||||||
|
if (!obj->smart.smart)
|
||||||
|
{
|
||||||
|
if (evas_object_is_in_output_rect(obj,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y, 1, 1))
|
||||||
|
evas_event_feed_mouse_move(obj->layer->evas,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y);
|
||||||
|
/* if ((obj->mouse_in) || (obj->mouse_grabbed)) */
|
||||||
|
{
|
||||||
|
obj->mouse_in = 0;
|
||||||
|
obj->mouse_grabbed = 0;
|
||||||
|
obj->layer->evas->pointer.object.in = evas_list_remove(obj->layer->evas->pointer.object.in, obj);
|
||||||
|
if (obj->layer->evas->events_frozen > 0) return;
|
||||||
|
if (obj->mouse_in)
|
||||||
|
{
|
||||||
|
Evas_Event_Mouse_Out ev;
|
||||||
|
|
||||||
|
ev.buttons = obj->layer->evas->pointer.button;
|
||||||
|
ev.output.x = obj->layer->evas->pointer.x;
|
||||||
|
ev.output.y = obj->layer->evas->pointer.y;
|
||||||
|
ev.canvas.x = obj->layer->evas->pointer.canvas_x;
|
||||||
|
ev.canvas.y = obj->layer->evas->pointer.canvas_y;
|
||||||
|
ev.data = NULL;
|
||||||
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
evas_object_visible_get(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return obj->cur.visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_color_set(Evas_Object *obj, int r, int g, int b, int a)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (r > 255) r = 255; if (r < 0) r = 0;
|
||||||
|
if (g > 255) g = 255; if (g < 0) g = 0;
|
||||||
|
if (b > 255) b = 255; if (b < 0) b = 0;
|
||||||
|
if (a > 255) a = 255; if (a < 0) a = 0;
|
||||||
|
if (obj->smart.smart)
|
||||||
|
{
|
||||||
|
if (obj->smart.smart->func_color_set)
|
||||||
|
obj->smart.smart->func_color_set(obj, r, g, b, a);
|
||||||
|
}
|
||||||
|
if ((obj->cur.color.r == r) &&
|
||||||
|
(obj->cur.color.g == g) &&
|
||||||
|
(obj->cur.color.b == b) &&
|
||||||
|
(obj->cur.color.a == a)) return;
|
||||||
|
obj->cur.color.r = r;
|
||||||
|
obj->cur.color.g = g;
|
||||||
|
obj->cur.color.b = b;
|
||||||
|
obj->cur.color.a = a;
|
||||||
|
if ((obj->cur.color.a == 0) && (a == 0)) return;
|
||||||
|
evas_object_change(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_color_get(Evas_Object *obj, int *r, int *g, int *b, int *a)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
if (r) *r = 0; if (g) *g = 0; if (b) *b = 0; if (a) *a = 0;
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (r) *r = obj->cur.color.r;
|
||||||
|
if (g) *g = obj->cur.color.g;
|
||||||
|
if (b) *b = obj->cur.color.b;
|
||||||
|
if (a) *a = obj->cur.color.a;
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas *
|
||||||
|
evas_object_evas_get(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return obj->layer->evas;
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_Object *
|
||||||
|
evas_object_top_at_xy_get(Evas *e, double x, double y, int include_pass_events_objects, int include_hidden_objects)
|
||||||
|
{
|
||||||
|
Evas_Object_List *l;
|
||||||
|
int xx, yy;
|
||||||
|
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
xx = evas_coord_world_x_to_screen(e, x);
|
||||||
|
yy = evas_coord_world_y_to_screen(e, y);
|
||||||
|
for (l = ((Evas_Object_List *)(e->layers))->last; l; l = l->prev)
|
||||||
|
{
|
||||||
|
Evas_Object_List *l2;
|
||||||
|
Evas_Layer *lay;
|
||||||
|
|
||||||
|
lay = (Evas_Layer *)l;
|
||||||
|
for (l2 = ((Evas_Object_List *)(lay->objects))->last; l2; l2 = l2->prev)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
|
||||||
|
obj = (Evas_Object *)l2;
|
||||||
|
if ((!include_pass_events_objects) && (obj->pass_events)) continue;
|
||||||
|
if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
|
||||||
|
evas_object_clip_recalc(obj);
|
||||||
|
if ((evas_object_is_in_output_rect(obj, xx, yy, 1, 1)) &&
|
||||||
|
(!obj->clip.clipees))
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_Object *
|
||||||
|
evas_object_top_at_pointer_get(Evas *e)
|
||||||
|
{
|
||||||
|
return evas_object_top_at_xy_get(e, e->pointer.canvas_x, e->pointer.canvas_y, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_Object *
|
||||||
|
evas_object_top_in_rectangle_get(Evas *e, double x, double y, double w, double h, int include_pass_events_objects, int include_hidden_objects)
|
||||||
|
{
|
||||||
|
Evas_Object_List *l;
|
||||||
|
int xx, yy, ww, hh;
|
||||||
|
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
xx = evas_coord_world_x_to_screen(e, x);
|
||||||
|
yy = evas_coord_world_y_to_screen(e, y);
|
||||||
|
ww = evas_coord_world_x_to_screen(e, w);
|
||||||
|
hh = evas_coord_world_y_to_screen(e, h);
|
||||||
|
if (ww < 1) ww = 1;
|
||||||
|
if (hh < 1) hh = 1;
|
||||||
|
for (l = ((Evas_Object_List *)(e->layers))->last; l; l = l->prev)
|
||||||
|
{
|
||||||
|
Evas_Object_List *l2;
|
||||||
|
Evas_Layer *lay;
|
||||||
|
|
||||||
|
lay = (Evas_Layer *)l;
|
||||||
|
for (l2 = ((Evas_Object_List *)(lay->objects))->last; l2; l2 = l2->prev)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
|
||||||
|
obj = (Evas_Object *)l2;
|
||||||
|
if ((!include_pass_events_objects) && (obj->pass_events)) continue;
|
||||||
|
if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
|
||||||
|
evas_object_clip_recalc(obj);
|
||||||
|
if ((evas_object_is_in_output_rect(obj, xx, yy, ww, hh)) &&
|
||||||
|
(!obj->clip.clipees))
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_List *
|
||||||
|
evas_objects_at_xy_get(Evas *e, double x, double y, int include_pass_events_objects, int include_hidden_objects)
|
||||||
|
{
|
||||||
|
Evas_List *in = NULL;
|
||||||
|
Evas_Object_List *l;
|
||||||
|
int xx, yy;
|
||||||
|
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
xx = evas_coord_world_x_to_screen(e, x);
|
||||||
|
yy = evas_coord_world_y_to_screen(e, y);
|
||||||
|
for (l = ((Evas_Object_List *)(e->layers))->last; l; l = l->prev)
|
||||||
|
{
|
||||||
|
Evas_Object_List *l2;
|
||||||
|
Evas_Layer *lay;
|
||||||
|
|
||||||
|
lay = (Evas_Layer *)l;
|
||||||
|
for (l2 = ((Evas_Object_List *)(lay->objects))->last; l2; l2 = l2->prev)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
|
||||||
|
obj = (Evas_Object *)l2;
|
||||||
|
if ((!include_pass_events_objects) && (obj->pass_events)) continue;
|
||||||
|
if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
|
||||||
|
evas_object_clip_recalc(obj);
|
||||||
|
if ((evas_object_is_in_output_rect(obj, xx, yy, 1, 1)) &&
|
||||||
|
(!obj->clip.clipees))
|
||||||
|
in = evas_list_prepend(in, obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return in;
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_List *
|
||||||
|
evas_objects_in_rectangle_get(Evas *e, double x, double y, double w, double h, int include_pass_events_objects, int include_hidden_objects)
|
||||||
|
{
|
||||||
|
Evas_List *in = NULL;
|
||||||
|
Evas_Object_List *l;
|
||||||
|
int xx, yy, ww, hh;
|
||||||
|
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
xx = evas_coord_world_x_to_screen(e, x);
|
||||||
|
yy = evas_coord_world_y_to_screen(e, y);
|
||||||
|
ww = evas_coord_world_x_to_screen(e, w);
|
||||||
|
hh = evas_coord_world_y_to_screen(e, h);
|
||||||
|
if (ww < 1) ww = 1;
|
||||||
|
if (hh < 1) hh = 1;
|
||||||
|
for (l = ((Evas_Object_List *)(e->layers))->last; l; l = l->prev)
|
||||||
|
{
|
||||||
|
Evas_Object_List *l2;
|
||||||
|
Evas_Layer *lay;
|
||||||
|
|
||||||
|
lay = (Evas_Layer *)l;
|
||||||
|
for (l2 = ((Evas_Object_List *)(lay->objects))->last; l2; l2 = l2->prev)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
|
||||||
|
obj = (Evas_Object *)l2;
|
||||||
|
if ((!include_pass_events_objects) && (obj->pass_events)) continue;
|
||||||
|
if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
|
||||||
|
evas_object_clip_recalc(obj);
|
||||||
|
if ((evas_object_is_in_output_rect(obj, xx, yy, ww, hh)) &&
|
||||||
|
(!obj->clip.clipees))
|
||||||
|
in = evas_list_prepend(in, obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return in;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *
|
||||||
|
evas_object_type_get(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return obj->type;
|
||||||
|
}
|
|
@ -0,0 +1,407 @@
|
||||||
|
#include "evas_common.h"
|
||||||
|
#include "evas_private.h"
|
||||||
|
#include "Evas.h"
|
||||||
|
|
||||||
|
/* private magic number for polygon objects */
|
||||||
|
static const char o_type[] = "polygon";
|
||||||
|
|
||||||
|
/* private struct for line object internal data */
|
||||||
|
typedef struct _Evas_Object_Polygon Evas_Object_Polygon;
|
||||||
|
typedef struct _Evas_Polygon_Point Evas_Polygon_Point;
|
||||||
|
|
||||||
|
struct _Evas_Object_Polygon
|
||||||
|
{
|
||||||
|
DATA32 magic;
|
||||||
|
int changed : 1;
|
||||||
|
Evas_List *points;
|
||||||
|
|
||||||
|
void *engine_data;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Evas_Polygon_Point
|
||||||
|
{
|
||||||
|
double x, y;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* private methods for polygon objects */
|
||||||
|
static void evas_object_polygon_init(Evas_Object *obj);
|
||||||
|
static void *evas_object_polygon_new(void);
|
||||||
|
static void evas_object_polygon_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y);
|
||||||
|
static void evas_object_polygon_free(Evas_Object *obj);
|
||||||
|
static void evas_object_polygon_render_pre(Evas_Object *obj);
|
||||||
|
static void evas_object_polygon_render_post(Evas_Object *obj);
|
||||||
|
|
||||||
|
static int evas_object_polygon_is_opaque(Evas_Object *obj);
|
||||||
|
static int evas_object_polygon_was_opaque(Evas_Object *obj);
|
||||||
|
static int evas_object_polygon_is_inside(Evas_Object *obj, double x, double y);
|
||||||
|
static int evas_object_polygon_was_inside(Evas_Object *obj, double x, double y);
|
||||||
|
|
||||||
|
static Evas_Object_Func object_func =
|
||||||
|
{
|
||||||
|
/* methods (compulsory) */
|
||||||
|
evas_object_polygon_free,
|
||||||
|
evas_object_polygon_render,
|
||||||
|
evas_object_polygon_render_pre,
|
||||||
|
evas_object_polygon_render_post,
|
||||||
|
/* these are optional. NULL = nothing */
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
evas_object_polygon_is_opaque,
|
||||||
|
evas_object_polygon_was_opaque,
|
||||||
|
evas_object_polygon_is_inside,
|
||||||
|
evas_object_polygon_was_inside,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
/* the actual api call to add a rect */
|
||||||
|
/* it has no other api calls as all properties are standard */
|
||||||
|
Evas_Object *
|
||||||
|
evas_object_polygon_add(Evas *e)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
obj = evas_object_new();
|
||||||
|
evas_object_polygon_init(obj);
|
||||||
|
evas_object_inject(obj, e);
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_polygon_point_add(Evas_Object *obj, double x, double y)
|
||||||
|
{
|
||||||
|
Evas_Object_Polygon *o;
|
||||||
|
Evas_Polygon_Point *p;
|
||||||
|
double min_x, max_x, min_y, max_y;
|
||||||
|
int is, was;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Polygon *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Polygon, MAGIC_OBJ_POLYGON);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
was = evas_object_is_in_output_rect(obj,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y, 1, 1);
|
||||||
|
p = malloc(sizeof(Evas_Polygon_Point));
|
||||||
|
if (!p) return;
|
||||||
|
p->x = x;
|
||||||
|
p->y = y;
|
||||||
|
|
||||||
|
if (!o->points)
|
||||||
|
{
|
||||||
|
obj->cur.geometry.x = p->x;
|
||||||
|
obj->cur.geometry.y = p->y;
|
||||||
|
obj->cur.geometry.w = 2.0;
|
||||||
|
obj->cur.geometry.h = 2.0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (x < obj->cur.geometry.x) min_x = x;
|
||||||
|
else min_x = obj->cur.geometry.x;
|
||||||
|
if (x > (obj->cur.geometry.x + obj->cur.geometry.w - 2.0)) max_x = x;
|
||||||
|
else max_x = obj->cur.geometry.x + obj->cur.geometry.w - 2.0;
|
||||||
|
if (y < obj->cur.geometry.y) min_y = y;
|
||||||
|
else min_y = obj->cur.geometry.y;
|
||||||
|
if (y > (obj->cur.geometry.y + obj->cur.geometry.h - 2.0)) max_y = y;
|
||||||
|
else max_y = obj->cur.geometry.y + obj->cur.geometry.h - 2.0;
|
||||||
|
obj->cur.geometry.x = min_x;
|
||||||
|
obj->cur.geometry.y = min_y;
|
||||||
|
obj->cur.geometry.w = max_x - min_x + 2.0;
|
||||||
|
obj->cur.geometry.h = max_y - min_y + 2.0;
|
||||||
|
}
|
||||||
|
o->points = evas_list_append(o->points, p);
|
||||||
|
|
||||||
|
obj->cur.cache.geometry.validity = 0;
|
||||||
|
o->changed = 1;
|
||||||
|
evas_object_change(obj);
|
||||||
|
evas_object_coords_recalc(obj);
|
||||||
|
is = evas_object_is_in_output_rect(obj,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y, 1, 1);
|
||||||
|
if ((is ^ was) && obj->cur.visible)
|
||||||
|
evas_event_feed_mouse_move(obj->layer->evas,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_polygon_points_clear(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Polygon *o;
|
||||||
|
int is, was;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Polygon *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Polygon, MAGIC_OBJ_POLYGON);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
was = evas_object_is_in_output_rect(obj,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y, 1, 1);
|
||||||
|
while (o->points)
|
||||||
|
{
|
||||||
|
free(o->points->data);
|
||||||
|
o->points = evas_list_remove(o->points, o->points->data);
|
||||||
|
}
|
||||||
|
obj->cur.geometry.w = 0;
|
||||||
|
obj->cur.geometry.h = 0;
|
||||||
|
obj->cur.cache.geometry.validity = 0;
|
||||||
|
o->changed = 1;
|
||||||
|
evas_object_change(obj);
|
||||||
|
evas_object_coords_recalc(obj);
|
||||||
|
is = evas_object_is_in_output_rect(obj,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y, 1, 1);
|
||||||
|
if ((is || was) && obj->cur.visible)
|
||||||
|
evas_event_feed_mouse_move(obj->layer->evas,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* all nice and private */
|
||||||
|
static void
|
||||||
|
evas_object_polygon_init(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
/* alloc image ob, setup methods and default values */
|
||||||
|
obj->object_data = evas_object_polygon_new();
|
||||||
|
/* set up default settings for this kind of object */
|
||||||
|
obj->cur.color.r = 255;
|
||||||
|
obj->cur.color.g = 255;
|
||||||
|
obj->cur.color.b = 255;
|
||||||
|
obj->cur.color.a = 255;
|
||||||
|
obj->cur.geometry.x = 0.0;
|
||||||
|
obj->cur.geometry.y = 0.0;
|
||||||
|
obj->cur.geometry.w = 0.0;
|
||||||
|
obj->cur.geometry.h = 0.0;
|
||||||
|
obj->cur.layer = 0;
|
||||||
|
/* set up object-specific settings */
|
||||||
|
obj->prev = obj->cur;
|
||||||
|
/* set up methods (compulsory) */
|
||||||
|
obj->func = &object_func;
|
||||||
|
obj->type = o_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void *
|
||||||
|
evas_object_polygon_new(void)
|
||||||
|
{
|
||||||
|
Evas_Object_Polygon *o;
|
||||||
|
|
||||||
|
/* alloc obj private data */
|
||||||
|
o = calloc(1, sizeof(Evas_Object_Polygon));
|
||||||
|
o->magic = MAGIC_OBJ_POLYGON;
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_object_polygon_free(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Polygon *o;
|
||||||
|
|
||||||
|
/* frees private object data. very simple here */
|
||||||
|
o = (Evas_Object_Polygon *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Polygon, MAGIC_OBJ_POLYGON);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
/* free obj */
|
||||||
|
while (o->points)
|
||||||
|
{
|
||||||
|
free(o->points->data);
|
||||||
|
o->points = evas_list_remove(o->points, o->points->data);
|
||||||
|
}
|
||||||
|
o->engine_data = obj->layer->evas->engine.func->polygon_points_clear(obj->layer->evas->engine.data.output,
|
||||||
|
obj->layer->evas->engine.data.context,
|
||||||
|
o->engine_data);
|
||||||
|
o->magic = 0;
|
||||||
|
free(o);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_object_polygon_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y)
|
||||||
|
{
|
||||||
|
Evas_Object_Polygon *o;
|
||||||
|
Evas_List *l;
|
||||||
|
|
||||||
|
/* render object to surface with context, and offxet by x,y */
|
||||||
|
o = (Evas_Object_Polygon *)(obj->object_data);
|
||||||
|
obj->layer->evas->engine.func->context_color_set(output,
|
||||||
|
context,
|
||||||
|
obj->cur.cache.clip.r,
|
||||||
|
obj->cur.cache.clip.g,
|
||||||
|
obj->cur.cache.clip.b,
|
||||||
|
obj->cur.cache.clip.a);
|
||||||
|
obj->layer->evas->engine.func->context_multiplier_unset(output,
|
||||||
|
context);
|
||||||
|
o->engine_data = obj->layer->evas->engine.func->polygon_points_clear(obj->layer->evas->engine.data.output,
|
||||||
|
obj->layer->evas->engine.data.context,
|
||||||
|
o->engine_data);
|
||||||
|
for (l = o->points; l; l = l->next)
|
||||||
|
{
|
||||||
|
Evas_Polygon_Point *p;
|
||||||
|
int px, py;
|
||||||
|
|
||||||
|
p = l->data;
|
||||||
|
px = evas_coord_world_x_to_screen(obj->layer->evas, p->x);
|
||||||
|
py = evas_coord_world_y_to_screen(obj->layer->evas, p->y);
|
||||||
|
o->engine_data = obj->layer->evas->engine.func->polygon_point_add(obj->layer->evas->engine.data.output,
|
||||||
|
obj->layer->evas->engine.data.context,
|
||||||
|
o->engine_data,
|
||||||
|
px + x, py + y);
|
||||||
|
}
|
||||||
|
if (o->engine_data)
|
||||||
|
obj->layer->evas->engine.func->polygon_draw(output,
|
||||||
|
context,
|
||||||
|
surface,
|
||||||
|
o->engine_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_object_polygon_render_pre(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_List *updates = NULL;
|
||||||
|
Evas_Object_Polygon *o;
|
||||||
|
int is_v, was_v;
|
||||||
|
|
||||||
|
/* dont pre-render the obj twice! */
|
||||||
|
if (obj->pre_render_done) return;
|
||||||
|
obj->pre_render_done = 1;
|
||||||
|
/* pre-render phase. this does anything an object needs to do just before */
|
||||||
|
/* rendering. this could mean loading the image data, retrieving it from */
|
||||||
|
/* elsewhere, decoding video etc. */
|
||||||
|
/* then when this is done the object needs to figure if it changed and */
|
||||||
|
/* if so what and where and add thr appropriate redraw lines */
|
||||||
|
o = (Evas_Object_Polygon *)(obj->object_data);
|
||||||
|
/* if someone is clipping this obj - go calculate the clipper */
|
||||||
|
if (obj->cur.clipper)
|
||||||
|
{
|
||||||
|
evas_object_clip_recalc(obj->cur.clipper);
|
||||||
|
obj->cur.clipper->func->render_pre(obj->cur.clipper);
|
||||||
|
}
|
||||||
|
/* now figure what changed and add draw rects */
|
||||||
|
/* if it just became visible or invisible */
|
||||||
|
is_v = evas_object_is_visible(obj);
|
||||||
|
was_v = evas_object_was_visible(obj);
|
||||||
|
if (is_v != was_v)
|
||||||
|
{
|
||||||
|
updates = evas_object_render_pre_visible_change(updates, obj, is_v, was_v);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
/* its not visible - we accounted for it appearing or not so just abort */
|
||||||
|
if (!is_v) goto done;
|
||||||
|
/* clipper changed this is in addition to anything else for obj */
|
||||||
|
updates = evas_object_render_pre_clipper_change(updates, obj);
|
||||||
|
/* if we restacked (layer or just within a layer) */
|
||||||
|
if (obj->restack)
|
||||||
|
{
|
||||||
|
updates = evas_object_render_pre_prev_cur_add(updates, obj);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
/* if it changed color */
|
||||||
|
if ((obj->cur.color.r != obj->prev.color.r) ||
|
||||||
|
(obj->cur.color.g != obj->prev.color.g) ||
|
||||||
|
(obj->cur.color.b != obj->prev.color.b) ||
|
||||||
|
(obj->cur.color.a != obj->prev.color.a))
|
||||||
|
{
|
||||||
|
updates = evas_object_render_pre_prev_cur_add(updates, obj);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
/* if it changed geometry - and obviously not visibility or color */
|
||||||
|
/* caluclate differences since we have a constant color fill */
|
||||||
|
/* we really only need to update the differences */
|
||||||
|
if ((obj->cur.geometry.x != obj->prev.geometry.x) ||
|
||||||
|
(obj->cur.geometry.y != obj->prev.geometry.y) ||
|
||||||
|
(obj->cur.geometry.w != obj->prev.geometry.w) ||
|
||||||
|
(obj->cur.geometry.h != obj->prev.geometry.h) ||
|
||||||
|
(o->changed))
|
||||||
|
{
|
||||||
|
updates = evas_object_render_pre_prev_cur_add(updates, obj);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
done:
|
||||||
|
evas_object_render_pre_effect_updates(updates, obj, is_v, was_v);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_object_polygon_render_post(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Polygon *o;
|
||||||
|
|
||||||
|
/* this moves the current data to the previous state parts of the object */
|
||||||
|
/* in whatever way is safest for the object. also if we don't need object */
|
||||||
|
/* data anymore we can free it if the object deems this is a good idea */
|
||||||
|
o = (Evas_Object_Polygon *)(obj->object_data);
|
||||||
|
/* remove those pesky changes */
|
||||||
|
while (obj->clip.changes)
|
||||||
|
{
|
||||||
|
Evas_Rectangle *r;
|
||||||
|
|
||||||
|
r = (Evas_Rectangle *)obj->clip.changes->data;
|
||||||
|
obj->clip.changes = evas_list_remove(obj->clip.changes, r);
|
||||||
|
free(r);
|
||||||
|
}
|
||||||
|
/* move cur to prev safely for object data */
|
||||||
|
obj->prev = obj->cur;
|
||||||
|
o->changed = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
evas_object_polygon_is_opaque(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Polygon *o;
|
||||||
|
|
||||||
|
/* this returns 1 if the internal object data implies that the object is */
|
||||||
|
/* currently fulyl opque over the entire line it occupies */
|
||||||
|
o = (Evas_Object_Polygon *)(obj->object_data);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
evas_object_polygon_was_opaque(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Polygon *o;
|
||||||
|
|
||||||
|
/* this returns 1 if the internal object data implies that the object was */
|
||||||
|
/* currently fulyl opque over the entire line it occupies */
|
||||||
|
o = (Evas_Object_Polygon *)(obj->object_data);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
evas_object_polygon_is_inside(Evas_Object *obj, double x, double y)
|
||||||
|
{
|
||||||
|
Evas_Object_Polygon *o;
|
||||||
|
|
||||||
|
/* this returns 1 if the canvas co-ordinates are inside the object based */
|
||||||
|
/* on object private data. not much use for rects, but for polys images */
|
||||||
|
/* and other complex objects it might be */
|
||||||
|
o = (Evas_Object_Polygon *)(obj->object_data);
|
||||||
|
return 1;
|
||||||
|
x = 0;
|
||||||
|
y = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
evas_object_polygon_was_inside(Evas_Object *obj, double x, double y)
|
||||||
|
{
|
||||||
|
Evas_Object_Polygon *o;
|
||||||
|
|
||||||
|
/* this returns 1 if the canvas co-ordinates were inside the object based */
|
||||||
|
/* on object private data. not much use for rects, but for polys images */
|
||||||
|
/* and other complex objects it might be */
|
||||||
|
o = (Evas_Object_Polygon *)(obj->object_data);
|
||||||
|
return 1;
|
||||||
|
x = 0;
|
||||||
|
y = 0;
|
||||||
|
}
|
|
@ -0,0 +1,346 @@
|
||||||
|
#include "evas_common.h"
|
||||||
|
#include "evas_private.h"
|
||||||
|
#include "Evas.h"
|
||||||
|
|
||||||
|
/* private magic number for rectangle objects */
|
||||||
|
static const char o_type[] = "rectangle";
|
||||||
|
|
||||||
|
/* private struct for rectangle object internal data */
|
||||||
|
typedef struct _Evas_Object_Rectangle Evas_Object_Rectangle;
|
||||||
|
|
||||||
|
struct _Evas_Object_Rectangle
|
||||||
|
{
|
||||||
|
DATA32 magic;
|
||||||
|
void *engine_data;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* private methods for rectangle objects */
|
||||||
|
static void evas_object_rectangle_init(Evas_Object *obj);
|
||||||
|
static void *evas_object_rectangle_new(void);
|
||||||
|
static void evas_object_rectangle_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y);
|
||||||
|
static void evas_object_rectangle_free(Evas_Object *obj);
|
||||||
|
static void evas_object_rectangle_render_pre(Evas_Object *obj);
|
||||||
|
static void evas_object_rectangle_render_post(Evas_Object *obj);
|
||||||
|
|
||||||
|
#if 0 /* usless calls for a rect object. much more useful for images etc. */
|
||||||
|
static void evas_object_rectangle_store(Evas_Object *obj);
|
||||||
|
static void evas_object_rectangle_unstore(Evas_Object *obj);
|
||||||
|
static int evas_object_rectangle_is_visible(Evas_Object *obj);
|
||||||
|
static int evas_object_rectangle_was_visible(Evas_Object *obj);
|
||||||
|
static int evas_object_rectangle_is_opaque(Evas_Object *obj);
|
||||||
|
static int evas_object_rectangle_was_opaque(Evas_Object *obj);
|
||||||
|
static int evas_object_rectangle_is_inside(Evas_Object *obj, double x, double y);
|
||||||
|
static int evas_object_rectangle_was_inside(Evas_Object *obj, double x, double y);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static Evas_Object_Func object_func =
|
||||||
|
{
|
||||||
|
/* methods (compulsory) */
|
||||||
|
evas_object_rectangle_free,
|
||||||
|
evas_object_rectangle_render,
|
||||||
|
evas_object_rectangle_render_pre,
|
||||||
|
evas_object_rectangle_render_post,
|
||||||
|
/* these are optional. NULL = nothing */
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
/* the actual api call to add a rect */
|
||||||
|
/* it has no other api calls as all properties are standard */
|
||||||
|
Evas_Object *
|
||||||
|
evas_object_rectangle_add(Evas *e)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
obj = evas_object_new();
|
||||||
|
evas_object_rectangle_init(obj);
|
||||||
|
evas_object_inject(obj, e);
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* all nice and private */
|
||||||
|
static void
|
||||||
|
evas_object_rectangle_init(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
/* alloc image ob, setup methods and default values */
|
||||||
|
obj->object_data = evas_object_rectangle_new();
|
||||||
|
/* set up default settings for this kind of object */
|
||||||
|
obj->cur.color.r = 255;
|
||||||
|
obj->cur.color.g = 255;
|
||||||
|
obj->cur.color.b = 255;
|
||||||
|
obj->cur.color.a = 255;
|
||||||
|
obj->cur.geometry.x = 0.0;
|
||||||
|
obj->cur.geometry.y = 0.0;
|
||||||
|
obj->cur.geometry.w = 32.0;
|
||||||
|
obj->cur.geometry.h = 32.0;
|
||||||
|
obj->cur.layer = 0;
|
||||||
|
/* set up object-specific settings */
|
||||||
|
obj->prev = obj->cur;
|
||||||
|
/* set up methods (compulsory) */
|
||||||
|
obj->func = &object_func;
|
||||||
|
obj->type = o_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void *
|
||||||
|
evas_object_rectangle_new(void)
|
||||||
|
{
|
||||||
|
Evas_Object_Rectangle *o;
|
||||||
|
|
||||||
|
/* alloc obj private data */
|
||||||
|
o = calloc(1, sizeof(Evas_Object_Rectangle));
|
||||||
|
o->magic = MAGIC_OBJ_RECTANGLE;
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_object_rectangle_free(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Rectangle *o;
|
||||||
|
|
||||||
|
/* frees private object data. very simple here */
|
||||||
|
o = (Evas_Object_Rectangle *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Rectangle, MAGIC_OBJ_RECTANGLE);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
/* free obj */
|
||||||
|
o->magic = 0;
|
||||||
|
free(o);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_object_rectangle_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y)
|
||||||
|
{
|
||||||
|
Evas_Object_Rectangle *o;
|
||||||
|
|
||||||
|
/* render object to surface with context, and offxet by x,y */
|
||||||
|
o = (Evas_Object_Rectangle *)(obj->object_data);
|
||||||
|
obj->layer->evas->engine.func->context_color_set(output,
|
||||||
|
context,
|
||||||
|
obj->cur.cache.clip.r,
|
||||||
|
obj->cur.cache.clip.g,
|
||||||
|
obj->cur.cache.clip.b,
|
||||||
|
obj->cur.cache.clip.a);
|
||||||
|
obj->layer->evas->engine.func->context_multiplier_unset(output,
|
||||||
|
context);
|
||||||
|
obj->layer->evas->engine.func->rectangle_draw(output,
|
||||||
|
context,
|
||||||
|
surface,
|
||||||
|
obj->cur.cache.geometry.x + x,
|
||||||
|
obj->cur.cache.geometry.y + y,
|
||||||
|
obj->cur.cache.geometry.w,
|
||||||
|
obj->cur.cache.geometry.h);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_object_rectangle_render_pre(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_List *updates = NULL;
|
||||||
|
Evas_Object_Rectangle *o;
|
||||||
|
int is_v, was_v;
|
||||||
|
|
||||||
|
/* dont pre-render the obj twice! */
|
||||||
|
if (obj->pre_render_done) return;
|
||||||
|
obj->pre_render_done = 1;
|
||||||
|
/* pre-render phase. this does anything an object needs to do just before */
|
||||||
|
/* rendering. this could mean loading the image data, retrieving it from */
|
||||||
|
/* elsewhere, decoding video etc. */
|
||||||
|
/* then when this is done the object needs to figure if it changed and */
|
||||||
|
/* if so what and where and add thr appropriate redraw rectangles */
|
||||||
|
o = (Evas_Object_Rectangle *)(obj->object_data);
|
||||||
|
/* if someone is clipping this obj - go calculate the clipper */
|
||||||
|
if (obj->cur.clipper)
|
||||||
|
{
|
||||||
|
evas_object_clip_recalc(obj->cur.clipper);
|
||||||
|
obj->cur.clipper->func->render_pre(obj->cur.clipper);
|
||||||
|
}
|
||||||
|
/* now figure what changed and add draw rects */
|
||||||
|
/* if it just became visible or invisible */
|
||||||
|
is_v = evas_object_is_visible(obj);
|
||||||
|
was_v = evas_object_was_visible(obj);
|
||||||
|
if (is_v != was_v)
|
||||||
|
{
|
||||||
|
updates = evas_object_render_pre_visible_change(updates, obj, is_v, was_v);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
/* its not visible - we accounted for it appearing or not so just abort */
|
||||||
|
if (!is_v) goto done;
|
||||||
|
/* clipper changed this is in addition to anything else for obj */
|
||||||
|
updates = evas_object_render_pre_clipper_change(updates, obj);
|
||||||
|
/* if we restacked (layer or just within a layer) and dont clip anyone */
|
||||||
|
if ((obj->restack) && (!obj->clip.clipees))
|
||||||
|
{
|
||||||
|
updates = evas_object_render_pre_prev_cur_add(updates, obj);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
/* if it changed color */
|
||||||
|
if ((obj->cur.color.r != obj->prev.color.r) ||
|
||||||
|
(obj->cur.color.g != obj->prev.color.g) ||
|
||||||
|
(obj->cur.color.b != obj->prev.color.b) ||
|
||||||
|
(obj->cur.color.a != obj->prev.color.a))
|
||||||
|
{
|
||||||
|
updates = evas_object_render_pre_prev_cur_add(updates, obj);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
/* if it changed geometry - and obviously not visibility or color */
|
||||||
|
/* caluclate differences since we have a constant color fill */
|
||||||
|
/* we really only need to update the differences */
|
||||||
|
if ((obj->cur.geometry.x != obj->prev.geometry.x) ||
|
||||||
|
(obj->cur.geometry.y != obj->prev.geometry.y) ||
|
||||||
|
(obj->cur.geometry.w != obj->prev.geometry.w) ||
|
||||||
|
(obj->cur.geometry.h != obj->prev.geometry.h))
|
||||||
|
{
|
||||||
|
Evas_Rectangle *r;
|
||||||
|
Evas_List *rl;
|
||||||
|
|
||||||
|
rl = evas_rects_return_difference_rects(obj->cur.cache.geometry.x,
|
||||||
|
obj->cur.cache.geometry.y,
|
||||||
|
obj->cur.cache.geometry.w,
|
||||||
|
obj->cur.cache.geometry.h,
|
||||||
|
obj->prev.cache.geometry.x,
|
||||||
|
obj->prev.cache.geometry.y,
|
||||||
|
obj->prev.cache.geometry.w,
|
||||||
|
obj->prev.cache.geometry.h);
|
||||||
|
while (rl)
|
||||||
|
{
|
||||||
|
r = rl->data;
|
||||||
|
rl = evas_list_remove(rl, r);
|
||||||
|
updates = evas_list_append(updates, r);
|
||||||
|
}
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
/* it obviously didn't change - add a NO obscure - this "unupdates" this */
|
||||||
|
/* area so if there were updates for it they get wiped. don't do it if we */
|
||||||
|
/* arent fully opaque and we are visible */
|
||||||
|
if (evas_object_is_visible(obj) &&
|
||||||
|
evas_object_is_opaque(obj) &&
|
||||||
|
(!obj->clip.clipees))
|
||||||
|
obj->layer->evas->engine.func->output_redraws_rect_del(obj->layer->evas->engine.data.output,
|
||||||
|
obj->cur.cache.clip.x,
|
||||||
|
obj->cur.cache.clip.y,
|
||||||
|
obj->cur.cache.clip.w,
|
||||||
|
obj->cur.cache.clip.h);
|
||||||
|
done:
|
||||||
|
evas_object_render_pre_effect_updates(updates, obj, is_v, was_v);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_object_rectangle_render_post(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Rectangle *o;
|
||||||
|
|
||||||
|
/* this moves the current data to the previous state parts of the object */
|
||||||
|
/* in whatever way is safest for the object. also if we don't need object */
|
||||||
|
/* data anymore we can free it if the object deems this is a good idea */
|
||||||
|
o = (Evas_Object_Rectangle *)(obj->object_data);
|
||||||
|
/* remove those pesky changes */
|
||||||
|
while (obj->clip.changes)
|
||||||
|
{
|
||||||
|
Evas_Rectangle *r;
|
||||||
|
|
||||||
|
r = (Evas_Rectangle *)obj->clip.changes->data;
|
||||||
|
obj->clip.changes = evas_list_remove(obj->clip.changes, r);
|
||||||
|
free(r);
|
||||||
|
}
|
||||||
|
/* move cur to prev safely for object data */
|
||||||
|
obj->prev = obj->cur;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if 0 /* usless calls for a rect object. much more useful for images etc. */
|
||||||
|
static void
|
||||||
|
evas_object_rectangle_store(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
/* store... nothing for rectangle objects... it's a bit silly */
|
||||||
|
/* but for others that may have expensive caluclations to do to */
|
||||||
|
/* generate the object data, hint that they might want to be pre-calced */
|
||||||
|
/* once and stored */
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_object_rectangle_unstore(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
/* store... nothing for rectangle objects... it's a bit silly */
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
evas_object_rectangle_is_visible(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Rectangle *o;
|
||||||
|
|
||||||
|
/* this returns 1 if the internal object data would imply that it is */
|
||||||
|
/* visible (ie drawing it draws something. this is not to do with events */
|
||||||
|
o = (Evas_Object_Rectangle *)(obj->object_data);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
evas_object_rectangle_was_visible(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Rectangle *o;
|
||||||
|
|
||||||
|
/* this returns 1 if the internal object data would imply that it was */
|
||||||
|
/* visible (ie drawing it draws something. this is not to do with events */
|
||||||
|
o = (Evas_Object_Rectangle *)(obj->object_data);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
evas_object_rectangle_is_opaque(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Rectangle *o;
|
||||||
|
|
||||||
|
/* this returns 1 if the internal object data implies that the object is */
|
||||||
|
/* currently fulyl opque over the entire rectangle it occupies */
|
||||||
|
o = (Evas_Object_Rectangle *)(obj->object_data);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
evas_object_rectangle_was_opaque(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Rectangle *o;
|
||||||
|
|
||||||
|
/* this returns 1 if the internal object data implies that the object was */
|
||||||
|
/* currently fulyl opque over the entire rectangle it occupies */
|
||||||
|
o = (Evas_Object_Rectangle *)(obj->object_data);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
evas_object_rectangle_is_inside(Evas_Object *obj, double x, double y)
|
||||||
|
{
|
||||||
|
Evas_Object_Rectangle *o;
|
||||||
|
|
||||||
|
/* this returns 1 if the canvas co-ordinates are inside the object based */
|
||||||
|
/* on object private data. not much use for rects, but for polys images */
|
||||||
|
/* and other complex objects it might be */
|
||||||
|
o = (Evas_Object_Rectangle *)(obj->object_data);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
evas_object_rectangle_was_inside(Evas_Object *obj, double x, double y)
|
||||||
|
{
|
||||||
|
Evas_Object_Rectangle *o;
|
||||||
|
|
||||||
|
/* this returns 1 if the canvas co-ordinates were inside the object based */
|
||||||
|
/* on object private data. not much use for rects, but for polys images */
|
||||||
|
/* and other complex objects it might be */
|
||||||
|
o = (Evas_Object_Rectangle *)(obj->object_data);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
#endif
|
|
@ -0,0 +1,330 @@
|
||||||
|
#include "evas_common.h"
|
||||||
|
#include "evas_private.h"
|
||||||
|
#include "Evas.h"
|
||||||
|
|
||||||
|
typedef struct _Evas_Object_Smart Evas_Object_Smart;
|
||||||
|
typedef struct _Evas_Smart_Callback Evas_Smart_Callback;
|
||||||
|
|
||||||
|
struct _Evas_Object_Smart
|
||||||
|
{
|
||||||
|
DATA32 magic;
|
||||||
|
void *engine_data;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Evas_Smart_Callback
|
||||||
|
{
|
||||||
|
char *event;
|
||||||
|
void (*func) (void *data, Evas_Object *obj, void *event_info);
|
||||||
|
void *func_data;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* private methods for smart objects */
|
||||||
|
static void evas_object_smart_init(Evas_Object *obj);
|
||||||
|
static void *evas_object_smart_new(void);
|
||||||
|
static void evas_object_smart_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y);
|
||||||
|
static void evas_object_smart_free(Evas_Object *obj);
|
||||||
|
static void evas_object_smart_render_pre(Evas_Object *obj);
|
||||||
|
static void evas_object_smart_render_post(Evas_Object *obj);
|
||||||
|
|
||||||
|
static Evas_Object_Func object_func =
|
||||||
|
{
|
||||||
|
/* methods (compulsory) */
|
||||||
|
evas_object_smart_free,
|
||||||
|
evas_object_smart_render,
|
||||||
|
evas_object_smart_render_pre,
|
||||||
|
evas_object_smart_render_post,
|
||||||
|
/* these are optional. NULL = nothing */
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
/* public funcs */
|
||||||
|
void
|
||||||
|
evas_object_smart_data_set(Evas_Object *obj, void *data)
|
||||||
|
{
|
||||||
|
Evas_Object_Smart *o;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Smart *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Smart, MAGIC_OBJ_SMART);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
obj->smart.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
evas_object_smart_data_get(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Smart *o;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Smart *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Smart, MAGIC_OBJ_SMART);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return obj->smart.data;
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_Smart *
|
||||||
|
evas_object_smart_smart_get(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Smart *o;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Smart *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Smart, MAGIC_OBJ_SMART);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return obj->smart.smart;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_smart_member_add(Evas_Object *obj, Evas_Object *smart_obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Smart *o;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
MAGIC_CHECK(smart_obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Smart *)(smart_obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Smart, MAGIC_OBJ_SMART);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
|
if (obj->smart.parent) evas_object_smart_member_del(obj);
|
||||||
|
|
||||||
|
obj->smart.parent = smart_obj;
|
||||||
|
smart_obj->smart.contained = evas_list_append(smart_obj->smart.contained, obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_smart_member_del(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
|
if (!obj->smart.parent) return;
|
||||||
|
|
||||||
|
obj->smart.parent->smart.contained = evas_list_remove(obj->smart.parent->smart.contained, obj);
|
||||||
|
obj->smart.parent = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_Object *
|
||||||
|
evas_object_smart_add(Evas *e, Evas_Smart *s)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
MAGIC_CHECK(s, Evas_Smart, MAGIC_SMART);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
|
obj = evas_object_new();
|
||||||
|
if (!obj) return NULL;
|
||||||
|
obj->smart.smart = s;
|
||||||
|
obj->type = s->name;
|
||||||
|
evas_object_smart_init(obj);
|
||||||
|
evas_object_inject(obj, e);
|
||||||
|
|
||||||
|
evas_object_smart_use(s);
|
||||||
|
|
||||||
|
if (s->func_add) s->func_add(obj);
|
||||||
|
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_smart_callback_add(Evas_Object *obj, char *event, void (*func) (void *data, Evas_Object *obj, void *event_info), void *data)
|
||||||
|
{
|
||||||
|
Evas_Object_Smart *o;
|
||||||
|
Evas_Smart_Callback *cb;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Smart *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Smart, MAGIC_OBJ_SMART);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (!event) return;
|
||||||
|
if (!func) return;
|
||||||
|
cb = calloc(1, sizeof(Evas_Smart_Callback));
|
||||||
|
cb->event = strdup(event);
|
||||||
|
cb->func = func;
|
||||||
|
cb->func_data = data;
|
||||||
|
obj->smart.callbacks = evas_list_prepend(obj->smart.callbacks, cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
evas_object_smart_callback_del(Evas_Object *obj, char *event, void (*func) (void *data, Evas_Object *obj, void *event_info))
|
||||||
|
{
|
||||||
|
Evas_Object_Smart *o;
|
||||||
|
Evas_List *l;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Smart *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Smart, MAGIC_OBJ_SMART);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (!event) return;
|
||||||
|
for (l = obj->smart.callbacks; l; l = l->next)
|
||||||
|
{
|
||||||
|
Evas_Smart_Callback *cb;
|
||||||
|
|
||||||
|
cb = l->data;
|
||||||
|
if ((!strcmp(cb->event, event)) && (cb->func == func))
|
||||||
|
{
|
||||||
|
void *data;
|
||||||
|
|
||||||
|
obj->smart.callbacks = evas_list_remove(obj->smart.callbacks, cb);
|
||||||
|
data = cb->func_data;
|
||||||
|
if (cb->event) free(cb->event);
|
||||||
|
free(cb);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_smart_callback_call(Evas_Object *obj, char *event, void *event_info)
|
||||||
|
{
|
||||||
|
Evas_Object_Smart *o;
|
||||||
|
Evas_List *l;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Smart *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Smart, MAGIC_OBJ_SMART);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (!event) return;
|
||||||
|
for (l = obj->smart.callbacks; l; l = l->next)
|
||||||
|
{
|
||||||
|
Evas_Smart_Callback *cb;
|
||||||
|
|
||||||
|
cb = l->data;
|
||||||
|
if (!strcmp(cb->event, event))
|
||||||
|
cb->func(cb->func_data, obj, event_info);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* internal calls */
|
||||||
|
void
|
||||||
|
evas_object_smart_del(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Smart *s;
|
||||||
|
|
||||||
|
s = obj->smart.smart;
|
||||||
|
if (obj->smart.parent) evas_object_smart_member_del(obj);
|
||||||
|
if ((s) && (s->func_del)) s->func_del(obj);
|
||||||
|
if (s) evas_object_smart_unuse(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_smart_cleanup(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Smart *s;
|
||||||
|
|
||||||
|
s = obj->smart.smart;
|
||||||
|
while (obj->smart.contained)
|
||||||
|
obj->smart.contained = evas_list_remove(obj->smart.contained, obj->smart.contained->data);
|
||||||
|
while (obj->smart.callbacks)
|
||||||
|
{
|
||||||
|
Evas_Smart_Callback *cb;
|
||||||
|
|
||||||
|
cb = obj->smart.callbacks->data;
|
||||||
|
obj->smart.callbacks = evas_list_remove(obj->smart.callbacks, cb);
|
||||||
|
if (cb->event) free (cb->event);
|
||||||
|
free(cb);
|
||||||
|
}
|
||||||
|
if (s) evas_object_smart_unuse(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* all nice and private */
|
||||||
|
static void
|
||||||
|
evas_object_smart_init(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
/* alloc image ob, setup methods and default values */
|
||||||
|
obj->object_data = evas_object_smart_new();
|
||||||
|
/* set up default settings for this kind of object */
|
||||||
|
obj->cur.color.r = 255;
|
||||||
|
obj->cur.color.g = 255;
|
||||||
|
obj->cur.color.b = 255;
|
||||||
|
obj->cur.color.a = 255;
|
||||||
|
obj->cur.geometry.x = 0.0;
|
||||||
|
obj->cur.geometry.y = 0.0;
|
||||||
|
obj->cur.geometry.w = 32.0;
|
||||||
|
obj->cur.geometry.h = 32.0;
|
||||||
|
obj->cur.layer = 0;
|
||||||
|
/* set up object-specific settings */
|
||||||
|
obj->prev = obj->cur;
|
||||||
|
/* set up methods (compulsory) */
|
||||||
|
obj->func = &object_func;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void *
|
||||||
|
evas_object_smart_new(void)
|
||||||
|
{
|
||||||
|
Evas_Object_Smart *o;
|
||||||
|
|
||||||
|
/* alloc obj private data */
|
||||||
|
o = calloc(1, sizeof(Evas_Object_Smart));
|
||||||
|
o->magic = MAGIC_OBJ_SMART;
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_object_smart_free(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Smart *o;
|
||||||
|
|
||||||
|
/* frees private object data. very simple here */
|
||||||
|
o = (Evas_Object_Smart *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Smart, MAGIC_OBJ_SMART);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
/* free obj */
|
||||||
|
o->magic = 0;
|
||||||
|
free(o);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_object_smart_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_object_smart_render_pre(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
if (obj->pre_render_done) return;
|
||||||
|
obj->pre_render_done = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_object_smart_render_post(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
obj->prev = obj->cur;
|
||||||
|
}
|
|
@ -0,0 +1,802 @@
|
||||||
|
#include "evas_common.h"
|
||||||
|
#include "evas_private.h"
|
||||||
|
#include "Evas.h"
|
||||||
|
|
||||||
|
/* private magic number for text objects */
|
||||||
|
static const char o_type[] = "text";
|
||||||
|
|
||||||
|
/* private struct for text object internal data */
|
||||||
|
typedef struct _Evas_Object_Text Evas_Object_Text;
|
||||||
|
|
||||||
|
struct _Evas_Object_Text
|
||||||
|
{
|
||||||
|
DATA32 magic;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
char *text;
|
||||||
|
char *font;
|
||||||
|
double size;
|
||||||
|
} cur, prev;
|
||||||
|
int changed : 1;
|
||||||
|
|
||||||
|
double ascent, descent;
|
||||||
|
double max_ascent, max_descent;
|
||||||
|
|
||||||
|
void *engine_data;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* private methods for text objects */
|
||||||
|
static void evas_object_text_init(Evas_Object *obj);
|
||||||
|
static void *evas_object_text_new(void);
|
||||||
|
static void evas_object_text_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y);
|
||||||
|
static void evas_object_text_free(Evas_Object *obj);
|
||||||
|
static void evas_object_text_render_pre(Evas_Object *obj);
|
||||||
|
static void evas_object_text_render_post(Evas_Object *obj);
|
||||||
|
|
||||||
|
static int evas_object_text_is_opaque(Evas_Object *obj);
|
||||||
|
static int evas_object_text_was_opaque(Evas_Object *obj);
|
||||||
|
|
||||||
|
static Evas_Object_Func object_func =
|
||||||
|
{
|
||||||
|
/* methods (compulsory) */
|
||||||
|
evas_object_text_free,
|
||||||
|
evas_object_text_render,
|
||||||
|
evas_object_text_render_pre,
|
||||||
|
evas_object_text_render_post,
|
||||||
|
/* these are optional. NULL = nothing */
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
evas_object_text_is_opaque,
|
||||||
|
evas_object_text_was_opaque,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
/* the actual api call to add a rect */
|
||||||
|
/* it has no other api calls as all properties are standard */
|
||||||
|
Evas_Object *
|
||||||
|
evas_object_text_add(Evas *e)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
obj = evas_object_new();
|
||||||
|
evas_object_text_init(obj);
|
||||||
|
evas_object_inject(obj, e);
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_text_font_set(Evas_Object *obj, char *font, double size)
|
||||||
|
{
|
||||||
|
Evas_Object_Text *o;
|
||||||
|
int is, was;
|
||||||
|
|
||||||
|
if (!font) return;
|
||||||
|
if (size <= 0) return;
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Text *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if ((o->cur.font) && (font) && !strcmp(o->cur.font, font))
|
||||||
|
{
|
||||||
|
if (size == o->cur.size) return;
|
||||||
|
}
|
||||||
|
was = evas_object_is_in_output_rect(obj,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y, 1, 1);
|
||||||
|
/* DO II */
|
||||||
|
if (o->engine_data)
|
||||||
|
obj->layer->evas->engine.func->font_free(obj->layer->evas->engine.data.output,
|
||||||
|
o->engine_data);
|
||||||
|
if (evas_file_path_is_full_path(font))
|
||||||
|
o->engine_data = obj->layer->evas->engine.func->font_load(obj->layer->evas->engine.data.output,
|
||||||
|
font, size);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Evas_List *l;
|
||||||
|
|
||||||
|
for (l = obj->layer->evas->font_path; l; l = l->next)
|
||||||
|
{
|
||||||
|
char *tmp, *font_tmp;
|
||||||
|
Evas_List *dir;
|
||||||
|
|
||||||
|
tmp = evas_file_path_join(l->data, font);
|
||||||
|
if (tmp)
|
||||||
|
{
|
||||||
|
char *tmp2;
|
||||||
|
|
||||||
|
o->engine_data = obj->layer->evas->engine.func->font_load(obj->layer->evas->engine.data.output,
|
||||||
|
tmp, size);
|
||||||
|
if (o->engine_data)
|
||||||
|
{
|
||||||
|
free(tmp);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
tmp2 = malloc(strlen(tmp) + 4 + 1);
|
||||||
|
if (tmp2)
|
||||||
|
{
|
||||||
|
strcpy(tmp2, tmp);
|
||||||
|
strcat(tmp2, ".ttf");
|
||||||
|
o->engine_data = obj->layer->evas->engine.func->font_load(obj->layer->evas->engine.data.output,
|
||||||
|
tmp2, size);
|
||||||
|
if (o->engine_data)
|
||||||
|
{
|
||||||
|
free(tmp);
|
||||||
|
free(tmp2);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
strcpy(tmp2, tmp);
|
||||||
|
strcat(tmp2, ".TTF");
|
||||||
|
o->engine_data = obj->layer->evas->engine.func->font_load(obj->layer->evas->engine.data.output,
|
||||||
|
tmp2, size);
|
||||||
|
if (o->engine_data)
|
||||||
|
{
|
||||||
|
free(tmp);
|
||||||
|
free(tmp2);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
free(tmp2);
|
||||||
|
}
|
||||||
|
free(tmp);
|
||||||
|
}
|
||||||
|
dir = evas_file_path_list(l->data, font, 0);
|
||||||
|
while (dir)
|
||||||
|
{
|
||||||
|
tmp = evas_file_path_join(l->data, dir->data);
|
||||||
|
if (tmp)
|
||||||
|
{
|
||||||
|
o->engine_data = obj->layer->evas->engine.func->font_load(obj->layer->evas->engine.data.output,
|
||||||
|
tmp, size);
|
||||||
|
if (o->engine_data)
|
||||||
|
{
|
||||||
|
while (dir)
|
||||||
|
{
|
||||||
|
free(dir->data);
|
||||||
|
dir = evas_list_remove(dir, dir->data);
|
||||||
|
}
|
||||||
|
free(tmp);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
free(tmp);
|
||||||
|
}
|
||||||
|
free(dir->data);
|
||||||
|
dir = evas_list_remove(dir, dir->data);
|
||||||
|
}
|
||||||
|
font_tmp = malloc(strlen(font) + 4 + 1);
|
||||||
|
if (font_tmp)
|
||||||
|
{
|
||||||
|
strcpy(font_tmp, font);
|
||||||
|
strcat(font_tmp, ".ttf");
|
||||||
|
dir = evas_file_path_list(l->data, font_tmp, 0);
|
||||||
|
while (dir)
|
||||||
|
{
|
||||||
|
tmp = evas_file_path_join(l->data, dir->data);
|
||||||
|
if (tmp)
|
||||||
|
{
|
||||||
|
o->engine_data = obj->layer->evas->engine.func->font_load(obj->layer->evas->engine.data.output,
|
||||||
|
tmp, size);
|
||||||
|
if (o->engine_data)
|
||||||
|
{
|
||||||
|
while (dir)
|
||||||
|
{
|
||||||
|
free(dir->data);
|
||||||
|
dir = evas_list_remove(dir, dir->data);
|
||||||
|
}
|
||||||
|
free(font_tmp);
|
||||||
|
free(tmp);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
free(tmp);
|
||||||
|
}
|
||||||
|
free(dir->data);
|
||||||
|
dir = evas_list_remove(dir, dir->data);
|
||||||
|
}
|
||||||
|
free(font_tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//_WIN32_WCE
|
||||||
|
done: ;
|
||||||
|
}
|
||||||
|
if (o->cur.font) free(o->cur.font);
|
||||||
|
if (font) o->cur.font = strdup(font);
|
||||||
|
else o->cur.font = NULL;
|
||||||
|
o->prev.font = NULL;
|
||||||
|
o->cur.size = size;
|
||||||
|
if ((o->engine_data) && (o->cur.text))
|
||||||
|
{
|
||||||
|
int w, h;
|
||||||
|
|
||||||
|
obj->layer->evas->engine.func->font_string_size_get(obj->layer->evas->engine.data.output,
|
||||||
|
o->engine_data,
|
||||||
|
o->cur.text,
|
||||||
|
&w, &h);
|
||||||
|
obj->cur.geometry.w = w;
|
||||||
|
obj->cur.geometry.h = h;
|
||||||
|
obj->cur.cache.geometry.validity = 0;
|
||||||
|
o->ascent = obj->layer->evas->engine.func->font_ascent_get(obj->layer->evas->engine.data.output,
|
||||||
|
o->engine_data);
|
||||||
|
o->descent = obj->layer->evas->engine.func->font_descent_get(obj->layer->evas->engine.data.output,
|
||||||
|
o->engine_data);
|
||||||
|
o->max_ascent = obj->layer->evas->engine.func->font_max_ascent_get(obj->layer->evas->engine.data.output,
|
||||||
|
o->engine_data);
|
||||||
|
o->max_descent = obj->layer->evas->engine.func->font_max_descent_get(obj->layer->evas->engine.data.output,
|
||||||
|
o->engine_data);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (o->engine_data)
|
||||||
|
{
|
||||||
|
o->ascent = obj->layer->evas->engine.func->font_ascent_get(obj->layer->evas->engine.data.output,
|
||||||
|
o->engine_data);
|
||||||
|
o->descent = obj->layer->evas->engine.func->font_descent_get(obj->layer->evas->engine.data.output,
|
||||||
|
o->engine_data);
|
||||||
|
o->max_ascent = obj->layer->evas->engine.func->font_max_ascent_get(obj->layer->evas->engine.data.output,
|
||||||
|
o->engine_data);
|
||||||
|
o->max_descent = obj->layer->evas->engine.func->font_max_descent_get(obj->layer->evas->engine.data.output,
|
||||||
|
o->engine_data);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
o->ascent = 0;
|
||||||
|
o->descent = 0;
|
||||||
|
o->max_ascent = 0;
|
||||||
|
o->max_descent = 0;
|
||||||
|
}
|
||||||
|
obj->cur.geometry.w = 0;
|
||||||
|
obj->cur.geometry.h = o->max_ascent + o->max_descent;
|
||||||
|
obj->cur.cache.geometry.validity = 0;
|
||||||
|
}
|
||||||
|
o->changed = 1;
|
||||||
|
evas_object_change(obj);
|
||||||
|
evas_object_coords_recalc(obj);
|
||||||
|
is = evas_object_is_in_output_rect(obj,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y, 1, 1);
|
||||||
|
if ((is || was) && obj->cur.visible)
|
||||||
|
evas_event_feed_mouse_move(obj->layer->evas,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_text_font_get(Evas_Object *obj, char **font, double *size)
|
||||||
|
{
|
||||||
|
Evas_Object_Text *o;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
*font = "";
|
||||||
|
*size = 0;
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Text *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
|
||||||
|
*font = "";
|
||||||
|
*size = 0;
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
*font = o->cur.font;
|
||||||
|
*size = o->cur.size;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_text_text_set(Evas_Object *obj, char *text)
|
||||||
|
{
|
||||||
|
Evas_Object_Text *o;
|
||||||
|
int is, was;
|
||||||
|
|
||||||
|
if (!text) text = "";
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Text *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if ((o->cur.text) && (text) && (!strcmp(o->cur.text, text))) return;
|
||||||
|
was = evas_object_is_in_output_rect(obj,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y, 1, 1);
|
||||||
|
/* DO II */
|
||||||
|
if (o->cur.text) free(o->cur.text);
|
||||||
|
if (text) o->cur.text = strdup(text);
|
||||||
|
else o->cur.text = NULL;
|
||||||
|
o->prev.text = NULL;
|
||||||
|
if ((o->engine_data) && (o->cur.text))
|
||||||
|
{
|
||||||
|
int w, h;
|
||||||
|
|
||||||
|
obj->layer->evas->engine.func->font_string_size_get(obj->layer->evas->engine.data.output,
|
||||||
|
o->engine_data,
|
||||||
|
o->cur.text,
|
||||||
|
&w, &h);
|
||||||
|
obj->cur.geometry.w = w;
|
||||||
|
obj->cur.geometry.h = h;
|
||||||
|
obj->cur.cache.geometry.validity = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
obj->cur.geometry.w = 0;
|
||||||
|
obj->cur.geometry.h = o->max_ascent + o->max_descent;
|
||||||
|
obj->cur.cache.geometry.validity = 0;
|
||||||
|
}
|
||||||
|
o->changed = 1;
|
||||||
|
evas_object_change(obj);
|
||||||
|
evas_object_coords_recalc(obj);
|
||||||
|
is = evas_object_is_in_output_rect(obj,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y, 1, 1);
|
||||||
|
if ((is || was) && obj->cur.visible)
|
||||||
|
evas_event_feed_mouse_move(obj->layer->evas,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
evas_object_text_text_get(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Text *o;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Text *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return o->cur.text;
|
||||||
|
}
|
||||||
|
|
||||||
|
double
|
||||||
|
evas_object_text_ascent_get(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Text *o;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Text *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return o->ascent;
|
||||||
|
}
|
||||||
|
|
||||||
|
double
|
||||||
|
evas_object_text_descent_get(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Text *o;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Text *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return o->descent;
|
||||||
|
}
|
||||||
|
|
||||||
|
double
|
||||||
|
evas_object_text_max_ascent_get(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Text *o;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Text *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return o->max_ascent;
|
||||||
|
}
|
||||||
|
|
||||||
|
double
|
||||||
|
evas_object_text_max_descent_get(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Text *o;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Text *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return o->max_descent;
|
||||||
|
}
|
||||||
|
|
||||||
|
double
|
||||||
|
evas_object_text_inset_get(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Text *o;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Text *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return obj->layer->evas->engine.func->font_inset_get(obj->layer->evas->engine.data.output,
|
||||||
|
o->engine_data,
|
||||||
|
o->cur.text);
|
||||||
|
}
|
||||||
|
|
||||||
|
double
|
||||||
|
evas_object_text_horiz_advance_get(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Text *o;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Text *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return obj->layer->evas->engine.func->font_h_advance_get(obj->layer->evas->engine.data.output,
|
||||||
|
o->engine_data,
|
||||||
|
o->cur.text);
|
||||||
|
}
|
||||||
|
|
||||||
|
double
|
||||||
|
evas_object_text_vert_advance_get(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Text *o;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Text *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return obj->layer->evas->engine.func->font_v_advance_get(obj->layer->evas->engine.data.output,
|
||||||
|
o->engine_data,
|
||||||
|
o->cur.text);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
evas_object_text_char_pos_get(Evas_Object *obj, int pos, double *cx, double *cy, double *cw, double *ch)
|
||||||
|
{
|
||||||
|
Evas_Object_Text *o;
|
||||||
|
int ret, x, y, w, h;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Text *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
ret = obj->layer->evas->engine.func->font_char_coords_get(obj->layer->evas->engine.data.output,
|
||||||
|
o->engine_data,
|
||||||
|
o->cur.text,
|
||||||
|
pos,
|
||||||
|
&x, &y,
|
||||||
|
&w, &h);
|
||||||
|
if (cx) *cx = x;
|
||||||
|
if (cy) *cy = y;
|
||||||
|
if (cw) *cw = w;
|
||||||
|
if (ch) *ch = h;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
evas_object_text_char_coords_get(Evas_Object *obj, double x, double y, double *cx, double *cy, double *cw, double *ch)
|
||||||
|
{
|
||||||
|
Evas_Object_Text *o;
|
||||||
|
int ret, rx, ry, rw, rh;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
o = (Evas_Object_Text *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
ret = obj->layer->evas->engine.func->font_char_at_coords_get(obj->layer->evas->engine.data.output,
|
||||||
|
o->engine_data,
|
||||||
|
o->cur.text,
|
||||||
|
x, y,
|
||||||
|
&rx, &ry,
|
||||||
|
&rw, &rh);
|
||||||
|
if (cx) *cx = rx;
|
||||||
|
if (cy) *cy = ry;
|
||||||
|
if (cw) *cw = rw;
|
||||||
|
if (ch) *ch = rh;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_font_path_clear(Evas *e)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
while (e->font_path)
|
||||||
|
{
|
||||||
|
free(e->font_path->data);
|
||||||
|
e->font_path = evas_list_remove(e->font_path, e->font_path->data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_font_path_append(Evas *e, char *path)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (!path) return;
|
||||||
|
e->font_path = evas_list_append(e->font_path, strdup(path));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_font_path_prepend(Evas *e, char *path)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (!path) return;
|
||||||
|
e->font_path = evas_list_prepend(e->font_path, strdup(path));
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_List *
|
||||||
|
evas_object_font_path_list(Evas *e)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return e->font_path;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_font_cache_flush(Evas *e)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
|
e->engine.func->font_cache_flush(e->engine.data.output);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_font_cache_set(Evas *e, int size)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
|
if (size < 0) size = 0;
|
||||||
|
e->engine.func->font_cache_set(e->engine.data.output, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
evas_object_font_cache_get(Evas *e)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return 0;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
|
return e->engine.func->font_cache_get(e->engine.data.output);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* all nice and private */
|
||||||
|
static void
|
||||||
|
evas_object_text_init(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
/* alloc text ob, setup methods and default values */
|
||||||
|
obj->object_data = evas_object_text_new();
|
||||||
|
/* set up default settings for this kind of object */
|
||||||
|
obj->cur.color.r = 255;
|
||||||
|
obj->cur.color.g = 255;
|
||||||
|
obj->cur.color.b = 255;
|
||||||
|
obj->cur.color.a = 255;
|
||||||
|
obj->cur.geometry.x = 0.0;
|
||||||
|
obj->cur.geometry.y = 0.0;
|
||||||
|
obj->cur.geometry.w = 0.0;
|
||||||
|
obj->cur.geometry.h = 0.0;
|
||||||
|
obj->cur.layer = 0;
|
||||||
|
/* set up object-specific settings */
|
||||||
|
obj->prev = obj->cur;
|
||||||
|
/* set up methods (compulsory) */
|
||||||
|
obj->func = &object_func;
|
||||||
|
obj->type = o_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void *
|
||||||
|
evas_object_text_new(void)
|
||||||
|
{
|
||||||
|
Evas_Object_Text *o;
|
||||||
|
|
||||||
|
/* alloc obj private data */
|
||||||
|
o = calloc(1, sizeof(Evas_Object_Text));
|
||||||
|
o->magic = MAGIC_OBJ_TEXT;
|
||||||
|
o->prev = o->cur;
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_object_text_free(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Text *o;
|
||||||
|
|
||||||
|
/* frees private object data. very simple here */
|
||||||
|
o = (Evas_Object_Text *)(obj->object_data);
|
||||||
|
MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
/* free obj */
|
||||||
|
if (o->cur.text) free(o->cur.text);
|
||||||
|
if (o->cur.font) free(o->cur.font);
|
||||||
|
if (o->engine_data)
|
||||||
|
obj->layer->evas->engine.func->font_free(obj->layer->evas->engine.data.output,
|
||||||
|
o->engine_data);
|
||||||
|
o->magic = 0;
|
||||||
|
free(o);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_object_text_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y)
|
||||||
|
{
|
||||||
|
Evas_Object_Text *o;
|
||||||
|
|
||||||
|
/* render object to surface with context, and offxet by x,y */
|
||||||
|
o = (Evas_Object_Text *)(obj->object_data);
|
||||||
|
obj->layer->evas->engine.func->context_multiplier_unset(output,
|
||||||
|
context);
|
||||||
|
obj->layer->evas->engine.func->context_color_set(output,
|
||||||
|
context,
|
||||||
|
obj->cur.cache.clip.r,
|
||||||
|
obj->cur.cache.clip.g,
|
||||||
|
obj->cur.cache.clip.b,
|
||||||
|
obj->cur.cache.clip.a);
|
||||||
|
if (o->engine_data)
|
||||||
|
obj->layer->evas->engine.func->font_draw(output,
|
||||||
|
context,
|
||||||
|
surface,
|
||||||
|
o->engine_data,
|
||||||
|
obj->cur.cache.geometry.x + x,
|
||||||
|
obj->cur.cache.geometry.y + y +
|
||||||
|
(int)
|
||||||
|
((o->max_ascent * obj->cur.cache.geometry.h) / obj->cur.geometry.h),
|
||||||
|
obj->cur.cache.geometry.w,
|
||||||
|
obj->cur.cache.geometry.h,
|
||||||
|
obj->cur.geometry.w,
|
||||||
|
obj->cur.geometry.h,
|
||||||
|
o->cur.text);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_object_text_render_pre(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_List *updates = NULL;
|
||||||
|
Evas_Object_Text *o;
|
||||||
|
int is_v, was_v;
|
||||||
|
|
||||||
|
/* dont pre-render the obj twice! */
|
||||||
|
if (obj->pre_render_done) return;
|
||||||
|
obj->pre_render_done = 1;
|
||||||
|
/* pre-render phase. this does anything an object needs to do just before */
|
||||||
|
/* rendering. this could mean loading the image data, retrieving it from */
|
||||||
|
/* elsewhere, decoding video etc. */
|
||||||
|
/* then when this is done the object needs to figure if it changed and */
|
||||||
|
/* if so what and where and add thr appropriate redraw rectangles */
|
||||||
|
o = (Evas_Object_Text *)(obj->object_data);
|
||||||
|
/* if someone is clipping this obj - go calculate the clipper */
|
||||||
|
if (obj->cur.clipper)
|
||||||
|
{
|
||||||
|
evas_object_clip_recalc(obj->cur.clipper);
|
||||||
|
obj->cur.clipper->func->render_pre(obj->cur.clipper);
|
||||||
|
}
|
||||||
|
/* now figure what changed and add draw rects */
|
||||||
|
/* if it just became visible or invisible */
|
||||||
|
is_v = evas_object_is_visible(obj);
|
||||||
|
was_v = evas_object_was_visible(obj);
|
||||||
|
if (is_v != was_v)
|
||||||
|
{
|
||||||
|
updates = evas_object_render_pre_visible_change(updates, obj, is_v, was_v);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
/* its not visible - we accounted for it appearing or not so just abort */
|
||||||
|
if (!is_v) goto done;
|
||||||
|
/* clipper changed this is in addition to anything else for obj */
|
||||||
|
updates = evas_object_render_pre_clipper_change(updates, obj);
|
||||||
|
/* if we restacked (layer or just within a layer) and dont clip anyone */
|
||||||
|
if (obj->restack)
|
||||||
|
{
|
||||||
|
updates = evas_object_render_pre_prev_cur_add(updates, obj);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
/* if it changed color */
|
||||||
|
if ((obj->cur.color.r != obj->prev.color.r) ||
|
||||||
|
(obj->cur.color.g != obj->prev.color.g) ||
|
||||||
|
(obj->cur.color.b != obj->prev.color.b) ||
|
||||||
|
(obj->cur.color.a != obj->prev.color.a))
|
||||||
|
{
|
||||||
|
updates = evas_object_render_pre_prev_cur_add(updates, obj);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
/* if it changed geometry - and obviously not visibility or color */
|
||||||
|
/* caluclate differences since we have a constant color fill */
|
||||||
|
/* we really only need to update the differences */
|
||||||
|
if ((obj->cur.geometry.x != obj->prev.geometry.x) ||
|
||||||
|
(obj->cur.geometry.y != obj->prev.geometry.y) ||
|
||||||
|
(obj->cur.geometry.w != obj->prev.geometry.w) ||
|
||||||
|
(obj->cur.geometry.h != obj->prev.geometry.h))
|
||||||
|
{
|
||||||
|
updates = evas_object_render_pre_prev_cur_add(updates, obj);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
if (o->changed)
|
||||||
|
{
|
||||||
|
updates = evas_object_render_pre_prev_cur_add(updates, obj);
|
||||||
|
}
|
||||||
|
done:
|
||||||
|
evas_object_render_pre_effect_updates(updates, obj, is_v, was_v);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_object_text_render_post(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Text *o;
|
||||||
|
|
||||||
|
/* this moves the current data to the previous state parts of the object */
|
||||||
|
/* in whatever way is safest for the object. also if we don't need object */
|
||||||
|
/* data anymore we can free it if the object deems this is a good idea */
|
||||||
|
o = (Evas_Object_Text *)(obj->object_data);
|
||||||
|
/* remove those pesky changes */
|
||||||
|
while (obj->clip.changes)
|
||||||
|
{
|
||||||
|
Evas_Rectangle *r;
|
||||||
|
|
||||||
|
r = (Evas_Rectangle *)obj->clip.changes->data;
|
||||||
|
obj->clip.changes = evas_list_remove(obj->clip.changes, r);
|
||||||
|
free(r);
|
||||||
|
}
|
||||||
|
/* move cur to prev safely for object data */
|
||||||
|
obj->prev = obj->cur;
|
||||||
|
o->prev = o->cur;
|
||||||
|
o->changed = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
evas_object_text_is_opaque(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Text *o;
|
||||||
|
|
||||||
|
/* this returns 1 if the internal object data implies that the object is */
|
||||||
|
/* currently fulyl opque over the entire gradient it occupies */
|
||||||
|
o = (Evas_Object_Text *)(obj->object_data);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
evas_object_text_was_opaque(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object_Text *o;
|
||||||
|
|
||||||
|
/* this returns 1 if the internal object data implies that the object was */
|
||||||
|
/* currently fulyl opque over the entire gradient it occupies */
|
||||||
|
o = (Evas_Object_Text *)(obj->object_data);
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -0,0 +1,95 @@
|
||||||
|
#include "evas_common.h"
|
||||||
|
#include "evas_private.h"
|
||||||
|
#include "Evas.h"
|
||||||
|
|
||||||
|
Evas_List *
|
||||||
|
evas_rects_return_difference_rects(int x, int y, int w, int h, int xx, int yy, int ww, int hh)
|
||||||
|
{
|
||||||
|
Evas_List *rects = NULL;
|
||||||
|
Evas_Rectangle *r;
|
||||||
|
|
||||||
|
if (!RECTS_INTERSECT(x, y, w, h, xx, yy, ww, hh))
|
||||||
|
{
|
||||||
|
NEW_RECT(r, x, y, w, h);
|
||||||
|
if (r) rects = evas_list_append(rects, r);
|
||||||
|
NEW_RECT(r, xx, yy, ww, hh);
|
||||||
|
if (r) rects = evas_list_append(rects, r);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int x1[4], y1[4], i, j;
|
||||||
|
Evas_List *rl = NULL, *rll;
|
||||||
|
|
||||||
|
if (x < xx)
|
||||||
|
{
|
||||||
|
x1[0] = x;
|
||||||
|
x1[1] = xx;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x1[0] = xx;
|
||||||
|
x1[1] = x;
|
||||||
|
}
|
||||||
|
if ((x + w) < (xx + ww))
|
||||||
|
{
|
||||||
|
x1[2] = x + w;
|
||||||
|
x1[3] = xx + ww;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x1[2] = xx + ww;
|
||||||
|
x1[3] = x + w;
|
||||||
|
}
|
||||||
|
if (y < yy)
|
||||||
|
{
|
||||||
|
y1[0] = y;
|
||||||
|
y1[1] = yy;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
y1[0] = yy;
|
||||||
|
y1[1] = y;
|
||||||
|
}
|
||||||
|
if ((y + h) < (yy + hh))
|
||||||
|
{
|
||||||
|
y1[2] = y + h;
|
||||||
|
y1[3] = yy + hh;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
y1[2] = yy + hh;
|
||||||
|
y1[3] = y + h;
|
||||||
|
}
|
||||||
|
for (j = 0; j < 3; j++)
|
||||||
|
{
|
||||||
|
for (i = 0; i < 3; i++)
|
||||||
|
{
|
||||||
|
NEW_RECT(r, x1[i], y1[j], x1[i + 1] - x1[i], y1[j + 1] - y1[j]);
|
||||||
|
if (r) rl = evas_list_append(rl, r);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (rl)
|
||||||
|
{
|
||||||
|
for (rll = rl; rll; rll = rll->next)
|
||||||
|
{
|
||||||
|
r = rll->data;
|
||||||
|
if ((r->w > 0) && (r->h > 0))
|
||||||
|
{
|
||||||
|
int intsec1, intsec2;
|
||||||
|
|
||||||
|
intsec1 = (RECTS_INTERSECT(r->x, r->y, r->w, r->h, x, y, w, h));
|
||||||
|
intsec2 = (RECTS_INTERSECT(r->x, r->y, r->w, r->h, xx, yy, ww, hh));
|
||||||
|
if (intsec1 ^ intsec2)
|
||||||
|
rects = evas_list_append(rects, r);
|
||||||
|
else
|
||||||
|
free(r);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
free(r);
|
||||||
|
}
|
||||||
|
rl = evas_list_free(rl);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return rects;
|
||||||
|
}
|
|
@ -0,0 +1,326 @@
|
||||||
|
#include "evas_common.h"
|
||||||
|
#include "evas_private.h"
|
||||||
|
#include "Evas.h"
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_damage_rectangle_add(Evas *e, int x, int y, int w, int h)
|
||||||
|
{
|
||||||
|
Evas_Rectangle *r;
|
||||||
|
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
r = malloc(sizeof(Evas_Rectangle));
|
||||||
|
if (!r) return;
|
||||||
|
r->x = x; r->y = y; r->w = w; r->h = h;
|
||||||
|
e->damages = evas_list_append(e->damages, r);
|
||||||
|
e->changed = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_obscured_rectangle_add(Evas *e, int x, int y, int w, int h)
|
||||||
|
{
|
||||||
|
Evas_Rectangle *r;
|
||||||
|
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
r = malloc(sizeof(Evas_Rectangle));
|
||||||
|
if (!r) return;
|
||||||
|
r->x = x; r->y = y; r->w = w; r->h = h;
|
||||||
|
e->obscures = evas_list_append(e->obscures, r);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_obscured_clear(Evas *e)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
while (e->obscures)
|
||||||
|
{
|
||||||
|
Evas_Rectangle *r;
|
||||||
|
|
||||||
|
r = (Evas_Rectangle *)e->obscures->data;
|
||||||
|
e->obscures = evas_list_remove(e->obscures, r);
|
||||||
|
free(r);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_List *
|
||||||
|
evas_render_updates(Evas *e)
|
||||||
|
{
|
||||||
|
Evas_List *updates = NULL;
|
||||||
|
Evas_List *obscuring_objects = NULL;
|
||||||
|
Evas_List *obscuring_objects_orig = NULL;
|
||||||
|
Evas_List *active_objects = NULL;
|
||||||
|
Evas_List *delete_objects = NULL;
|
||||||
|
Evas_List *restack_objects = NULL;
|
||||||
|
Evas_List *ll;
|
||||||
|
Evas_Object_List *l;
|
||||||
|
void *surface;
|
||||||
|
int ux, uy, uw, uh;
|
||||||
|
int cx, cy, cw, ch;
|
||||||
|
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (!e->changed) return NULL;
|
||||||
|
|
||||||
|
if (e->output.changed)
|
||||||
|
{
|
||||||
|
e->engine.func->output_resize(e->engine.data.output,
|
||||||
|
e->output.w, e->output.h);
|
||||||
|
e->engine.func->output_redraws_rect_add(e->engine.data.output,
|
||||||
|
0, 0,
|
||||||
|
e->output.w, e->output.h);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* phase 1. add extra updates for changed objects */
|
||||||
|
for (l = (Evas_Object_List *)e->layers; l; l = l->next)
|
||||||
|
{
|
||||||
|
Evas_Object_List *l2;
|
||||||
|
Evas_Layer *lay;
|
||||||
|
|
||||||
|
lay = (Evas_Layer *)l;
|
||||||
|
for (l2 = (Evas_Object_List *)lay->objects; l2; l2 = l2->next)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
|
||||||
|
obj = (Evas_Object *)l2;
|
||||||
|
evas_object_clip_recalc(obj);
|
||||||
|
/* build active object list */
|
||||||
|
if (evas_object_is_active(obj))
|
||||||
|
active_objects = evas_list_append(active_objects, obj);
|
||||||
|
/* something changed... maybe... */
|
||||||
|
if (obj->changed)
|
||||||
|
{
|
||||||
|
if ((obj->restack) &&
|
||||||
|
(!obj->clip.clipees) &&
|
||||||
|
evas_object_is_active(obj))
|
||||||
|
restack_objects = evas_list_append(restack_objects, obj);
|
||||||
|
else
|
||||||
|
obj->func->render_pre(obj);
|
||||||
|
}
|
||||||
|
/* nothng changed at all */
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (evas_object_is_opaque(obj) &&
|
||||||
|
evas_object_is_visible(obj) &&
|
||||||
|
(!obj->clip.clipees))
|
||||||
|
e->engine.func->output_redraws_rect_del(e->engine.data.output,
|
||||||
|
obj->cur.cache.clip.x,
|
||||||
|
obj->cur.cache.clip.y,
|
||||||
|
obj->cur.cache.clip.w,
|
||||||
|
obj->cur.cache.clip.h);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* phase 2. force updates for restacks */
|
||||||
|
while (restack_objects)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
|
||||||
|
obj = restack_objects->data;
|
||||||
|
restack_objects = evas_list_remove(restack_objects, obj);
|
||||||
|
obj->func->render_pre(obj);
|
||||||
|
e->engine.func->output_redraws_rect_add(e->engine.data.output,
|
||||||
|
obj->prev.cache.clip.x,
|
||||||
|
obj->prev.cache.clip.y,
|
||||||
|
obj->prev.cache.clip.w,
|
||||||
|
obj->prev.cache.clip.h);
|
||||||
|
e->engine.func->output_redraws_rect_add(e->engine.data.output,
|
||||||
|
obj->cur.cache.clip.x,
|
||||||
|
obj->cur.cache.clip.y,
|
||||||
|
obj->cur.cache.clip.w,
|
||||||
|
obj->cur.cache.clip.h);
|
||||||
|
}
|
||||||
|
/* phase 3. add exposes */
|
||||||
|
while (e->damages)
|
||||||
|
{
|
||||||
|
Evas_Rectangle *r;
|
||||||
|
|
||||||
|
r = e->damages->data;
|
||||||
|
e->damages = evas_list_remove(e->damages, r);
|
||||||
|
e->engine.func->output_redraws_rect_add(e->engine.data.output,
|
||||||
|
r->x, r->y, r->w, r->h);
|
||||||
|
free(r);
|
||||||
|
}
|
||||||
|
/* phase 4. add obscures */
|
||||||
|
for (ll = e->obscures; ll; ll = ll->next)
|
||||||
|
{
|
||||||
|
Evas_Rectangle *r;
|
||||||
|
|
||||||
|
r = ll->data;
|
||||||
|
e->engine.func->output_redraws_rect_del(e->engine.data.output,
|
||||||
|
r->x, r->y, r->w, r->h);
|
||||||
|
}
|
||||||
|
/* build obscure objects list of active objects that obscure */
|
||||||
|
for (ll = active_objects; ll; ll = ll->next)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
|
||||||
|
obj = (Evas_Object *)(ll->data);
|
||||||
|
if (evas_object_is_opaque(obj) && evas_object_is_visible(obj) &&
|
||||||
|
(!obj->clip.clipees) && (obj->cur.color.a >= 255))
|
||||||
|
obscuring_objects = evas_list_append(obscuring_objects, obj);
|
||||||
|
}
|
||||||
|
/* save this list */
|
||||||
|
obscuring_objects_orig = obscuring_objects;
|
||||||
|
obscuring_objects = NULL;
|
||||||
|
/* phase 5. go thu each update rect and render objects in it*/
|
||||||
|
while ((surface =
|
||||||
|
e->engine.func->output_redraws_next_update_get(e->engine.data.output,
|
||||||
|
&ux, &uy, &uw, &uh,
|
||||||
|
&cx, &cy, &cw, &ch)))
|
||||||
|
{
|
||||||
|
Evas_Rectangle *rect;
|
||||||
|
int off_x, off_y;
|
||||||
|
|
||||||
|
rect = malloc(sizeof(Evas_Rectangle));
|
||||||
|
if (rect)
|
||||||
|
{
|
||||||
|
rect->x = ux; rect->y = uy; rect->w = uw; rect->h = uh;
|
||||||
|
updates = evas_list_append(updates, rect);
|
||||||
|
}
|
||||||
|
off_x = cx - ux;
|
||||||
|
off_y = cy - uy;
|
||||||
|
/* build obscuring objects list (in order from bottom to top) */
|
||||||
|
for (ll = obscuring_objects_orig; ll; ll = ll->next)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
|
||||||
|
obj = (Evas_Object *)(ll->data);
|
||||||
|
if (evas_object_is_in_output_rect(obj, ux, uy, uw, uh))
|
||||||
|
obscuring_objects = evas_list_append(obscuring_objects, obj);
|
||||||
|
}
|
||||||
|
/* render all object that intersect with rect */
|
||||||
|
for (ll = active_objects; ll; ll = ll->next)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
Evas_List *l3;
|
||||||
|
obj = (Evas_Object *)(ll->data);
|
||||||
|
/* if its in our outpout rect and it doesnt clip anything */
|
||||||
|
if (evas_object_is_in_output_rect(obj, ux, uy, uw, uh) &&
|
||||||
|
(!obj->clip.clipees) &&
|
||||||
|
(obj->cur.visible) &&
|
||||||
|
(!obj->delete_me) &&
|
||||||
|
(obj->cur.cache.clip.visible) &&
|
||||||
|
(obj->cur.color.a > 0))
|
||||||
|
{
|
||||||
|
int x, y, w, h;
|
||||||
|
|
||||||
|
if ((obscuring_objects) && (obscuring_objects->data == obj))
|
||||||
|
obscuring_objects = evas_list_remove(obscuring_objects, obj);
|
||||||
|
x = cx; y = cy; w = cw; h = ch;
|
||||||
|
RECTS_CLIP_TO_RECT(x, y, w, h,
|
||||||
|
obj->cur.cache.clip.x + off_x,
|
||||||
|
obj->cur.cache.clip.y + off_y,
|
||||||
|
obj->cur.cache.clip.w,
|
||||||
|
obj->cur.cache.clip.h);
|
||||||
|
if ((w > 0) && (h > 0))
|
||||||
|
{
|
||||||
|
e->engine.func->context_clip_set(e->engine.data.output,
|
||||||
|
e->engine.data.context,
|
||||||
|
x, y, w, h);
|
||||||
|
#if 1 /* FIXME: this can slow things down... figure out optimum... coverage */
|
||||||
|
for (l3 = obscuring_objects; l3; l3 = l3->next)
|
||||||
|
{
|
||||||
|
Evas_Object *obj2;
|
||||||
|
|
||||||
|
obj2 = (Evas_Object *)l3->data;
|
||||||
|
e->engine.func->context_cutout_add(e->engine.data.output,
|
||||||
|
e->engine.data.context,
|
||||||
|
obj2->cur.cache.clip.x + off_x,
|
||||||
|
obj2->cur.cache.clip.y + off_y,
|
||||||
|
obj2->cur.cache.clip.w,
|
||||||
|
obj2->cur.cache.clip.h);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
obj->func->render(obj,
|
||||||
|
e->engine.data.output,
|
||||||
|
e->engine.data.context,
|
||||||
|
surface,
|
||||||
|
off_x, off_y);
|
||||||
|
e->engine.func->context_cutout_clear(e->engine.data.output,
|
||||||
|
e->engine.data.context);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* punch rect out */
|
||||||
|
e->engine.func->output_redraws_next_update_push(e->engine.data.output,
|
||||||
|
surface,
|
||||||
|
ux, uy, uw, uh);
|
||||||
|
/* free obscuring objects list */
|
||||||
|
obscuring_objects = evas_list_free(obscuring_objects);
|
||||||
|
}
|
||||||
|
/* flush redraws */
|
||||||
|
e->engine.func->output_flush(e->engine.data.output);
|
||||||
|
/* clear redraws */
|
||||||
|
e->engine.func->output_redraws_clear(e->engine.data.output);
|
||||||
|
/* and do a post render pass */
|
||||||
|
for (l = (Evas_Object_List *)e->layers; l; l = l->next)
|
||||||
|
{
|
||||||
|
Evas_Object_List *l2;
|
||||||
|
Evas_Layer *lay;
|
||||||
|
|
||||||
|
lay = (Evas_Layer *)l;
|
||||||
|
for (l2 = (Evas_Object_List *)lay->objects; l2; l2 = l2->next)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
|
||||||
|
obj = (Evas_Object *)l2;
|
||||||
|
obj->pre_render_done = 0;
|
||||||
|
if (obj->changed)
|
||||||
|
{
|
||||||
|
obj->func->render_post(obj);
|
||||||
|
obj->restack = 0;
|
||||||
|
obj->changed = 0;
|
||||||
|
}
|
||||||
|
/* if the object is flagged for deletion - note it */
|
||||||
|
if (obj->delete_me == 2)
|
||||||
|
delete_objects = evas_list_append(delete_objects, obj);
|
||||||
|
if (obj->delete_me) obj->delete_me ++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* delete all objects flagged for deletion now */
|
||||||
|
while (delete_objects)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
|
||||||
|
obj = (Evas_Object *)(delete_objects->data);
|
||||||
|
delete_objects = evas_list_remove(delete_objects, obj);
|
||||||
|
evas_object_free(obj, 1);
|
||||||
|
}
|
||||||
|
/* free our obscuring object list */
|
||||||
|
obscuring_objects_orig = evas_list_free(obscuring_objects_orig);
|
||||||
|
/* free our active object list */
|
||||||
|
active_objects = evas_list_free(active_objects);
|
||||||
|
e->changed = 0;
|
||||||
|
e->viewport.changed = 0;
|
||||||
|
e->output.changed = 0;
|
||||||
|
return updates;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_render_updates_free(Evas_List *updates)
|
||||||
|
{
|
||||||
|
while (updates)
|
||||||
|
{
|
||||||
|
free(updates->data);
|
||||||
|
updates = evas_list_remove(updates, updates->data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_render(Evas *e)
|
||||||
|
{
|
||||||
|
Evas_List *updates;
|
||||||
|
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
|
updates = evas_render_updates(e);
|
||||||
|
if (updates) evas_render_updates_free(updates);
|
||||||
|
}
|
|
@ -0,0 +1,87 @@
|
||||||
|
#include "evas_common.h"
|
||||||
|
#include "evas_private.h"
|
||||||
|
#include "Evas.h"
|
||||||
|
|
||||||
|
/* all public */
|
||||||
|
Evas_Smart *
|
||||||
|
evas_smart_new(char *name,
|
||||||
|
void (*func_add) (Evas_Object *o),
|
||||||
|
void (*func_del) (Evas_Object *o),
|
||||||
|
void (*func_layer_set) (Evas_Object *o, int l),
|
||||||
|
void (*func_raise) (Evas_Object *o),
|
||||||
|
void (*func_lower) (Evas_Object *o),
|
||||||
|
void (*func_stack_above) (Evas_Object *o, Evas_Object *above),
|
||||||
|
void (*func_stack_below) (Evas_Object *o, Evas_Object *below),
|
||||||
|
void (*func_move) (Evas_Object *o, double x, double y),
|
||||||
|
void (*func_resize) (Evas_Object *o, double w, double h),
|
||||||
|
void (*func_show) (Evas_Object *o),
|
||||||
|
void (*func_hide) (Evas_Object *o),
|
||||||
|
void (*func_color_set) (Evas_Object *o, int r, int g, int b, int a),
|
||||||
|
void (*func_clip_set) (Evas_Object *o, Evas_Object *clip),
|
||||||
|
void (*func_clip_unset) (Evas_Object *o),
|
||||||
|
void *data)
|
||||||
|
{
|
||||||
|
Evas_Smart *s;
|
||||||
|
|
||||||
|
if (!name) return NULL;
|
||||||
|
|
||||||
|
s = calloc(1, sizeof(Evas_Smart));
|
||||||
|
if (!s) return NULL;
|
||||||
|
|
||||||
|
s->magic = MAGIC_SMART;
|
||||||
|
|
||||||
|
s->name = strdup(name);
|
||||||
|
|
||||||
|
s->func_add = func_add;
|
||||||
|
s->func_del = func_del;
|
||||||
|
s->func_layer_set = func_layer_set;
|
||||||
|
s->func_raise = func_raise;
|
||||||
|
s->func_lower = func_lower;
|
||||||
|
s->func_stack_above = func_stack_above;
|
||||||
|
s->func_stack_below = func_stack_below;
|
||||||
|
s->func_move = func_move;
|
||||||
|
s->func_resize = func_resize;
|
||||||
|
s->func_show = func_show;
|
||||||
|
s->func_hide = func_hide;
|
||||||
|
s->func_color_set = func_color_set;
|
||||||
|
s->func_clip_set = func_clip_set;
|
||||||
|
s->func_clip_unset = func_clip_unset;
|
||||||
|
s->data = data;
|
||||||
|
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_smart_free(Evas_Smart *s)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(s, Evas_Smart, MAGIC_SMART);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
s->delete_me = 1;
|
||||||
|
if (s->usage > 0) return;
|
||||||
|
if (s->name) free(s->name);
|
||||||
|
free(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
evas_smart_data_get(Evas_Smart *s)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(s, Evas_Smart, MAGIC_SMART);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
return s->data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* internal funcs */
|
||||||
|
void
|
||||||
|
evas_object_smart_use(Evas_Smart *s)
|
||||||
|
{
|
||||||
|
s->usage++;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_smart_unuse(Evas_Smart *s)
|
||||||
|
{
|
||||||
|
s->usage--;
|
||||||
|
if (s->delete_me) evas_smart_free(s);
|
||||||
|
}
|
|
@ -0,0 +1,216 @@
|
||||||
|
#include "evas_common.h"
|
||||||
|
#include "evas_private.h"
|
||||||
|
#include "Evas.h"
|
||||||
|
|
||||||
|
static Evas_Object *evas_object_above_get_internal(Evas_Object *obj);
|
||||||
|
static Evas_Object *evas_object_below_get_internal(Evas_Object *obj);
|
||||||
|
|
||||||
|
static Evas_Object *
|
||||||
|
evas_object_above_get_internal(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
if (((Evas_Object_List *)obj)->next)
|
||||||
|
return (Evas_Object *)(((Evas_Object_List *)obj)->next);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (((Evas_Object_List *)(((Evas_Object *)obj)->layer))->next)
|
||||||
|
{
|
||||||
|
Evas_Layer *l;
|
||||||
|
|
||||||
|
l = (Evas_Layer *)(((Evas_Object_List *)(((Evas_Object *)obj)->layer))->next);
|
||||||
|
return l->objects;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Evas_Object *
|
||||||
|
evas_object_below_get_internal(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
if (((Evas_Object_List *)obj)->prev)
|
||||||
|
return (Evas_Object *)(((Evas_Object_List *)obj)->prev);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (((Evas_Object_List *)(((Evas_Object *)obj)->layer))->prev)
|
||||||
|
{
|
||||||
|
Evas_Layer *l;
|
||||||
|
|
||||||
|
l = (Evas_Layer *)(((Evas_Object_List *)(((Evas_Object *)obj)->layer))->prev);
|
||||||
|
return (Evas_Object *)(((Evas_Object_List *)(l->objects))->last);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_raise(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (obj->smart.smart)
|
||||||
|
{
|
||||||
|
if (obj->smart.smart->func_raise)
|
||||||
|
obj->smart.smart->func_raise(obj);
|
||||||
|
}
|
||||||
|
if (!(((Evas_Object_List *)obj)->next)) return;
|
||||||
|
obj->layer->objects = evas_object_list_remove(obj->layer->objects, obj);
|
||||||
|
obj->layer->objects = evas_object_list_append(obj->layer->objects, obj);
|
||||||
|
if (obj->clip.clipees) return;
|
||||||
|
obj->restack = 1;
|
||||||
|
evas_object_change(obj);
|
||||||
|
if (!obj->smart.smart)
|
||||||
|
{
|
||||||
|
if (evas_object_is_in_output_rect(obj,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y, 1, 1) &&
|
||||||
|
obj->cur.visible)
|
||||||
|
evas_event_feed_mouse_move(obj->layer->evas, obj->layer->evas->pointer.x, obj->layer->evas->pointer.y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_lower(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (obj->smart.smart)
|
||||||
|
{
|
||||||
|
if (obj->smart.smart->func_lower)
|
||||||
|
obj->smart.smart->func_lower(obj);
|
||||||
|
}
|
||||||
|
if (!(((Evas_Object_List *)obj)->prev)) return;
|
||||||
|
obj->layer->objects = evas_object_list_remove(obj->layer->objects, obj);
|
||||||
|
obj->layer->objects = evas_object_list_prepend(obj->layer->objects, obj);
|
||||||
|
if (obj->clip.clipees) return;
|
||||||
|
obj->restack = 1;
|
||||||
|
evas_object_change(obj);
|
||||||
|
if (!obj->smart.smart)
|
||||||
|
{
|
||||||
|
if (evas_object_is_in_output_rect(obj,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y, 1, 1) &&
|
||||||
|
obj->cur.visible)
|
||||||
|
evas_event_feed_mouse_move(obj->layer->evas, obj->layer->evas->pointer.x, obj->layer->evas->pointer.y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_stack_above(Evas_Object *obj, Evas_Object *above)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
MAGIC_CHECK(above, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (obj->smart.smart)
|
||||||
|
{
|
||||||
|
if (obj->smart.smart->func_stack_above)
|
||||||
|
obj->smart.smart->func_stack_above(obj, above);
|
||||||
|
}
|
||||||
|
if (above->layer != obj->layer) return;
|
||||||
|
if (((Evas_Object_List *)obj)->prev == (Evas_Object_List *)above) return;
|
||||||
|
obj->layer->objects = evas_object_list_remove(obj->layer->objects, obj);
|
||||||
|
obj->layer->objects = evas_object_list_append_relative(obj->layer->objects, obj, above);
|
||||||
|
if (obj->clip.clipees) return;
|
||||||
|
obj->restack = 1;
|
||||||
|
evas_object_change(obj);
|
||||||
|
if (!obj->smart.smart)
|
||||||
|
{
|
||||||
|
if (evas_object_is_in_output_rect(obj,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y, 1, 1) &&
|
||||||
|
obj->cur.visible)
|
||||||
|
evas_event_feed_mouse_move(obj->layer->evas, obj->layer->evas->pointer.x, obj->layer->evas->pointer.y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_object_stack_below(Evas_Object *obj, Evas_Object *below)
|
||||||
|
{
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
MAGIC_CHECK(below, Evas_Object, MAGIC_OBJ);
|
||||||
|
return;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (obj->smart.smart)
|
||||||
|
{
|
||||||
|
if (obj->smart.smart->func_stack_below)
|
||||||
|
obj->smart.smart->func_stack_below(obj, below);
|
||||||
|
}
|
||||||
|
if (below->layer != obj->layer) return;
|
||||||
|
if (((Evas_Object_List *)obj)->next == (Evas_Object_List *)below) return;
|
||||||
|
obj->layer->objects = evas_object_list_remove(obj->layer->objects, obj);
|
||||||
|
obj->layer->objects = evas_object_list_prepend_relative(obj->layer->objects, obj, below);
|
||||||
|
if (obj->clip.clipees) return;
|
||||||
|
obj->restack = 1;
|
||||||
|
evas_object_change(obj);
|
||||||
|
if (!obj->smart.smart)
|
||||||
|
{
|
||||||
|
if (evas_object_is_in_output_rect(obj,
|
||||||
|
obj->layer->evas->pointer.x,
|
||||||
|
obj->layer->evas->pointer.y, 1, 1) &&
|
||||||
|
obj->cur.visible)
|
||||||
|
evas_event_feed_mouse_move(obj->layer->evas, obj->layer->evas->pointer.x, obj->layer->evas->pointer.y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_Object *
|
||||||
|
evas_object_above_get(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object *obj2;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
obj2 = evas_object_above_get_internal(obj);
|
||||||
|
while ((obj2) && (obj2->smart.parent))
|
||||||
|
obj2 = evas_object_above_get_internal(obj2);
|
||||||
|
return obj2;
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_Object *
|
||||||
|
evas_object_below_get(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object *obj2;
|
||||||
|
|
||||||
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
obj2 = evas_object_below_get_internal(obj);
|
||||||
|
while ((obj2) && (obj2->smart.parent))
|
||||||
|
obj2 = evas_object_below_get_internal(obj2);
|
||||||
|
return obj2;
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_Object *
|
||||||
|
evas_object_bottom_get(Evas *e)
|
||||||
|
{
|
||||||
|
Evas_Object *obj2;
|
||||||
|
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (e->layers)
|
||||||
|
obj2 = e->layers->objects;
|
||||||
|
while ((obj2) && (obj2->smart.parent))
|
||||||
|
obj2 = evas_object_above_get_internal(obj2);
|
||||||
|
return obj2;
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_Object *
|
||||||
|
evas_object_top_get(Evas *e)
|
||||||
|
{
|
||||||
|
Evas_Object *obj2;
|
||||||
|
|
||||||
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||||
|
return NULL;
|
||||||
|
MAGIC_CHECK_END();
|
||||||
|
if (e->layers)
|
||||||
|
obj2 = (Evas_Object *)(((Evas_List *)(((Evas_Layer *)(((Evas_Object_List *)(e->layers))->last))->objects))->last);
|
||||||
|
while ((obj2) && (obj2->smart.parent))
|
||||||
|
obj2 = evas_object_below_get_internal(obj2);
|
||||||
|
return obj2;
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
## Process this file with automake to produce Makefile.in
|
||||||
|
|
||||||
|
AUTOMAKE_OPTIONS = 1.4 foreign
|
||||||
|
|
||||||
|
# A list of all the files in the current directory which can be regenerated
|
||||||
|
MAINTAINERCLEANFILES = Makefile.in
|
||||||
|
|
||||||
|
LDFLAGS = -L/usr/local/lib
|
||||||
|
INCLUDES = \
|
||||||
|
-I. \
|
||||||
|
-I$(top_srcdir)/src/lib \
|
||||||
|
-I$(top_srcdir)/src/lib/include \
|
||||||
|
-I$(includedir) \
|
||||||
|
-I/usr/local/include \
|
||||||
|
@freetype_cflags@
|
||||||
|
|
||||||
|
noinst_LTLIBRARIES = libevas_data.la
|
||||||
|
libevas_data_la_SOURCES = \
|
||||||
|
evas_hash.c \
|
||||||
|
evas_list.c \
|
||||||
|
evas_object_list.c
|
||||||
|
|
||||||
|
libevas_data_la_LIBADD = $(LDFLAGS)
|
||||||
|
libevas_data_la_DEPENDENCIES = $(top_builddir)/config.h
|
|
@ -0,0 +1,161 @@
|
||||||
|
#include "evas_common.h"
|
||||||
|
#include "evas_private.h"
|
||||||
|
#include "Evas.h"
|
||||||
|
|
||||||
|
static int evas_hash_gen(const char *key);
|
||||||
|
|
||||||
|
static int
|
||||||
|
evas_hash_gen(const char *key)
|
||||||
|
{
|
||||||
|
unsigned int hash_num = 0;
|
||||||
|
const unsigned char *ptr;
|
||||||
|
|
||||||
|
if (!key) return 0;
|
||||||
|
|
||||||
|
for (ptr = (unsigned char *)key; *ptr; ptr++) hash_num ^= (int)(*ptr);
|
||||||
|
|
||||||
|
hash_num &= 0xff;
|
||||||
|
return (int)hash_num;
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_Hash *
|
||||||
|
evas_hash_add(Evas_Hash *hash, const char *key, void *data)
|
||||||
|
{
|
||||||
|
int hash_num;
|
||||||
|
Evas_Hash_El *el;
|
||||||
|
|
||||||
|
if (!hash)
|
||||||
|
{
|
||||||
|
hash = malloc(sizeof(struct _Evas_Hash));
|
||||||
|
if (!hash) return NULL;
|
||||||
|
memset(hash, 0, sizeof(struct _Evas_Hash));
|
||||||
|
}
|
||||||
|
if (!(el = malloc(sizeof(struct _Evas_Hash_El))))
|
||||||
|
{
|
||||||
|
if (hash->population <= 0)
|
||||||
|
free(hash);
|
||||||
|
return NULL;
|
||||||
|
};
|
||||||
|
if (key)
|
||||||
|
{
|
||||||
|
el->key = strdup(key);
|
||||||
|
hash_num = evas_hash_gen(key);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
el->key = NULL;
|
||||||
|
hash_num = 0;
|
||||||
|
}
|
||||||
|
el->data = data;
|
||||||
|
hash->buckets[hash_num] = evas_object_list_prepend(hash->buckets[hash_num], el);
|
||||||
|
hash->population++;
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_Hash *
|
||||||
|
evas_hash_del(Evas_Hash *hash, const char *key, void *data)
|
||||||
|
{
|
||||||
|
int hash_num;
|
||||||
|
Evas_Hash_El *el;
|
||||||
|
Evas_Object_List *l;
|
||||||
|
|
||||||
|
if (!hash) return NULL;
|
||||||
|
hash_num = evas_hash_gen(key);
|
||||||
|
for (l = hash->buckets[hash_num]; l; l = l->next)
|
||||||
|
{
|
||||||
|
el = (Evas_Hash_El *)l;
|
||||||
|
if ((((el->key) && (key) && (!strcmp(el->key, key))) ||
|
||||||
|
((!el->key) && (!key))) && (el->data == data))
|
||||||
|
{
|
||||||
|
hash->buckets[hash_num] = evas_object_list_remove(hash->buckets[hash_num], el);
|
||||||
|
if (el->key) free(el->key);
|
||||||
|
free(el);
|
||||||
|
hash->population--;
|
||||||
|
if (hash->population <= 0)
|
||||||
|
{
|
||||||
|
free(hash);
|
||||||
|
hash = NULL;
|
||||||
|
}
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
evas_hash_find(Evas_Hash *hash, const char *key)
|
||||||
|
{
|
||||||
|
int hash_num;
|
||||||
|
Evas_Hash_El *el;
|
||||||
|
Evas_Object_List *l;
|
||||||
|
|
||||||
|
if (!hash) return NULL;
|
||||||
|
hash_num = evas_hash_gen(key);
|
||||||
|
for (l = hash->buckets[hash_num]; l; l = l->next)
|
||||||
|
{
|
||||||
|
el = (Evas_Hash_El *)l;
|
||||||
|
if (((el->key) && (key) && (!strcmp(el->key, key))) ||
|
||||||
|
((!el->key) && (!key)))
|
||||||
|
{
|
||||||
|
if (l != hash->buckets[hash_num])
|
||||||
|
{
|
||||||
|
hash->buckets[hash_num] = evas_object_list_remove(hash->buckets[hash_num], el);
|
||||||
|
hash->buckets[hash_num] = evas_object_list_prepend(hash->buckets[hash_num], el);
|
||||||
|
}
|
||||||
|
return el->data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
evas_hash_size(Evas_Hash *hash)
|
||||||
|
{
|
||||||
|
if (!hash) return 0;
|
||||||
|
return 256;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_hash_free(Evas_Hash *hash)
|
||||||
|
{
|
||||||
|
int i, size;
|
||||||
|
|
||||||
|
if (!hash) return;
|
||||||
|
size = evas_hash_size(hash);
|
||||||
|
for (i = 0; i < size; i++)
|
||||||
|
{
|
||||||
|
while (hash->buckets[i])
|
||||||
|
{
|
||||||
|
Evas_Hash_El *el;
|
||||||
|
|
||||||
|
el = (Evas_Hash_El *)hash->buckets[i];
|
||||||
|
if (el->key) free(el->key);
|
||||||
|
hash->buckets[i] = evas_object_list_remove(hash->buckets[i], el);
|
||||||
|
free(el);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
free(hash);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evas_hash_foreach(Evas_Hash *hash, int (*func) (Evas_Hash *hash, const char *key, void *data, void *fdata), void *fdata)
|
||||||
|
{
|
||||||
|
int i, size;
|
||||||
|
|
||||||
|
if (!hash) return;
|
||||||
|
size = evas_hash_size(hash);
|
||||||
|
for (i = 0; i < size; i++)
|
||||||
|
{
|
||||||
|
Evas_Object_List *l, *next_l;
|
||||||
|
|
||||||
|
for (l = hash->buckets[i]; l;)
|
||||||
|
{
|
||||||
|
Evas_Hash_El *el;
|
||||||
|
|
||||||
|
next_l = l->next;
|
||||||
|
el = (Evas_Hash_El *)l;
|
||||||
|
func(hash, el->key, el->data, fdata);
|
||||||
|
l = next_l;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,263 @@
|
||||||
|
#include "evas_common.h"
|
||||||
|
#include "evas_private.h"
|
||||||
|
#include "Evas.h"
|
||||||
|
|
||||||
|
/* list ops */
|
||||||
|
Evas_List *
|
||||||
|
evas_list_append(Evas_List *list, void *data)
|
||||||
|
{
|
||||||
|
Evas_List *l, *new_l;
|
||||||
|
|
||||||
|
new_l = malloc(sizeof(Evas_List));
|
||||||
|
new_l->next = NULL;
|
||||||
|
new_l->prev = NULL;
|
||||||
|
new_l->data = data;
|
||||||
|
if (!list)
|
||||||
|
{
|
||||||
|
new_l->last = new_l;
|
||||||
|
new_l->count = 1;
|
||||||
|
return new_l;
|
||||||
|
}
|
||||||
|
if (list->last)
|
||||||
|
{
|
||||||
|
l = list->last;
|
||||||
|
l->next = new_l;
|
||||||
|
new_l->prev = l;
|
||||||
|
list->last = new_l;
|
||||||
|
list->count++;
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (l = list; l; l = l->next)
|
||||||
|
{
|
||||||
|
if (!l->next)
|
||||||
|
{
|
||||||
|
l->next = new_l;
|
||||||
|
new_l->prev = l;
|
||||||
|
list->last = new_l;
|
||||||
|
list->count++;
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_List *
|
||||||
|
evas_list_prepend(Evas_List *list, void *data)
|
||||||
|
{
|
||||||
|
Evas_List *new_l;
|
||||||
|
|
||||||
|
new_l = malloc(sizeof(Evas_List));
|
||||||
|
new_l->prev = NULL;
|
||||||
|
new_l->data = data;
|
||||||
|
if (!list)
|
||||||
|
{
|
||||||
|
new_l->next = NULL;
|
||||||
|
new_l->last = new_l;
|
||||||
|
new_l->count = 1;
|
||||||
|
return new_l;
|
||||||
|
}
|
||||||
|
new_l->next = list;
|
||||||
|
list->prev = new_l;
|
||||||
|
new_l->last = list->last;
|
||||||
|
list->last = NULL;
|
||||||
|
new_l->count = list->count + 1;
|
||||||
|
return new_l;
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_List *
|
||||||
|
evas_list_append_relative(Evas_List *list, void *data, void *relative)
|
||||||
|
{
|
||||||
|
Evas_List *l;
|
||||||
|
|
||||||
|
for (l = list; l; l = l->next)
|
||||||
|
{
|
||||||
|
if (l->data == relative)
|
||||||
|
{
|
||||||
|
Evas_List *new_l;
|
||||||
|
|
||||||
|
new_l = malloc(sizeof(Evas_List));
|
||||||
|
new_l->data = data;
|
||||||
|
if (l->next)
|
||||||
|
{
|
||||||
|
new_l->next = l->next;
|
||||||
|
l->next->prev = new_l;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
new_l->next = NULL;
|
||||||
|
|
||||||
|
l->next = new_l;
|
||||||
|
new_l->prev = l;
|
||||||
|
if (!new_l->next) list->last = new_l;
|
||||||
|
list->count++;
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return evas_list_append(list, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_List *
|
||||||
|
evas_list_prepend_relative(Evas_List *list, void *data, void *relative)
|
||||||
|
{
|
||||||
|
Evas_List *l;
|
||||||
|
|
||||||
|
for (l = list; l; l = l->next)
|
||||||
|
{
|
||||||
|
if (l->data == relative)
|
||||||
|
{
|
||||||
|
Evas_List *new_l;
|
||||||
|
|
||||||
|
new_l = malloc(sizeof(Evas_List));
|
||||||
|
new_l->data = data;
|
||||||
|
new_l->prev = l->prev;
|
||||||
|
new_l->next = l;
|
||||||
|
if (l->prev) l->prev->next = new_l;
|
||||||
|
l->prev = new_l;
|
||||||
|
if (new_l->prev)
|
||||||
|
{
|
||||||
|
if (!new_l->next) list->last = new_l;
|
||||||
|
list->count++;
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
new_l->last = list->last;
|
||||||
|
list->last = NULL;
|
||||||
|
new_l->count = list->count + 1;
|
||||||
|
return new_l;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return evas_list_prepend(list, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_List *
|
||||||
|
evas_list_remove(Evas_List *list, void *data)
|
||||||
|
{
|
||||||
|
Evas_List *l;
|
||||||
|
|
||||||
|
for (l = list; l; l = l->next)
|
||||||
|
{
|
||||||
|
if (l->data == data)
|
||||||
|
return evas_list_remove_list(list, l);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_List *
|
||||||
|
evas_list_remove_list(Evas_List *list, Evas_List *remove_list)
|
||||||
|
{
|
||||||
|
Evas_List *return_l;
|
||||||
|
|
||||||
|
if (!remove_list) return list;
|
||||||
|
if (remove_list->next) remove_list->next->prev = remove_list->prev;
|
||||||
|
if (remove_list->prev)
|
||||||
|
{
|
||||||
|
remove_list->prev->next = remove_list->next;
|
||||||
|
return_l = list;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (remove_list->next)
|
||||||
|
remove_list->next->count = remove_list->count;
|
||||||
|
return_l = remove_list->next;
|
||||||
|
if (return_l) return_l->last = list->last;
|
||||||
|
}
|
||||||
|
if (remove_list == list->last) list->last = remove_list->prev;
|
||||||
|
free(remove_list);
|
||||||
|
if (return_l) return_l->count--;
|
||||||
|
return return_l;
|
||||||
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
evas_list_find(Evas_List *list, void *data)
|
||||||
|
{
|
||||||
|
Evas_List *l;
|
||||||
|
|
||||||
|
for (l = list; l; l = l->next)
|
||||||
|
{
|
||||||
|
if (l->data == data) return data;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_List *
|
||||||
|
evas_list_free(Evas_List *list)
|
||||||
|
{
|
||||||
|
Evas_List *l, *free_l;
|
||||||
|
|
||||||
|
for (l = list; l;)
|
||||||
|
{
|
||||||
|
free_l = l;
|
||||||
|
l = l->next;
|
||||||
|
free(free_l);
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_List *
|
||||||
|
evas_list_last(Evas_List *list)
|
||||||
|
{
|
||||||
|
if (!list) return NULL;
|
||||||
|
return list->last;
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_List *
|
||||||
|
evas_list_next(Evas_List *list)
|
||||||
|
{
|
||||||
|
if (!list) return NULL;
|
||||||
|
return list->next;
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_List *
|
||||||
|
evas_list_prev(Evas_List *list)
|
||||||
|
{
|
||||||
|
if (!list) return NULL;
|
||||||
|
return list->prev;
|
||||||
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
evas_list_data(Evas_List *list)
|
||||||
|
{
|
||||||
|
if (!list) return NULL;
|
||||||
|
return list->data;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
evas_list_count(Evas_List *list)
|
||||||
|
{
|
||||||
|
if (!list) return 0;
|
||||||
|
return list->count;
|
||||||
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
evas_list_nth(Evas_List *list, int n)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
Evas_List *l;
|
||||||
|
|
||||||
|
if (n < 0) return NULL;
|
||||||
|
for (i = 0, l = list; l; l = l->next, i++)
|
||||||
|
{
|
||||||
|
if (i == n) return l->data;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_List *
|
||||||
|
evas_list_reverse(Evas_List *list)
|
||||||
|
{
|
||||||
|
Evas_List *new_l = NULL;
|
||||||
|
|
||||||
|
while (list)
|
||||||
|
{
|
||||||
|
void *data;
|
||||||
|
|
||||||
|
data = list->data;
|
||||||
|
list = evas_list_remove_list(list, list);
|
||||||
|
new_l = evas_list_prepend(new_l, data);
|
||||||
|
}
|
||||||
|
return new_l;
|
||||||
|
}
|
|
@ -0,0 +1,172 @@
|
||||||
|
#include "evas_common.h"
|
||||||
|
|
||||||
|
/* list ops */
|
||||||
|
void *
|
||||||
|
evas_object_list_append(void *in_list, void *in_item)
|
||||||
|
{
|
||||||
|
Evas_Object_List *l, *new_l;
|
||||||
|
Evas_Object_List *list, *item;
|
||||||
|
|
||||||
|
list = in_list;
|
||||||
|
item = in_item;
|
||||||
|
new_l = item;
|
||||||
|
new_l->next = NULL;
|
||||||
|
if (!list)
|
||||||
|
{
|
||||||
|
new_l->prev = NULL;
|
||||||
|
new_l->last = new_l;
|
||||||
|
return new_l;
|
||||||
|
}
|
||||||
|
if (list->last) l = list->last;
|
||||||
|
else for (l = list; l; l = l->next);
|
||||||
|
l->next = new_l;
|
||||||
|
new_l->prev = l;
|
||||||
|
list->last = new_l;
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
evas_object_list_prepend(void *in_list, void *in_item)
|
||||||
|
{
|
||||||
|
Evas_Object_List *new_l;
|
||||||
|
Evas_Object_List *list, *item;
|
||||||
|
|
||||||
|
list = in_list;
|
||||||
|
item = in_item;
|
||||||
|
new_l = item;
|
||||||
|
new_l->prev = NULL;
|
||||||
|
if (!list)
|
||||||
|
{
|
||||||
|
new_l->next = NULL;
|
||||||
|
new_l->last = new_l;
|
||||||
|
return new_l;
|
||||||
|
}
|
||||||
|
new_l->next = list;
|
||||||
|
list->prev = new_l;
|
||||||
|
new_l->last = list->last;
|
||||||
|
list->last = NULL;
|
||||||
|
return new_l;
|
||||||
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
evas_object_list_append_relative(void *in_list, void *in_item, void *in_relative)
|
||||||
|
{
|
||||||
|
Evas_Object_List *l;
|
||||||
|
Evas_Object_List *list, *item, *relative;
|
||||||
|
|
||||||
|
list = in_list;
|
||||||
|
item = in_item;
|
||||||
|
relative = in_relative;
|
||||||
|
for (l = list; l; l = l->next)
|
||||||
|
{
|
||||||
|
if (l == relative)
|
||||||
|
{
|
||||||
|
Evas_Object_List *new_l;
|
||||||
|
|
||||||
|
new_l = item;
|
||||||
|
if (l->next)
|
||||||
|
{
|
||||||
|
new_l->next = l->next;
|
||||||
|
l->next->prev = new_l;
|
||||||
|
}
|
||||||
|
|
||||||
|
else new_l->next = NULL;
|
||||||
|
l->next = new_l;
|
||||||
|
new_l->prev = l;
|
||||||
|
if (!new_l->next)
|
||||||
|
list->last = new_l;
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return evas_object_list_append(list, item);
|
||||||
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
evas_object_list_prepend_relative(void *in_list, void *in_item, void *in_relative)
|
||||||
|
{
|
||||||
|
Evas_Object_List *l;
|
||||||
|
Evas_Object_List *list, *item, *relative;
|
||||||
|
|
||||||
|
list = in_list;
|
||||||
|
item = in_item;
|
||||||
|
relative = in_relative;
|
||||||
|
for (l = list; l; l = l->next)
|
||||||
|
{
|
||||||
|
if (l == relative)
|
||||||
|
{
|
||||||
|
Evas_Object_List *new_l;
|
||||||
|
|
||||||
|
new_l = item;
|
||||||
|
new_l->prev = l->prev;
|
||||||
|
new_l->next = l;
|
||||||
|
l->prev = new_l;
|
||||||
|
if (new_l->prev)
|
||||||
|
{
|
||||||
|
new_l->prev->next = new_l;
|
||||||
|
if (!new_l->next)
|
||||||
|
list->last = new_l;
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!new_l->next)
|
||||||
|
new_l->last = new_l;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
new_l->last = list->last;
|
||||||
|
list->last = NULL;
|
||||||
|
}
|
||||||
|
return new_l;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return evas_object_list_prepend(list, item);
|
||||||
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
evas_object_list_remove(void *in_list, void *in_item)
|
||||||
|
{
|
||||||
|
Evas_Object_List *return_l;
|
||||||
|
Evas_Object_List *list, *item;
|
||||||
|
|
||||||
|
/* checkme */
|
||||||
|
if(!in_list)
|
||||||
|
return in_list;
|
||||||
|
|
||||||
|
list = in_list;
|
||||||
|
item = in_item;
|
||||||
|
if (!item) return list;
|
||||||
|
if (item->next)
|
||||||
|
item->next->prev = item->prev;
|
||||||
|
if (item->prev)
|
||||||
|
{
|
||||||
|
item->prev->next = item->next;
|
||||||
|
return_l = list;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return_l = item->next;
|
||||||
|
if (return_l)
|
||||||
|
return_l->last = list->last;
|
||||||
|
}
|
||||||
|
if (item == list->last)
|
||||||
|
list->last = item->prev;
|
||||||
|
item->next = NULL;
|
||||||
|
item->prev = NULL;
|
||||||
|
return return_l;
|
||||||
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
evas_object_list_find(void *in_list, void *in_item)
|
||||||
|
{
|
||||||
|
Evas_Object_List *l;
|
||||||
|
Evas_Object_List *list, *item;
|
||||||
|
|
||||||
|
list = in_list;
|
||||||
|
item = in_item;
|
||||||
|
for (l = list; l; l = l->next)
|
||||||
|
{
|
||||||
|
if (l == item) return item;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
## Process this file with automake to produce Makefile.in
|
||||||
|
|
||||||
|
SUBDIRS = \
|
||||||
|
common \
|
||||||
|
software_x11 \
|
||||||
|
fb \
|
||||||
|
software_win32_gdi \
|
||||||
|
software_qtopia \
|
||||||
|
directfb \
|
||||||
|
gl_common \
|
||||||
|
gl_x11
|
|
@ -0,0 +1,58 @@
|
||||||
|
## Process this file with automake to produce Makefile.in
|
||||||
|
|
||||||
|
AUTOMAKE_OPTIONS = 1.4 foreign
|
||||||
|
|
||||||
|
# A list of all the files in the current directory which can be regenerated
|
||||||
|
MAINTAINERCLEANFILES = Makefile.in
|
||||||
|
|
||||||
|
LDFLAGS = -L/usr/local/lib
|
||||||
|
INCLUDES = \
|
||||||
|
-I. \
|
||||||
|
-I$(top_srcdir)/src/lib \
|
||||||
|
-I$(top_srcdir)/src/lib/include \
|
||||||
|
-I$(includedir) \
|
||||||
|
-I/usr/local/include \
|
||||||
|
@freetype_cflags@
|
||||||
|
|
||||||
|
noinst_LTLIBRARIES = libevas_engine_common.la
|
||||||
|
libevas_engine_common_la_SOURCES = \
|
||||||
|
evas_blend_alpha_color_pixel.c \
|
||||||
|
evas_blend_color_pixel.c \
|
||||||
|
evas_blend_main.c \
|
||||||
|
evas_blend_pixel_cmod_pixel.c \
|
||||||
|
evas_blend_pixel_mul_pixel.c \
|
||||||
|
evas_blend_pixel_pixel.c \
|
||||||
|
evas_blit_main.c \
|
||||||
|
evas_convert_color.c \
|
||||||
|
evas_convert_gry_1.c \
|
||||||
|
evas_convert_gry_4.c \
|
||||||
|
evas_convert_gry_8.c \
|
||||||
|
evas_convert_main.c \
|
||||||
|
evas_convert_rgb_16.c \
|
||||||
|
evas_convert_rgb_24.c \
|
||||||
|
evas_convert_rgb_32.c \
|
||||||
|
evas_convert_rgb_8.c \
|
||||||
|
evas_cpu.c \
|
||||||
|
evas_draw_main.c \
|
||||||
|
evas_font_draw.c \
|
||||||
|
evas_font_load.c \
|
||||||
|
evas_font_main.c \
|
||||||
|
evas_font_query.c \
|
||||||
|
evas_gradient_main.c \
|
||||||
|
evas_image_load.c \
|
||||||
|
evas_image_main.c \
|
||||||
|
evas_line_main.c \
|
||||||
|
evas_polygon_main.c \
|
||||||
|
evas_rectangle_main.c \
|
||||||
|
evas_scale_main.c \
|
||||||
|
evas_scale_sample.c \
|
||||||
|
evas_scale_smooth.c \
|
||||||
|
evas_tiler.c
|
||||||
|
|
||||||
|
EXTRA_DIST = evas_scale_smooth_scaler.c
|
||||||
|
|
||||||
|
libevas_engine_common_la_LIBADD = \
|
||||||
|
$(LDFLAGS)
|
||||||
|
|
||||||
|
libevas_engine_common_la_DEPENDENCIES = \
|
||||||
|
$(top_builddir)/config.h
|
|
@ -0,0 +1,142 @@
|
||||||
|
#include "evas_common.h"
|
||||||
|
|
||||||
|
#ifdef BUILD_MMX
|
||||||
|
#include "evas_mmx.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern DATA8 pow_lut[256][256];
|
||||||
|
extern const DATA16 const_c1[4];
|
||||||
|
|
||||||
|
#ifdef BUILD_C
|
||||||
|
void
|
||||||
|
blend_alpha_color_rgba_to_rgb_c (DATA8 *src, DATA32 *dst, int len, DATA32 col)
|
||||||
|
{
|
||||||
|
DATA8 *src_ptr;
|
||||||
|
DATA32 *dst_ptr, *dst_end_ptr;
|
||||||
|
|
||||||
|
src_ptr = src;
|
||||||
|
dst_ptr = dst;
|
||||||
|
dst_end_ptr = dst + len;
|
||||||
|
|
||||||
|
while (dst_ptr < dst_end_ptr)
|
||||||
|
{
|
||||||
|
DATA32 tmp;
|
||||||
|
DATA8 aa;
|
||||||
|
|
||||||
|
aa = (((*src_ptr) +1) * A_VAL(&col)) >> 8;
|
||||||
|
BLEND_COLOR(aa, R_VAL(dst_ptr),
|
||||||
|
R_VAL(&col), R_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
BLEND_COLOR(aa, G_VAL(dst_ptr),
|
||||||
|
G_VAL(&col), G_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
BLEND_COLOR(aa, B_VAL(dst_ptr),
|
||||||
|
B_VAL(&col), B_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
src_ptr++;
|
||||||
|
dst_ptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef BUILD_MMX
|
||||||
|
void
|
||||||
|
blend_alpha_color_rgba_to_rgb_mmx (DATA8 *src, DATA32 *dst, int len, DATA32 col)
|
||||||
|
{
|
||||||
|
DATA8 *src_ptr;
|
||||||
|
DATA32 *dst_ptr, *dst_end_ptr;
|
||||||
|
|
||||||
|
src_ptr = src;
|
||||||
|
dst_ptr = dst;
|
||||||
|
dst_end_ptr = dst + len;
|
||||||
|
|
||||||
|
pxor_r2r(mm6, mm6);
|
||||||
|
movd_m2r(col, mm1);
|
||||||
|
punpcklbw_r2r(mm1, mm6);
|
||||||
|
psrlw_i2r(8, mm6);
|
||||||
|
movq_m2r(*const_c1, mm5);
|
||||||
|
paddw_r2r(mm5, mm6);
|
||||||
|
|
||||||
|
pxor_r2r(mm4, mm4);
|
||||||
|
|
||||||
|
while (dst_ptr < dst_end_ptr)
|
||||||
|
{
|
||||||
|
DATA32 tmp;
|
||||||
|
|
||||||
|
tmp = 0xffffff;
|
||||||
|
A_VAL(&tmp) = *src_ptr;
|
||||||
|
|
||||||
|
movd_m2r(tmp, mm1);
|
||||||
|
|
||||||
|
/* this could be more optimial.. but it beats the c code by almost */
|
||||||
|
/* double */
|
||||||
|
pxor_r2r(mm7, mm7);
|
||||||
|
punpcklbw_r2r(mm1, mm7);
|
||||||
|
psrlw_i2r(8, mm7);
|
||||||
|
pmullw_r2r(mm6, mm7);
|
||||||
|
psrlw_i2r(8, mm7);
|
||||||
|
packuswb_r2r(mm7, mm7);
|
||||||
|
movq_r2r(mm7, mm1);
|
||||||
|
/* and back to our normal programming... */
|
||||||
|
movd_m2r(dst_ptr[0], mm2);
|
||||||
|
|
||||||
|
movq_r2r(mm1, mm3);
|
||||||
|
|
||||||
|
punpcklbw_r2r(mm3, mm3);
|
||||||
|
punpckhwd_r2r(mm3, mm3);
|
||||||
|
punpckhdq_r2r(mm3, mm3);
|
||||||
|
psrlw_i2r(1, mm3);
|
||||||
|
|
||||||
|
psrlq_i2r(16, mm3);
|
||||||
|
|
||||||
|
punpcklbw_r2r(mm4, mm1);
|
||||||
|
punpcklbw_r2r(mm4, mm2);
|
||||||
|
|
||||||
|
psubw_r2r(mm2, mm1);
|
||||||
|
psllw_i2r(1, mm1);
|
||||||
|
paddw_r2r(mm5, mm1);
|
||||||
|
pmulhw_r2r(mm3, mm1);
|
||||||
|
paddw_r2r(mm1, mm2);
|
||||||
|
|
||||||
|
packuswb_r2r(mm4, mm2);
|
||||||
|
movd_r2m(mm2, dst_ptr[0]);
|
||||||
|
|
||||||
|
src_ptr++;
|
||||||
|
dst_ptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void
|
||||||
|
blend_alpha_color_rgba_to_rgba_c (DATA8 *src, DATA32 *dst, int len, DATA32 col)
|
||||||
|
{
|
||||||
|
DATA8 *src_ptr;
|
||||||
|
DATA32 *dst_ptr, *dst_end_ptr;
|
||||||
|
|
||||||
|
src_ptr = src;
|
||||||
|
dst_ptr = dst;
|
||||||
|
dst_end_ptr = dst + len;
|
||||||
|
|
||||||
|
while (dst_ptr < dst_end_ptr)
|
||||||
|
{
|
||||||
|
DATA32 tmp;
|
||||||
|
DATA8 a;
|
||||||
|
DATA8 aa;
|
||||||
|
|
||||||
|
aa = (((*src_ptr) + 1) * A_VAL(&col)) >> 8;
|
||||||
|
a = pow_lut[aa][A_VAL(dst_ptr)];
|
||||||
|
|
||||||
|
BLEND_COLOR(a, R_VAL(dst_ptr),
|
||||||
|
R_VAL(&col), R_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
BLEND_COLOR(a, G_VAL(dst_ptr),
|
||||||
|
G_VAL(&col), G_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
BLEND_COLOR(a, B_VAL(dst_ptr),
|
||||||
|
B_VAL(&col), B_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
A_VAL(dst_ptr) = A_VAL(dst_ptr) + ((aa * (255 - A_VAL(dst_ptr))) / 255);
|
||||||
|
src_ptr++;
|
||||||
|
dst_ptr++;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,215 @@
|
||||||
|
#include "evas_common.h"
|
||||||
|
|
||||||
|
#ifdef BUILD_MMX
|
||||||
|
#include "evas_mmx.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern DATA8 pow_lut[256][256];
|
||||||
|
extern const DATA16 const_c1[4];
|
||||||
|
|
||||||
|
#ifdef BUILD_C
|
||||||
|
void
|
||||||
|
blend_color_rgba_to_rgb_c(DATA32 src, DATA32 *dst, int len)
|
||||||
|
{
|
||||||
|
DATA32 *dst_ptr, *dst_end_ptr;
|
||||||
|
|
||||||
|
dst_ptr = dst;
|
||||||
|
dst_end_ptr = dst + len;
|
||||||
|
|
||||||
|
while (dst_ptr < dst_end_ptr)
|
||||||
|
{
|
||||||
|
DATA32 tmp;
|
||||||
|
|
||||||
|
BLEND_COLOR(A_VAL(&src), R_VAL(dst_ptr),
|
||||||
|
R_VAL(&src), R_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
BLEND_COLOR(A_VAL(&src), G_VAL(dst_ptr),
|
||||||
|
G_VAL(&src), G_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
BLEND_COLOR(A_VAL(&src), B_VAL(dst_ptr),
|
||||||
|
B_VAL(&src), B_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
dst_ptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef BUILD_MMX
|
||||||
|
void
|
||||||
|
blend_color_rgba_to_rgb_mmx(DATA32 src, DATA32 *dst, int len)
|
||||||
|
{
|
||||||
|
DATA32 *dst_ptr, *dst_end_ptr;
|
||||||
|
|
||||||
|
dst_ptr = dst;
|
||||||
|
dst_end_ptr = dst + len;
|
||||||
|
|
||||||
|
pxor_r2r(mm4, mm4);
|
||||||
|
movq_m2r(*const_c1, mm5);
|
||||||
|
|
||||||
|
movd_m2r(src, mm6);
|
||||||
|
|
||||||
|
movq_r2r(mm6, mm3);
|
||||||
|
punpcklbw_r2r(mm3, mm3);
|
||||||
|
punpckhwd_r2r(mm3, mm3);
|
||||||
|
punpckhdq_r2r(mm3, mm3);
|
||||||
|
psrlw_i2r(1, mm3);
|
||||||
|
|
||||||
|
psrlq_i2r(16, mm3);
|
||||||
|
|
||||||
|
while (dst_ptr < dst_end_ptr)
|
||||||
|
{
|
||||||
|
movq_r2r(mm6, mm1);
|
||||||
|
|
||||||
|
movd_m2r(dst_ptr[0], mm2);
|
||||||
|
|
||||||
|
punpcklbw_r2r(mm4, mm1);
|
||||||
|
punpcklbw_r2r(mm4, mm2);
|
||||||
|
|
||||||
|
psubw_r2r(mm2, mm1);
|
||||||
|
psllw_i2r(1, mm1);
|
||||||
|
paddw_r2r(mm5, mm1);
|
||||||
|
pmulhw_r2r(mm3, mm1);
|
||||||
|
paddw_r2r(mm1, mm2);
|
||||||
|
|
||||||
|
packuswb_r2r(mm4, mm2);
|
||||||
|
movd_r2m(mm2, dst_ptr[0]);
|
||||||
|
|
||||||
|
dst_ptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/****************************************************************************/
|
||||||
|
|
||||||
|
void
|
||||||
|
blend_color_rgba_to_rgba_c(DATA32 src, DATA32 *dst, int len)
|
||||||
|
{
|
||||||
|
DATA32 *dst_ptr, *dst_end_ptr;
|
||||||
|
|
||||||
|
dst_ptr = dst;
|
||||||
|
dst_end_ptr = dst + len;
|
||||||
|
|
||||||
|
while (dst_ptr < dst_end_ptr)
|
||||||
|
{
|
||||||
|
DATA32 tmp;
|
||||||
|
DATA8 a;
|
||||||
|
|
||||||
|
a = pow_lut[A_VAL(&src)][A_VAL(dst_ptr)];
|
||||||
|
|
||||||
|
BLEND_COLOR(a, R_VAL(dst_ptr),
|
||||||
|
R_VAL(&src), R_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
BLEND_COLOR(a, G_VAL(dst_ptr),
|
||||||
|
G_VAL(&src), G_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
BLEND_COLOR(a, B_VAL(dst_ptr),
|
||||||
|
B_VAL(&src), B_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
A_VAL(dst_ptr) = A_VAL(dst_ptr) + ((A_VAL(&src) * (255 - A_VAL(dst_ptr))) / 255);
|
||||||
|
|
||||||
|
dst_ptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef BUILD_C
|
||||||
|
void
|
||||||
|
copy_color_rgba_to_rgba_c(DATA32 src, DATA32 *dst, int len)
|
||||||
|
{
|
||||||
|
DATA32 *dst_ptr, *dst_end_ptr;
|
||||||
|
|
||||||
|
dst_ptr = dst;
|
||||||
|
dst_end_ptr = dst + len;
|
||||||
|
|
||||||
|
while (dst_ptr < dst_end_ptr)
|
||||||
|
{
|
||||||
|
*dst_ptr = src;
|
||||||
|
dst_ptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef BUILD_MMX
|
||||||
|
void
|
||||||
|
copy_color_rgba_to_rgba_mmx(DATA32 src, DATA32 *dst, int len)
|
||||||
|
{
|
||||||
|
DATA32 *dst_ptr, *dst_end_ptr, *dst_end_ptr_pre;
|
||||||
|
|
||||||
|
dst_ptr = dst;
|
||||||
|
dst_end_ptr = dst + len;
|
||||||
|
dst_end_ptr_pre = dst + ((len / 10) * 10);
|
||||||
|
|
||||||
|
movd_m2r(src, mm0);
|
||||||
|
movd_m2r(src, mm1);
|
||||||
|
psllq_i2r(32, mm0);
|
||||||
|
por_r2r(mm1, mm0);
|
||||||
|
|
||||||
|
while (dst_ptr < dst_end_ptr_pre)
|
||||||
|
{
|
||||||
|
movq_r2m(mm0, dst_ptr[0]);
|
||||||
|
movq_r2m(mm0, dst_ptr[2]);
|
||||||
|
movq_r2m(mm0, dst_ptr[4]);
|
||||||
|
movq_r2m(mm0, dst_ptr[6]);
|
||||||
|
movq_r2m(mm0, dst_ptr[8]);
|
||||||
|
dst_ptr+=10;
|
||||||
|
}
|
||||||
|
while (dst_ptr < dst_end_ptr)
|
||||||
|
{
|
||||||
|
*dst_ptr = src;
|
||||||
|
dst_ptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef BUILD_SSE
|
||||||
|
void
|
||||||
|
copy_color_rgba_to_rgba_sse(DATA32 src, DATA32 *dst, int len)
|
||||||
|
{
|
||||||
|
DATA32 *dst_ptr, *dst_end_ptr, *dst_end_ptr_pre;
|
||||||
|
|
||||||
|
dst_ptr = dst;
|
||||||
|
dst_end_ptr = dst + len;
|
||||||
|
dst_end_ptr_pre = dst + ((len / 10) * 10);
|
||||||
|
|
||||||
|
movd_m2r(src, mm0);
|
||||||
|
movd_m2r(src, mm1);
|
||||||
|
psllq_i2r(32, mm0);
|
||||||
|
por_r2r(mm1, mm0);
|
||||||
|
|
||||||
|
while (dst_ptr < dst_end_ptr_pre)
|
||||||
|
{
|
||||||
|
prefetch(&dst_ptr[128]);
|
||||||
|
movq_r2m(mm0, dst_ptr[0]);
|
||||||
|
movq_r2m(mm0, dst_ptr[2]);
|
||||||
|
movq_r2m(mm0, dst_ptr[4]);
|
||||||
|
movq_r2m(mm0, dst_ptr[6]);
|
||||||
|
movq_r2m(mm0, dst_ptr[8]);
|
||||||
|
dst_ptr+=10;
|
||||||
|
}
|
||||||
|
while (dst_ptr < dst_end_ptr)
|
||||||
|
{
|
||||||
|
*dst_ptr = src;
|
||||||
|
dst_ptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/****************************************************************************/
|
||||||
|
|
||||||
|
void
|
||||||
|
copy_color_rgb_to_rgba_c(DATA32 src, DATA32 *dst, int len)
|
||||||
|
{
|
||||||
|
DATA32 *dst_ptr, *dst_end_ptr;
|
||||||
|
|
||||||
|
dst_ptr = dst;
|
||||||
|
dst_end_ptr = dst + len;
|
||||||
|
|
||||||
|
src |= PIXEL_SOLID_ALPHA;
|
||||||
|
|
||||||
|
while (dst_ptr < dst_end_ptr)
|
||||||
|
{
|
||||||
|
*dst_ptr = src;
|
||||||
|
dst_ptr++;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
#include "evas_common.h"
|
||||||
|
|
||||||
|
#ifdef BUILD_MMX
|
||||||
|
#include "evas_mmx.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static void blend_init_pow_lut(void);
|
||||||
|
|
||||||
|
DATA8 pow_lut[256][256];
|
||||||
|
const DATA16 const_c1[4] = {1, 1, 1, 1};
|
||||||
|
|
||||||
|
void
|
||||||
|
blend_init(void)
|
||||||
|
{
|
||||||
|
static int initialised = 0;
|
||||||
|
static int mmx = 0;
|
||||||
|
static int sse = 0;
|
||||||
|
static int sse2 = 0;
|
||||||
|
|
||||||
|
if (initialised) return;
|
||||||
|
initialised = 1;
|
||||||
|
|
||||||
|
cpu_can_do(&mmx, &sse, &sse2);
|
||||||
|
|
||||||
|
blend_init_pow_lut();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
blend_init_pow_lut(void)
|
||||||
|
{
|
||||||
|
int i, j;
|
||||||
|
|
||||||
|
for (i = 0; i < 256; i++)
|
||||||
|
{
|
||||||
|
for (j = 0; j < 256; j++)
|
||||||
|
{
|
||||||
|
int divisor;
|
||||||
|
|
||||||
|
divisor = (i + (j * (255 - i)) / 255);
|
||||||
|
if (divisor > 0) pow_lut[i][j] = (i * 255) / divisor;
|
||||||
|
else pow_lut[i][j] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,119 @@
|
||||||
|
#include "evas_common.h"
|
||||||
|
|
||||||
|
#ifdef BUILD_MMX
|
||||||
|
#include "evas_mmx.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern DATA8 pow_lut[256][256];
|
||||||
|
extern const DATA16 const_c1[4];
|
||||||
|
|
||||||
|
void
|
||||||
|
blend_pixels_cmod_rgba_to_rgb_c(DATA32 *src, DATA32 *dst, int len, DATA8 *rmod, DATA8 *gmod, DATA8 *bmod, DATA8 *amod)
|
||||||
|
{
|
||||||
|
DATA32 *src_ptr, *dst_ptr, *dst_end_ptr;
|
||||||
|
|
||||||
|
src_ptr = src;
|
||||||
|
dst_ptr = dst;
|
||||||
|
dst_end_ptr = dst + len;
|
||||||
|
|
||||||
|
while (dst_ptr < dst_end_ptr)
|
||||||
|
{
|
||||||
|
DATA32 tmp;
|
||||||
|
DATA8 a;
|
||||||
|
|
||||||
|
a = amod[A_VAL(src_ptr)];
|
||||||
|
if (a) /* hmmm - do we need this? */
|
||||||
|
{
|
||||||
|
BLEND_COLOR(a, R_VAL(dst_ptr),
|
||||||
|
rmod[R_VAL(src_ptr)], R_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
BLEND_COLOR(a, G_VAL(dst_ptr),
|
||||||
|
gmod[G_VAL(src_ptr)], G_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
BLEND_COLOR(a, B_VAL(dst_ptr),
|
||||||
|
bmod[B_VAL(src_ptr)], B_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
}
|
||||||
|
src_ptr++;
|
||||||
|
dst_ptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************/
|
||||||
|
|
||||||
|
void
|
||||||
|
blend_pixels_cmod_rgba_to_rgba_c(DATA32 *src, DATA32 *dst, int len, DATA8 *rmod, DATA8 *gmod, DATA8 *bmod, DATA8 *amod)
|
||||||
|
{
|
||||||
|
DATA32 *src_ptr, *dst_ptr, *dst_end_ptr;
|
||||||
|
|
||||||
|
src_ptr = src;
|
||||||
|
dst_ptr = dst;
|
||||||
|
dst_end_ptr = dst + len;
|
||||||
|
|
||||||
|
while (dst_ptr < dst_end_ptr)
|
||||||
|
{
|
||||||
|
DATA32 tmp;
|
||||||
|
DATA8 a;
|
||||||
|
|
||||||
|
a = pow_lut[amod[A_VAL(src_ptr)]][A_VAL(dst_ptr)];
|
||||||
|
if (a) /* hmmm - do we need this? */
|
||||||
|
{
|
||||||
|
BLEND_COLOR(a, R_VAL(dst_ptr),
|
||||||
|
rmod[R_VAL(src_ptr)], R_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
BLEND_COLOR(a, G_VAL(dst_ptr),
|
||||||
|
gmod[G_VAL(src_ptr)], G_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
BLEND_COLOR(a, B_VAL(dst_ptr),
|
||||||
|
bmod[B_VAL(src_ptr)], B_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
A_VAL(dst_ptr) = A_VAL(dst_ptr) + ((amod[A_VAL(src_ptr)] * (255 - A_VAL(dst_ptr))) / 255);
|
||||||
|
}
|
||||||
|
src_ptr++;
|
||||||
|
dst_ptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************/
|
||||||
|
|
||||||
|
void
|
||||||
|
copy_pixels_cmod_rgba_to_rgba_c(DATA32 *src, DATA32 *dst, int len, DATA8 *rmod, DATA8 *gmod, DATA8 *bmod, DATA8 *amod)
|
||||||
|
{
|
||||||
|
DATA32 *src_ptr, *dst_ptr, *dst_end_ptr;
|
||||||
|
|
||||||
|
src_ptr = src;
|
||||||
|
dst_ptr = dst;
|
||||||
|
dst_end_ptr = dst + len;
|
||||||
|
|
||||||
|
while (dst_ptr < dst_end_ptr)
|
||||||
|
{
|
||||||
|
R_VAL(dst_ptr) = rmod[R_VAL(src_ptr)];
|
||||||
|
G_VAL(dst_ptr) = gmod[G_VAL(src_ptr)];
|
||||||
|
B_VAL(dst_ptr) = bmod[B_VAL(src_ptr)];
|
||||||
|
A_VAL(dst_ptr) = amod[A_VAL(src_ptr)];
|
||||||
|
src_ptr++;
|
||||||
|
dst_ptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************/
|
||||||
|
|
||||||
|
void
|
||||||
|
copy_pixels_cmod_rgb_to_rgba_c(DATA32 *src, DATA32 *dst, int len, DATA8 *rmod, DATA8 *gmod, DATA8 *bmod, DATA8 *amod)
|
||||||
|
{
|
||||||
|
DATA32 *src_ptr, *dst_ptr, *dst_end_ptr;
|
||||||
|
|
||||||
|
src_ptr = src;
|
||||||
|
dst_ptr = dst;
|
||||||
|
dst_end_ptr = dst + len;
|
||||||
|
|
||||||
|
while (dst_ptr < dst_end_ptr)
|
||||||
|
{
|
||||||
|
R_VAL(dst_ptr) = rmod[R_VAL(src_ptr)];
|
||||||
|
G_VAL(dst_ptr) = gmod[G_VAL(src_ptr)];
|
||||||
|
B_VAL(dst_ptr) = bmod[B_VAL(src_ptr)];
|
||||||
|
A_VAL(dst_ptr) = amod[255];
|
||||||
|
src_ptr++;
|
||||||
|
dst_ptr++;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,202 @@
|
||||||
|
#include "evas_common.h"
|
||||||
|
|
||||||
|
#ifdef BUILD_MMX
|
||||||
|
#include "evas_mmx.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern DATA8 pow_lut[256][256];
|
||||||
|
extern const DATA16 const_c1[4];
|
||||||
|
|
||||||
|
#ifdef BUILD_C
|
||||||
|
void
|
||||||
|
blend_pixels_mul_color_rgba_to_rgb_c(DATA32 *src, DATA32 *dst, int len, DATA32 mul_color)
|
||||||
|
{
|
||||||
|
DATA32 *src_ptr, *dst_ptr, *dst_end_ptr;
|
||||||
|
|
||||||
|
src_ptr = src;
|
||||||
|
dst_ptr = dst;
|
||||||
|
dst_end_ptr = dst + len;
|
||||||
|
|
||||||
|
if ((R_VAL(&mul_color) == 255) &&
|
||||||
|
(G_VAL(&mul_color) == 255) &&
|
||||||
|
(B_VAL(&mul_color) == 255))
|
||||||
|
{
|
||||||
|
while (dst_ptr < dst_end_ptr)
|
||||||
|
{
|
||||||
|
DATA32 tmp;
|
||||||
|
DATA8 a;
|
||||||
|
|
||||||
|
a = (A_VAL(src_ptr) * (A_VAL(&mul_color) + 1)) >> 8;
|
||||||
|
if (a) /* hmmm - do we need this? */
|
||||||
|
{
|
||||||
|
BLEND_COLOR(a, R_VAL(dst_ptr),
|
||||||
|
R_VAL(src_ptr), R_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
BLEND_COLOR(a, G_VAL(dst_ptr),
|
||||||
|
G_VAL(src_ptr), G_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
BLEND_COLOR(a, B_VAL(dst_ptr),
|
||||||
|
B_VAL(src_ptr), B_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
}
|
||||||
|
src_ptr++;
|
||||||
|
dst_ptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while (dst_ptr < dst_end_ptr)
|
||||||
|
{
|
||||||
|
DATA32 tmp;
|
||||||
|
DATA8 a;
|
||||||
|
|
||||||
|
a = (A_VAL(src_ptr) * (A_VAL(&mul_color) + 1)) >> 8;
|
||||||
|
if (a) /* hmmm - do we need this? */
|
||||||
|
{
|
||||||
|
BLEND_COLOR(a, R_VAL(dst_ptr),
|
||||||
|
((R_VAL(src_ptr) * (R_VAL(&mul_color) + 1)) >> 8), R_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
BLEND_COLOR(a, G_VAL(dst_ptr),
|
||||||
|
((G_VAL(src_ptr) * (G_VAL(&mul_color) + 1)) >> 8), G_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
BLEND_COLOR(a, B_VAL(dst_ptr),
|
||||||
|
((B_VAL(src_ptr) * (B_VAL(&mul_color) + 1)) >> 8), B_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
}
|
||||||
|
src_ptr++;
|
||||||
|
dst_ptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef BUILD_MMX
|
||||||
|
void
|
||||||
|
blend_pixels_mul_color_rgba_to_rgb_mmx(DATA32 *src, DATA32 *dst, int len, DATA32 mul_color)
|
||||||
|
{
|
||||||
|
DATA32 *src_ptr, *dst_ptr, *dst_end_ptr;
|
||||||
|
|
||||||
|
src_ptr = src;
|
||||||
|
dst_ptr = dst;
|
||||||
|
dst_end_ptr = dst + len;
|
||||||
|
|
||||||
|
pxor_r2r(mm6, mm6);
|
||||||
|
movd_m2r(mul_color, mm1);
|
||||||
|
punpcklbw_r2r(mm1, mm6);
|
||||||
|
psrlw_i2r(8, mm6);
|
||||||
|
movq_m2r(*const_c1, mm5);
|
||||||
|
paddw_r2r(mm5, mm6);
|
||||||
|
|
||||||
|
pxor_r2r(mm4, mm4);
|
||||||
|
|
||||||
|
while (dst_ptr < dst_end_ptr)
|
||||||
|
{
|
||||||
|
movd_m2r(src_ptr[0], mm1);
|
||||||
|
|
||||||
|
/* this could be more optimial.. but it beats the c code by almost */
|
||||||
|
/* double */
|
||||||
|
pxor_r2r(mm7, mm7);
|
||||||
|
punpcklbw_r2r(mm1, mm7);
|
||||||
|
psrlw_i2r(8, mm7);
|
||||||
|
pmullw_r2r(mm6, mm7);
|
||||||
|
psrlw_i2r(8, mm7);
|
||||||
|
packuswb_r2r(mm7, mm7);
|
||||||
|
movq_r2r(mm7, mm1);
|
||||||
|
/* and back to our normal programming... */
|
||||||
|
movd_m2r(dst_ptr[0], mm2);
|
||||||
|
|
||||||
|
movq_r2r(mm1, mm3);
|
||||||
|
|
||||||
|
punpcklbw_r2r(mm3, mm3);
|
||||||
|
punpckhwd_r2r(mm3, mm3);
|
||||||
|
punpckhdq_r2r(mm3, mm3);
|
||||||
|
psrlw_i2r(1, mm3);
|
||||||
|
|
||||||
|
psrlq_i2r(16, mm3);
|
||||||
|
|
||||||
|
punpcklbw_r2r(mm4, mm1);
|
||||||
|
punpcklbw_r2r(mm4, mm2);
|
||||||
|
|
||||||
|
psubw_r2r(mm2, mm1);
|
||||||
|
psllw_i2r(1, mm1);
|
||||||
|
paddw_r2r(mm5, mm1);
|
||||||
|
pmulhw_r2r(mm3, mm1);
|
||||||
|
paddw_r2r(mm1, mm2);
|
||||||
|
|
||||||
|
packuswb_r2r(mm4, mm2);
|
||||||
|
movd_r2m(mm2, dst_ptr[0]);
|
||||||
|
|
||||||
|
src_ptr++;
|
||||||
|
dst_ptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/****************************************************************************/
|
||||||
|
|
||||||
|
void
|
||||||
|
blend_pixels_mul_color_rgba_to_rgba_c(DATA32 *src, DATA32 *dst, int len, DATA32 mul_color)
|
||||||
|
{
|
||||||
|
DATA32 *src_ptr, *dst_ptr, *dst_end_ptr;
|
||||||
|
|
||||||
|
src_ptr = src;
|
||||||
|
dst_ptr = dst;
|
||||||
|
dst_end_ptr = dst + len;
|
||||||
|
|
||||||
|
if ((R_VAL(&mul_color) == 255) &&
|
||||||
|
(G_VAL(&mul_color) == 255) &&
|
||||||
|
(B_VAL(&mul_color) == 255))
|
||||||
|
{
|
||||||
|
while (dst_ptr < dst_end_ptr)
|
||||||
|
{
|
||||||
|
DATA32 tmp;
|
||||||
|
DATA8 a, aa;
|
||||||
|
|
||||||
|
aa = (A_VAL(src_ptr) * (A_VAL(&mul_color) + 1)) >> 8;
|
||||||
|
if (aa) /* hmmm - do we need this? */
|
||||||
|
{
|
||||||
|
a = pow_lut[aa][A_VAL(dst_ptr)];
|
||||||
|
|
||||||
|
BLEND_COLOR(a, R_VAL(dst_ptr),
|
||||||
|
R_VAL(src_ptr), R_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
BLEND_COLOR(a, G_VAL(dst_ptr),
|
||||||
|
G_VAL(src_ptr), G_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
BLEND_COLOR(a, B_VAL(dst_ptr),
|
||||||
|
B_VAL(src_ptr), B_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
A_VAL(dst_ptr) = A_VAL(dst_ptr) + ((aa * (255 - A_VAL(dst_ptr))) / 255);
|
||||||
|
}
|
||||||
|
src_ptr++;
|
||||||
|
dst_ptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while (dst_ptr < dst_end_ptr)
|
||||||
|
{
|
||||||
|
DATA32 tmp;
|
||||||
|
DATA8 a, aa;
|
||||||
|
|
||||||
|
aa = (A_VAL(src_ptr) * (A_VAL(&mul_color) + 1)) >> 8;
|
||||||
|
if (aa) /* hmmm - do we need this? */
|
||||||
|
{
|
||||||
|
a = pow_lut[aa][A_VAL(dst_ptr)];
|
||||||
|
|
||||||
|
BLEND_COLOR(a, R_VAL(dst_ptr),
|
||||||
|
((R_VAL(src_ptr) * (R_VAL(&mul_color) + 1)) >> 8), R_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
BLEND_COLOR(a, G_VAL(dst_ptr),
|
||||||
|
((G_VAL(src_ptr) * (G_VAL(&mul_color) + 1)) >> 8), G_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
BLEND_COLOR(a, B_VAL(dst_ptr),
|
||||||
|
((B_VAL(src_ptr) * (B_VAL(&mul_color) + 1)) >> 8), B_VAL(dst_ptr),
|
||||||
|
tmp);
|
||||||
|
A_VAL(dst_ptr) = A_VAL(dst_ptr) + ((aa * (255 - A_VAL(dst_ptr))) / 255);
|
||||||
|
}
|
||||||
|
src_ptr++;
|
||||||
|
dst_ptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|