elementary/image - Improve documentation and add an example.

Doxygen comments moved out from .c and in to Elementary.h.in. They
received better descriptions for most of the API too.



SVN revision: 61388
This commit is contained in:
Rafael Antognolli 2011-07-14 20:48:00 +00:00
parent 5ce6c8cd9d
commit c30abbba25
9 changed files with 9144 additions and 220 deletions

View File

@ -1624,6 +1624,69 @@
* @example label_example_01.c
*/
/**
* @page tutorial_image Image example
* @dontinclude image_example_01.c
*
* This example is as simple as possible. An image object will be added to the
* window over a white background, and set to be resizeable together with the
* window. All the options set through the example will affect the behavior of
* this image.
*
* We start with the code for creating a window and its background, and also
* add the code to write the path to the image that will be loaded:
*
* @skip int
* @until snprintf
*
* Now we create the image object, and set that file to be loaded:
*
* @until }
*
* We can now go setting our options.
*
* elm_image_no_scale_set() is used just to set this value to true (we
* don't want to scale our image anyway, just resize it).
*
* elm_image_scale_set() is used to allow the image to be resized to a size
* smaller than the original one, but not to a size bigger than it.
*
* elm_elm_image_smooth_set() will disable the smooth scaling, so the scale
* algorithm used to scale the image to the new object size is going to be
* faster, but with a lower quality.
*
* elm_image_orient_set() is used to flip the image around the (1, 0) (0, 1)
* diagonal.
*
* elm_image_aspect_ratio_retained_set() is used to keep the original aspect
* ratio of the image, even when the window is resized to another aspect ratio.
*
* elm_image_fill_outside_set() is used to ensure that the image will fill the
* entire area available to it, even if keeping the aspect ratio. The image
* will overflow its width or height (any of them that is necessary) to the
* object area, instead of resizing the image down until it can fit entirely in
* this area.
*
* elm_image_editable_set() is used just to cover the API, but won't affect
* this example since we are not using any copy & paste property.
*
* This is the code for setting these options:
*
* @until editable
*
* Now some last touches in our object size hints, window and background, to
* display this image properly:
*
* @until ELM_MAIN
*
* This example will look like this:
*
* @image html screenshots/image_example_01.png
* @image latex screenshots/image_example_01.eps
*
* @example image_example_01.c
*/
/**
* @page bg_example_01_c bg_example_01.c
* @include bg_example_01.c

View File

@ -0,0 +1,519 @@
%!PS-Adobe-3.0 EPSF-3.0
%%Creator: cairo 1.10.2 (http://cairographics.org)
%%CreationDate: Thu Jul 14 20:15:30 2011
%%Pages: 1
%%BoundingBox: 0 -1 439 148
%%DocumentData: Clean7Bit
%%LanguageLevel: 2
%%EndComments
%%BeginProlog
/cairo_eps_state save def
/dict_count countdictstack def
/op_count count 1 sub def
userdict begin
/q { gsave } bind def
/Q { grestore } bind def
/cm { 6 array astore concat } bind def
/w { setlinewidth } bind def
/J { setlinecap } bind def
/j { setlinejoin } bind def
/M { setmiterlimit } bind def
/d { setdash } bind def
/m { moveto } bind def
/l { lineto } bind def
/c { curveto } bind def
/h { closepath } bind def
/re { exch dup neg 3 1 roll 5 3 roll moveto 0 rlineto
0 exch rlineto 0 rlineto closepath } bind def
/S { stroke } bind def
/f { fill } bind def
/f* { eofill } bind def
/n { newpath } bind def
/W { clip } bind def
/W* { eoclip } bind def
/BT { } bind def
/ET { } bind def
/pdfmark where { pop globaldict /?pdfmark /exec load put }
{ globaldict begin /?pdfmark /pop load def /pdfmark
/cleartomark load def end } ifelse
/BDC { mark 3 1 roll /BDC pdfmark } bind def
/EMC { mark /EMC pdfmark } bind def
/cairo_store_point { /cairo_point_y exch def /cairo_point_x exch def } def
/Tj { show currentpoint cairo_store_point } bind def
/TJ {
{
dup
type /stringtype eq
{ show } { -0.001 mul 0 cairo_font_matrix dtransform rmoveto } ifelse
} forall
currentpoint cairo_store_point
} bind def
/cairo_selectfont { cairo_font_matrix aload pop pop pop 0 0 6 array astore
cairo_font exch selectfont cairo_point_x cairo_point_y moveto } bind def
/Tf { pop /cairo_font exch def /cairo_font_matrix where
{ pop cairo_selectfont } if } bind def
/Td { matrix translate cairo_font_matrix matrix concatmatrix dup
/cairo_font_matrix exch def dup 4 get exch 5 get cairo_store_point
/cairo_font where { pop cairo_selectfont } if } bind def
/Tm { 2 copy 8 2 roll 6 array astore /cairo_font_matrix exch def
cairo_store_point /cairo_font where { pop cairo_selectfont } if } bind def
/g { setgray } bind def
/rg { setrgbcolor } bind def
/d1 { setcachedevice } bind def
%%EndProlog
11 dict begin
/FontType 42 def
/FontName /DejaVuSans def
/PaintType 0 def
/FontMatrix [ 1 0 0 1 0 0 ] def
/FontBBox [ 0 0 0 0 ] def
/Encoding 256 array def
0 1 255 { Encoding exch /.notdef put } for
Encoding 1 /uni0052 put
Encoding 2 /uni0045 put
Encoding 3 /uni004C put
Encoding 4 /uni004D put
Encoding 5 /uni005F put
Encoding 6 /uni0049 put
Encoding 7 /uni0041 put
Encoding 8 /uni0047 put
Encoding 9 /uni004F put
Encoding 10 /uni004E put
Encoding 11 /uni0054 put
Encoding 12 /uni0046 put
Encoding 13 /uni0050 put
Encoding 14 /uni0048 put
Encoding 15 /uni005A put
Encoding 16 /uni0056 put
Encoding 17 /uni0043 put
Encoding 18 /uni0053 put
Encoding 19 /uni0039 put
Encoding 20 /uni0030 put
Encoding 21 /uni0057 put
Encoding 22 /uni0031 put
Encoding 23 /uni0038 put
/CharStrings 24 dict dup begin
/.notdef 0 def
/uni0052 1 def
/uni0045 2 def
/uni004C 3 def
/uni004D 4 def
/uni005F 5 def
/uni0049 6 def
/uni0041 7 def
/uni0047 8 def
/uni004F 9 def
/uni004E 10 def
/uni0054 11 def
/uni0046 12 def
/uni0050 13 def
/uni0048 14 def
/uni005A 15 def
/uni0056 16 def
/uni0043 17 def
/uni0053 18 def
/uni0039 19 def
/uni0030 20 def
/uni0057 21 def
/uni0031 22 def
/uni0038 23 def
end readonly def
/sfnts [
<00010000000a008000030020636d617000baf144000010180000006e6376742000691d390000
1088000001fe6670676d7134766a00001288000000ab676c7966c6ea97b1000000ac00000f6c
68656164f5a891960000133400000036686865610cb806690000136c00000024686d74787f4f
0c7100001390000000606c6f63610000ad30000013f0000000646d6178700485067100001454
00000020707265703b07f100000014740000056800020066fe96046605a400030007001a400c
04fb0006fb0108057f0204002fc4d4ec310010d4ecd4ec301311211125211121660400fc7303
1bfce5fe96070ef8f2720629000200c90000055405d50013001c00b14035090807030a061103
040305110404034206040015030415950914950d810b040506031109001c160e050a19190411
3f140a1c0c041d10fcec32fcc4ec1117391139393931002f3cf4ecd4ec123912391239304b53
58071005ed071005ed1117395922b2401e01015d40427a130105000501050206030704150015
0114021603170425002501250226032706260726082609201e36013602460146026805750475
05771388068807980698071f5d005d011e01171323032e012b01112311212016151406011133
323635342623038d417b3ecdd9bf4a8b78dcca01c80100fc83fd89fe9295959202bc16907efe
68017f9662fd8905d5d6d88dba024ffdee8783838500000100c90000048b05d5000b002e4015
06950402950081089504ad0a05010907031c00040c10fcec32d4c4c431002fececf4ec10ee30
b21f0d01015d132115211121152111211521c903b0fd1a02c7fd3902f8fc3e05d5aafe46aafd
e3aa0000000100c90000046a05d500050025400c0295008104011c033a00040610fcecec3100
2fe4ec304009300750078003800404015d133311211521c9ca02d7fc5f05d5fad5aa000100c9
0000061f05d5000c00bf403403110708070211010208080702110302090a0901110a0a09420a
070203080300af080b050908030201050a061c043e0a1c00040d10fcecfcec11173931002f3c
c4ec32111739304b5358071005ed071008ed071008ed071005ed5922b2700e01015d40560307
0f080f09020a15021407130a260226072007260a200a3407350a69027c027b07790a80028207
820a90021604010b0313011b0323012c032708280934013c035608590965086a097608790981
018d0395019b03145d005d13210901211123110123011123c9012d017d017f012dc5fe7fcbfe
7fc405d5fc0803f8fa2b051ffc000400fae100000001ffecfe1d0414feac0003000fb500a901
00020410c4c43100d4ec30011521350414fbd8feac8f8f000000000100c90000019305d50003
002eb700af02011c00040410fc4bb0105458b9000000403859ec31002fec3001400d30054005
500560058f059f05065d13331123c9caca05d5fa2b00000200100000056805d50002000a00c2
404100110100040504021105050401110a030a0011020003030a071105040611050504091103
0a08110a030a4200030795010381090509080706040302010009050a0b10d4c4173931002f3c
e4d4ec1239304b5358071005ed0705ed071005ed0705ed071008ed071005ed071005ed071008
ed5922b2200c01015d40420f010f020f070f080f005800760070008c00090701080206030904
1601190256015802500c67016802780176027c0372047707780887018802800c980299039604
175d005d090121013301230321032302bcfeee0225fe7be50239d288fd5f88d5050efd1903ae
fa2b017ffe81000000010073ffe3058b05f0001d0039402000051b0195031b950812a111ae15
950e91088c1e02001c1134043318190b101e10fcecfce4fcc4310010e4f4ecf4ec10fed4ee11
393930251121352111060423200011100021320417152e0123200011100021323604c3feb602
1275fee6a0fea2fe75018b015e9201076f70fc8bfeeefeed011301126ba8d50191a6fd7f5355
0199016d016e01994846d75f60fecefed1fed2fece25000000020073ffe305d905f0000b0017
0023401306951200950c91128c1809190f33031915101810fcecfcec310010e4f4ec10ee3001
22001110003332001110002720001110002120001110000327dcfefd0103dcdc0101feffdc01
3a0178fe88fec6fec5fe870179054cfeb8fee5fee6feb80148011a011b0148a4fe5bfe9efe9f
fe5b01a40162016201a50000000100c90000053305d500090079401e07110102010211060706
4207020300af0805060107021c0436071c00040a10fcecfcec11393931002f3cec323939304b
5358071004ed071004ed5922b21f0b01015d4030360238074802470769026607800207060109
0615011a06460149065701580665016906790685018a0695019a069f0b105d005d1321011133
1121011123c901100296c4fef0fd6ac405d5fb1f04e1fa2b04e1fb1f0001fffa000004e905d5
0007004a400e0602950081040140031c0040050810d4e4fce431002ff4ec3230014bb00a5458
bd00080040000100080008ffc03811373859401300091f00100110021f071009400970099f09
095d03211521112311210604effdeecbfdee05d5aafad5052b00000100c90000042305d50009
002940120695040295008104ad08050107031c00040a10fcec32d4c431002fecf4ec10ee30b2
0f0b01015d13211521112115211123c9035afd700250fdb0ca05d5aafe48aafd3700000200c9
0000048d05d500080013003a40180195100095098112100a0802040005190d3f11001c090414
10fcec32fcec11173931002ff4ecd4ec30400b0f151f153f155f15af1505015d011133323635
342623252132041514042b0111230193fe8d9a9a8dfe3801c8fb0101fefffbfeca052ffdcf92
878692a6e3dbdde2fda8000100c90000053b05d5000b002c4014089502ad0400810a0607031c
053809011c00040c10fcec32fcec3231002f3ce432fcec30b2500d01015d1333112111331123
11211123c9ca02decacafd22ca05d5fd9c0264fa2b02c7fd39000001005c0000051f05d50009
0090401b03110708070811020302420895008103950508030001420400060a10dc4bb009544b
b00a545b58b90006ffc03859c4d4e411393931002fecf4ec304b5358071005ed071005ed5922
01404005020a0718072902260738074802470748080905030b08000b16031a08100b2f0b3503
39083f0b47034a084f0b55035908660369086f0b770378087f0b9f0b165d005d132115012115
21350121730495fc5003c7fb3d03b0fc6705d59afb6faa9a04910000000100100000056805d5
000600b7402704110506050311020306060503110403000100021101010042030401af000604
0302000505010710d4c4173931002fec3239304b5358071005ed071008ed071008ed071005ed
5922b2500801015d406200032a03470447055a037d038303070600070208040906150114021a
041a052a002601260229042905250620083800330133023c043c053706480045014502490449
054706590056066602690469057a0076017602790479057506800898009706295d005d210133
09013301024afdc6d301d901dad2fdc705d5fb1704e9fa2b00010073ffe3052705f000190036
401a0da10eae0a951101a100ae04951791118c1a07190d003014101a10fcec32ec310010e4f4
ecf4ec10eef6ee30b40f1b1f1b02015d01152e0123200011100021323637150e012320001110
00213216052766e782ff00fef00110010082e7666aed84feadfe7a0186015386ed0562d55f5e
fec7fed8fed9fec75e5fd34848019f01670168019f47000000010087ffe304a205f00027007e
403c0d0c020e0b021e1f1e080902070a021f1f1e420a0b1e1f0415010015a114941895110495
00942591118c281e0a0b1f1b0700221b190e2d071914222810dcc4ecfcece411123939393931
0010e4f4e4ec10eef6ee10c6111739304b535807100eed11173907100eed1117395922b20f29
01015db61f292f294f29035d01152e012322061514161f011e0115140421222627351e013332
363534262f012e01353424333216044873cc5fa5b377a67ae2d7feddfee76aef807bec72adbc
879a7be2ca0117f569da05a4c53736807663651f192bd9b6d9e0302fd04546887e6e7c1f182d
c0abc6e4260000020081ffe3048705f00018002400584023071f1901860019a00aa504a00089
161fa01091168c25071c1c21131e0022221c0d1b2510fcece4f4ecec310010e4f4ec10e6fef5
ee10ee111239304016c419c21ac01bc01cc01dc21ec41f07aa12bc12e912035d015d37351e01
333212130e01232200353400332000111000212226013236353426232206151416e14c9c4bc8
d30f3ab26ce0fefb0110e201030111feb1fee54c9c013e889f9f88889f9f1fb82426010d0112
565c010febe60116fe73fe86fe9ffe5b1e0297baa2a1bbbba1a2ba0000020087ffe3048f05f0
000b00170023401306a01200a00c91128c18091c0f1e031c151b1810fcecf4ec310010e4f4ec
10ee30012202111012333212111002273200111000232200111000028b9c9d9d9c9d9d9d9dfb
0109fef7fbfbfef701090550fecdfeccfecdfecd0133013301340133a0fe73fe86fe87fe7301
8d0179017a018d0000010044000007a605d5000c017b4049051a0605090a09041a0a09031a0a
0b0a021a01020b0b0a061107080705110405080807021103020c000c011100000c420a050203
060300af0b080c0b0a09080605040302010b07000d10d4cc173931002f3cec32321739304b53
58071005ed071008ed071008ed071005ed071008ed071005ed0705ed071008ed5922b2000e01
015d40f206020605020a000a000a120a2805240a200a3e023e05340a300a4c024d05420a400a
59026a026b05670a600a7b027f027c057f05800a960295051d07000902080300040605000500
0601070408000807090009040a0a0c000e1a0315041508190c100e2004210520062007200823
09240a250b200e200e3c023a033504330530083609390b3f0c300e460046014a024004450540
0542064207420840084009440a4d0c400e400e58025608590c500e6602670361046205600660
0760086409640a640b770076017b027803770474057906790777087008780c7f0c7f0e860287
038804890585098a0b8f0e97049f0eaf0e5b5d005d1333090133090133012309012344cc013a
0139e3013a0139cdfe89fefec5fec2fe05d5fb1204eefb1204eefa2b0510faf00000000100e1
0000045a05d5000a004040154203a00402a005810700a009081f061c03001f010b10d44bb00f
5458b9000100403859ecc4fcec31002fec32f4ecd4ec304b5358592201b40f030f04025d3721
110535253311211521fe014afe990165ca014afca4aa047348b848fad5aa00000003008bffe3
048b05f0000b0023002f00434025180c00a02706a01e2da012911e8c27a330180c242a1c1524
1c0f091c151b1e031c0f211b3010fcc4ecf4c4ec10ee10ee113939310010ece4f4ec10ee10ee
393930012206151416333236353426252e01353424333216151406071e011514042322243534
36131416333236353426232206028b90a5a59090a6a5fea5829100ffdedffe918192a3fef7f7
f7fef7a448918382939382839102c59a87879a9b86879a5620b280b3d0d0b380b22022c68fd9
e8e8d98fc6016174828274748282000000000002000300000000001400010000000000340004
002000000004000400010000f017ffff0000f000ffff10000001000000000006003a00000000
00180000000100020003000400050006000700080009000a000b000c000d000e000f00100011
0012001300140015001600170000013500b800cb00cb00c100aa009c01a600b8006600000071
00cb00a002b20085007500b800c301cb0189022d00cb00a600f000d300aa008700cb03aa0400
014a003300cb000000d9050200f4015400b4009c01390114013907060400044e04b4045204b8
04e704cd0037047304cd04600473013303a2055605a60556053903c5021200c9001f00b801df
007300ba03e9033303bc0444040e00df03cd03aa00e503aa0404000000cb008f00a4007b00b8
0014016f007f027b0252008f00c705cd009a009a006f00cb00cd019e01d300f000ba018300d5
009803040248009e01d500c100cb00f600830354027f00000333026600d300c700a400cd008f
009a0073040005d5010a00fe022b00a400b4009c00000062009c0000001d032d05d505d505d5
05f0007f007b005400a406b80614072301d300b800cb00a601c301ec069300a000d3035c0371
03db0185042304a80448008f0139011401390360008f05d5019a061407230666017904600460
0460047b009c00000277046001aa00e904600762007b00c5007f027b000000b4025205cd0066
00bc00660077061000cd013b01850389008f007b0000001d00cd074a042f009c009c0000077d
006f0000006f0335006a006f007b00ae00b2002d0396008f027b00f600830354063705f6008f
009c04e10266008f018d02f600cd03440029006604ee00730000140000960000b70706050403
0201002c2010b002254964b040515820c859212d2cb002254964b040515820c859212d2c2010
0720b00050b00d7920b8ffff5058041b0559b0051cb0032508b0042523e120b00050b00d7920
b8ffff5058041b0559b0051cb0032508e12d2c4b505820b0fd454459212d2cb002254560442d
2c4b5358b00225b0022545445921212d2c45442d2cb00225b0022549b00525b005254960b020
6368208a108a233a8a10653a2d0000010000000251eba461ed025f0f3cf5001f080000000000
c896fa5500000000c896fa55f7d6fcae0d72095500000008000000010000000000010000076d
fe1d00000de2f7d6fa510d7200010000000000000000000000000000001804cd0066058f00c9
050e00c9047500c906e700c90400ffec025c00c90579001006330073064c007305fc00c904e3
fffa049a00c904d300c9060400c9057b005c0579001005960073051400870517008105170087
07e90044051700e10517008b000000000000004400000158000001b8000001fc000002f80000
03240000036c00000468000005100000059c00000644000006b40000070800000788000007e4
000008a40000098400000a1c00000b1400000be800000c6c00000e2800000e9800000f6c0001
000000180354002b0068000c000200100099000800000415021600080004b8028040fffbfe03
fa1403f92503f83203f79603f60e03f5fe03f4fe03f32503f20e03f19603f02503ef8a4105ef
fe03ee9603ed9603ecfa03ebfa03eafe03e93a03e84203e7fe03e63203e5e45305e59603e48a
4105e45303e3e22f05e3fa03e22f03e1fe03e0fe03df3203de1403dd9603dcfe03db1203da7d
03d9bb03d8fe03d68a4105d67d03d5d44705d57d03d44703d3d21b05d3fe03d21b03d1fe03d0
fe03cffe03cefe03cd9603cccb1e05ccfe03cb1e03ca3203c9fe03c6851105c61c03c51603c4
fe03c3fe03c2fe03c1fe03c0fe03bffe03befe03bdfe03bcfe03bbfe03ba1103b9862505b9fe
03b8b7bb05b8fe03b7b65d05b7bb03b78004b6b52505b65d40ff03b64004b52503b4fe03b396
03b2fe03b1fe03b0fe03affe03ae6403ad0e03acab2505ac6403abaa1205ab2503aa1203a98a
4105a9fa03a8fe03a7fe03a6fe03a51203a4fe03a3a20e05a33203a20e03a16403a08a4105a0
96039ffe039e9d0c059efe039d0c039c9b19059c64039b9a10059b19039a1003990a0398fe03
97960d0597fe03960d03958a410595960394930e05942803930e0392fa039190bb0591fe0390
8f5d0590bb039080048f8e25058f5d038f40048e25038dfe038c8b2e058cfe038b2e038a8625
058a410389880b05891403880b03878625058764038685110586250385110384fe0383821105
83fe0382110381fe0380fe037ffe0340ff7e7d7d057efe037d7d037c64037b5415057b25037a
fe0379fe03780e03770c03760a0375fe0374fa0373fa0372fa0371fa0370fe036ffe036efe03
6c21036bfe036a1142056a530369fe03687d036711420566fe0365fe0364fe0363fe0362fe03
613a0360fa035e0c035dfe035bfe035afe0359580a0559fa03580a035716190557320356fe03
5554150555420354150353011005531803521403514a130551fe03500b034ffe034e4d10054e
fe034d10034cfe034b4a13054bfe034a4910054a1303491d0d05491003480d0347fe03469603
45960344fe0343022d0543fa0342bb03414b0340fe033ffe033e3d12053e14033d3c0f053d12
033c3b0d053c40ff0f033b0d033afe0339fe033837140538fa033736100537140336350b0536
1003350b03341e03330d0332310b0532fe03310b03302f0b05300d032f0b032e2d09052e1003
2d09032c32032b2a25052b64032a2912052a25032912032827250528410327250326250b0526
0f03250b0324fe0323fe03220f03210110052112032064031ffa031e1d0d051e64031d0d031c
1142051cfe031bfa031a42031911420519fe031864031716190517fe031601100516190315fe
0314fe0313fe031211420512fe0311022d05114203107d030f64030efe030d0c16050dfe030c
0110050c16030bfe030a100309fe0308022d0508fe030714030664030401100504fe03401503
022d0503fe0302011005022d0301100300fe0301b80164858d012b2b2b2b2b2b2b2b2b2b2b2b
2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b
2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b
2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b
2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b
2b002b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b
2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b
2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b
2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b
2b2b2b2b2b2b2b1d00>
] def
/f-0-0 currentdict end definefont pop
%%Page: 1 1
%%BeginPageSetup
%%PageBoundingBox: 0 -1 439 148
%%EndPageSetup
q 0 -1 439 149 rectclip q
0 147.503 439 -148 re W n
0 g
0.258088 w
0 J
0 j
[] 0.0 d
4 M q 1 0 0 -1 0 147.502655 cm
33.359 0.203 35.418 32.465 re S Q
BT
26.770834 0 0 26.770834 41.118379 121.504899 Tm
/f-0-0 1 Tf
<01>Tj
ET
BT
6.692709 0 0 6.692709 5.87895 97.85893 Tm
/f-0-0 1 Tf
[<02>-1<03>1<04>-1<05060407>18<08>-1<02>-1<0509010602>-1<0a0b>-1<050a09
0a02>]TJ
ET
BT
6.692709 0 0 6.692709 -0.656853 1.910554 Tm
/f-0-0 1 Tf
[<02>-1<03>1<04>-1<05060407>18<08>-1<02>-1<050c>-1<03>1<060d>-1<050e09
01060f>-1<090a0b>78<0703>]TJ
ET
BT
6.692709 0 0 6.692709 119.919374 1.578413 Tm
/f-0-0 1 Tf
[<02>-1<03>1<04>-1<05060407>18<08>-1<02>-1<050c>-1<03>1<060d>-1<0510>1<02>-1<01>71<0b
0611>-1<0703>]TJ
ET
BT
6.692709 0 0 6.692709 227.238808 1.578413 Tm
/f-0-0 1 Tf
[<02>-1<03>1<04>-1<05060407>18<08>-1<02>-1<050c>-1<03>1<060d>-1<050b01>40<07>1<0a
121002>-1<011202>]TJ
ET
BT
6.692709 0 0 6.692709 339.64684 1.578413 Tm
/f-0-0 1 Tf
[<02>-1<03>1<04>-1<05060407>18<08>-1<02>-1<050c>-1<03>1<060d>-1<050b01>40<07>1<0a
120d>-1<091202>]TJ
ET
q 0 -1 -1 0 0 147.502655 cm
0.133 -180.504 m 35.551 -180.504 l 35.551 -148.039 l 0.133 -148.039 l h
0.133 -180.504 m S Q
BT
0 -26.770834 26.770834 0 154.710442 139.611084 Tm
/f-0-0 1 Tf
<01>Tj
ET
BT
6.692709 0 0 6.692709 116.829362 97.930359 Tm
/f-0-0 1 Tf
[<02>-1<03>1<04>-1<05060407>18<08>-1<02>-1<0501090b>77<07>79<0b>-1<02>-1<05
1314>-1<0511>-1<15>]TJ
ET
0.418294 w
[ 1.673177 1.673177] 0 d
q 1 0 0 -1 0 147.502655 cm
188.691 6.34 m 203.902 6.762 203.902 23.664 203.902 23.664 c S Q
203.902 128.022 m 202.227 129.694 l 203.902 123.839 l 205.574 129.694 l
h
203.902 128.022 m f*
0.418294 w
[] 0.0 d
q -0.000000000000000061 1 1 0.000000000000000061 0 147.502655 cm
-19.48 203.902 m -17.809 202.227 l -23.664 203.902 l -17.809 205.574 l
h
-19.48 203.902 m S Q
0.258088 w
q -1 0 0 1 0 147.502655 cm
-259.02 -0.203 -35.414 -32.465 re S Q
BT
-26.770834 0 0 -26.770834 286.675329 140.626912 Tm
/f-0-0 1 Tf
<01>Tj
ET
BT
6.692709 0 0 6.692709 227.153139 97.85893 Tm
/f-0-0 1 Tf
[<02>-1<03>1<04>-1<05060407>18<08>-1<02>-1<0501090b>77<07>79<0b>-1<02>-1<05
1617>-1<140511>-1<15>]TJ
ET
0.418294 w
[ 1.673177 1.673177] 0 d
q 1 0 0 -1 0 147.502655 cm
309.098 1.129 m 336.566 0.707 336.566 31.129 309.523 31.555 c S Q
313.703 116.014 m 315.352 117.714 l 309.523 115.948 l 315.402 114.37 l
h
313.703 116.014 m f*
0.418243 w
[] 0.0 d
q 1 0.0156251 0.0156251 -1 0 147.502655 cm
313.135 36.381 m 314.809 34.708 l 308.955 36.382 l 314.808 38.052 l h
313.135 36.381 m S Q
0.258088 w
q 0 1 1 0 0 147.502655 cm
-35.621 371.004 m -0.203 371.004 l -0.203 403.473 l -35.621 403.473 l h
-35.621 371.004 m S Q
BT
0 26.770834 -26.770834 0 396.799291 119.640799 Tm
/f-0-0 1 Tf
<01>Tj
ET
BT
6.692709 0 0 6.692709 337.456361 97.85893 Tm
/f-0-0 1 Tf
[<02>-1<03>1<04>-1<05060407>18<08>-1<02>-1<0501090b>77<07>79<0b>-1<02>-1<05
1314>-1<0511>-1<1115>]TJ
ET
0.418294 w
[ 1.673177 1.673177] 0 d
q 1 0 0 -1 0 147.502655 cm
435.734 11.691 m 420.52 12.117 420.52 29.016 420.52 29.016 c S Q
420.52 122.667 m 418.848 124.342 l 420.52 118.487 l 422.195 124.342 l h
420.52 122.667 m f*
0.418294 w
[] 0.0 d
q -0.000000000000000061 1 1 0.000000000000000061 0 147.502655 cm
-24.836 420.52 m -23.16 418.848 l -29.016 420.52 l -23.16 422.195 l h
-24.836 420.52 m S Q
0.258901 w
q 0.996859 0 0 1 0 147.502655 cm
148.505 -95.23 35.53 -32.566 re S Q
BT
26.770834 0 0 -26.855176 155.7977 45.580831 Tm
/f-0-0 1 Tf
<01>Tj
ET
0.418294 w
[ 1.254883 1.254883] 0 d
q 1 0 0 -1 0 147.502655 cm
190.43 111.617 m 141.84 111.617 l S Q
[] 0.0 d
q 1 0 0 -1 0 147.502655 cm
186.746 109.188 m 194.352 99.469 194.773 123.555 186.746 113.836 c S Q
187.812 32.378 m 188.988 32.264 l 186.48 33.991 l 187.699 31.202 l h
187.812 32.378 m f*
0.161245 w
q 0.826086 -1 -1 -0.826086 0 147.502655 cm
160.646 -55.105 m 161.291 -55.748 l 159.033 -55.105 l 161.29 -54.46 l h
160.646 -55.105 m S Q
0.258088 w
q -0.995481 0 0 -1 0 147.502655 cm
-33.511 95.23 -35.418 32.465 re S Q
BT
-26.649854 0 0 26.770834 60.892251 26.479834 Tm
/f-0-0 1 Tf
<01>Tj
ET
0.418294 w
[ 1.254883 1.254883] 0 d
q 1 0 0 -1 0 147.502655 cm
50.988 88.25 m 50.988 136.84 l S Q
[] 0.0 d
q 1 0 0 -1 0 147.502655 cm
48.66 91.945 m 38.941 84.34 63.027 83.918 53.309 91.945 c S Q
54.598 56.624 m 54.711 57.8 l 52.988 55.292 l 55.777 56.51 l h
54.598 56.624 m f*
0.161244 w
q 1 0.826087 0.826087 -1 0 147.502655 cm
-12.171 80.825 m -11.526 80.182 l -13.781 80.826 l -11.525 81.471 l h
-12.171 80.825 m S Q
0.258088 w
q 0 0.999398 -1 0 0 147.502655 cm
-130.704 -291.492 m -95.288 -291.492 l -95.288 -259.027 l -130.704
-259.027 l h
-130.704 -291.492 m S Q
BT
0 26.754721 26.770834 0 265.699202 24.632379 Tm
/f-0-0 1 Tf
<01>Tj
ET
0.418294 w
[ 1.254883 1.254883] 0 d
q 1 0 0 -1 0 147.502655 cm
295.758 92.602 m 250.125 138.234 l S Q
[] 0.0 d
q 1 0 0 -1 0 147.502655 cm
292.52 92.125 m 291.027 79.875 308.355 96.609 295.809 95.414 c S Q
297.473 51.932 m 298.387 52.686 l 295.391 52.128 l 298.227 51.018 l h
297.473 51.932 m f*
0.208205 w
q 1 -0.0952375 -0.0952375 -1 0 147.502655 cm
303.819 66.635 m 304.654 65.802 l 301.737 66.638 l 304.652 67.47 l h
303.819 66.635 m S Q
0.258088 w
q 0 -1 1 0 0 147.502655 cm
95.23 370.895 m 130.645 370.895 l 130.645 403.359 l 95.23 403.359 l h
95.23 370.895 m S Q
BT
0 -26.770834 -26.77084 0 396.689607 44.514591 Tm
/f-0-0 1 Tf
<01>Tj
ET
0.418294 w
[ 1.254883 1.254883] 0 d
q 1 0 0 -1 0 147.502655 cm
366.168 92.016 m 411.801 137.652 l S Q
[] 0.0 d
q 1 0 0 -1 0 147.502655 cm
366.961 96.102 m 354.711 97.594 371.445 80.266 370.25 92.812 c S Q
370.406 56.354 m 369.652 57.268 l 370.207 54.272 l 371.32 57.108 l h
370.406 56.354 m f*
0.208205 w
q 0.0952375 1 1 -0.0952375 0 147.502655 cm
-55.37 375.68 m -54.535 374.846 l -57.452 375.679 l -54.536 376.514 l h
-55.37 375.68 m S Q
Q Q
showpage
%%Trailer
count op_count sub {pop} repeat
countdictstack dict_count sub {end} repeat
cairo_eps_state restore
%%EOF

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

View File

@ -56,6 +56,7 @@ SRCS = \
calendar_example_05.c \
calendar_example_06.c \
clock_example.c \
image_example_01.c \
theme_example.edc
pkglib_PROGRAMS =
@ -104,6 +105,7 @@ pkglib_PROGRAMS += \
calendar_example_05 \
calendar_example_06 \
clock_example \
image_example_01 \
flipselector_example \
theme_example.edj
@ -133,6 +135,7 @@ SCREENSHOTS = \
calendar_example_05:calendar_example_05.png:0.0 \
calendar_example_06:calendar_example_06.png:0.0 \
clock_example:clock_example.png:0.5 \
image_example_01:image_example_01.png:0.0 \
flipselector_example:flipselector_example.png:0.0
screenshots: all

View File

@ -0,0 +1,60 @@
//Compile with:
//gcc -g `pkg-config --cflags --libs elementary` image_example_01.c -o image_example_01
#include <Elementary.h>
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#else
# define __UNUSED__
# define PACKAGE_DATA_DIR "."
#endif
int
elm_main(int argc __UNUSED__, char **argv __UNUSED__)
{
Evas_Object *win, *bg, *image;
char buf[PATH_MAX];
win = elm_win_add(NULL, "image", ELM_WIN_BASIC);
elm_win_title_set(win, "Image");
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
elm_win_autodel_set(win, 1);
bg = elm_bg_add(win);
elm_bg_color_set(bg, 255,255 ,255);
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, bg);
evas_object_show(bg);
snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", PACKAGE_DATA_DIR);
image = elm_image_add(win);
if (!elm_image_file_set(image, buf, NULL))
{
printf("error: could not load image \"%s\"\n", buf);
return -1;
}
elm_image_no_scale_set(image, EINA_TRUE);
elm_image_scale_set(image, EINA_FALSE, EINA_TRUE);
elm_image_smooth_set(image, EINA_FALSE);
elm_image_orient_set(image, ELM_IMAGE_FLIP_HORIZONTAL);
elm_image_aspect_ratio_retained_set(image, EINA_TRUE);
elm_image_fill_outside_set(image, EINA_TRUE);
elm_image_editable_set(image, EINA_TRUE);
evas_object_size_hint_weight_set(image, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, image);
evas_object_show(image);
evas_object_size_hint_min_set(bg, 160, 160);
evas_object_size_hint_max_set(bg, 640, 640);
evas_object_resize(win, 320, 320);
evas_object_show(win);
elm_run();
return 0;
}
ELM_MAIN()

View File

@ -1858,44 +1858,379 @@ extern "C" {
* "clicked" - the user clicked the icon
*/
/* image */
/**
* @defgroup Image Image
*
* An object that allows one to load an image file to it. It can be used
* anywhere like any other elementary widget.
*
* This widget provides most of the functionality provided from @ref Bg or @ref
* Icon, but with a slightly different API (use the one that fits better your
* needs).
*
* The features not provided by those two other image widgets are:
* @li allowing to get the basic @c Evas_Object with elm_image_object_get();
* @li change the object orientation with elm_image_orient_set();
* @li and turning the image editable with elm_image_editable_set().
*
* Signals that you can add callbacks for are:
*
* @li @c "clicked" - This is called when a user has clicked the image
*
* An example of usage for this API follows:
* @li @ref tutorial_image
*/
/**
* @addtogroup Image
* @{
*/
/**
* @enum _Elm_Image_Orient
* @typedef Elm_Image_Orient
*
* Possible orientation options for elm_image_orient_set().
*
* @image html elm_image_orient_set.png
* @image latex elm_image_orient_set.eps width=\textwidth
*
* @ingroup Image
*/
typedef enum _Elm_Image_Orient
{
ELM_IMAGE_ORIENT_NONE,
ELM_IMAGE_ROTATE_90_CW,
ELM_IMAGE_ROTATE_180_CW,
ELM_IMAGE_ROTATE_90_CCW,
ELM_IMAGE_FLIP_HORIZONTAL,
ELM_IMAGE_FLIP_VERTICAL,
ELM_IMAGE_FLIP_TRANSPOSE,
ELM_IMAGE_FLIP_TRANSVERSE
ELM_IMAGE_ORIENT_NONE, /**< no orientation change */
ELM_IMAGE_ROTATE_90_CW, /**< rotate 90 degrees clockwise */
ELM_IMAGE_ROTATE_180_CW, /**< rotate 180 degrees clockwise */
ELM_IMAGE_ROTATE_90_CCW, /**< rotate 90 degrees counter-clockwise (i.e. 270 degrees clockwise) */
ELM_IMAGE_FLIP_HORIZONTAL, /**< flip image horizontally */
ELM_IMAGE_FLIP_VERTICAL, /**< flip image vertically */
ELM_IMAGE_FLIP_TRANSPOSE, /**< flip the image along the y = (side - x) line*/
ELM_IMAGE_FLIP_TRANSVERSE /**< flip the image along the y = x line */
} Elm_Image_Orient;
/**
* Add a new image to the parent.
*
* @param parent The parent object
* @return The new object or NULL if it cannot be created
*
* @see elm_image_file_set()
*
* @ingroup Image
*/
EAPI Evas_Object *elm_image_add(Evas_Object *parent) EINA_ARG_NONNULL(1);
/**
* Set the file that will be used as image.
*
* @param obj The image object
* @param file The path to file that will be used as image
* @param group The group that the image belongs in edje file (if it's an
* edje image)
*
* @return (#EINA_TRUE = success, #EINA_FALSE = error)
*
* @see elm_image_file_get()
*
* @ingroup Image
*/
EAPI Eina_Bool elm_image_file_set(Evas_Object *obj, const char *file, const char *group) EINA_ARG_NONNULL(1, 2);
/**
* Get the file that will be used as image.
*
* @param obj The image object
* @param file The path to file
* @param group The group that the image belongs in edje file
*
* @see elm_image_file_set()
*
* @ingroup Image
*/
EAPI void elm_image_file_get(const Evas_Object *obj, const char **file, const char **group) EINA_ARG_NONNULL(1);
/**
* Set the smooth effect for a image.
*
* @param obj The image object
* @param smooth #EINA_TRUE if smooth scaling should be used, #EINA_FALSE
* otherwise. Default is #EINA_TRUE.
*
* Set the scaling algorithm to be used when scaling the image. Smooth
* scaling provides a better resulting image, but is slower.
*
* The smooth scaling should be disabled when making animations that change
* the image size, since it will be faster. Animations that don't require
* resizing of the image can keep the smooth scaling enabled (even if the
* image is already scaled, since the scaled image will be cached).
*
* @see elm_image_smooth_get()
*
* @ingroup Image
*/
EAPI void elm_image_smooth_set(Evas_Object *obj, Eina_Bool smooth) EINA_ARG_NONNULL(1);
/**
* Get the smooth effect for a image.
*
* @param obj The image object
* @return #EINA_TRUE if smooth scaling is enabled, #EINA_FALSE otherwise.
*
* @see elm_image_smooth_get()
*
* @ingroup Image
*/
EAPI Eina_Bool elm_image_smooth_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
/**
* Gets the current size of the image.
*
* @param obj The image object.
* @param w Pointer to store width, or NULL.
* @param h Pointer to store height, or NULL.
*
* This is the real size of the image, not the size of the object.
*
* On error, neither w or h will be written.
*
* @ingroup Image
*/
EAPI void elm_image_object_size_get(const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1);
/**
* Disable scaling of this object.
*
* @param obj The image object.
* @param no_scale #EINA_TRUE if the object is not scalable, #EINA_FALSE
* otherwise. Default is #EINA_FALSE.
*
* This function disables scaling of the elm_image widget through the
* function elm_object_scale_set(). However, this does not affect the widget
* size/resize in any way. For that effect, take a look at
* elm_image_scale_set().
*
* @see elm_image_no_scale_get()
* @see elm_image_scale_set()
* @see elm_object_scale_set()
*
* @ingroup Image
*/
EAPI void elm_image_no_scale_set(Evas_Object *obj, Eina_Bool no_scale) EINA_ARG_NONNULL(1);
/**
* Get whether scaling is disabled on the object.
*
* @param obj The image object
* @return #EINA_TRUE if scaling is disabled, #EINA_FALSE otherwise
*
* @see elm_image_no_scale_set()
*
* @ingroup Image
*/
EAPI Eina_Bool elm_image_no_scale_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
/**
* Set if the object is (up/down) resizeable.
*
* @param obj The image object
* @param scale_up A bool to set if the object is resizeable up. Default is
* #EINA_TRUE.
* @param scale_down A bool to set if the object is resizeable down. Default
* is #EINA_TRUE.
*
* This function limits the image resize ability. If @p scale_up is set to
* #EINA_FALSE, the object can't have its height or width resized to a value
* higher than the original image size. Same is valid for @p scale_down.
*
* @see elm_image_scale_get()
*
* @ingroup Image
*/
EAPI void elm_image_scale_set(Evas_Object *obj, Eina_Bool scale_up, Eina_Bool scale_down) EINA_ARG_NONNULL(1);
/**
* Get if the object is (up/down) resizeable.
*
* @param obj The image object
* @param scale_up A bool to set if the object is resizeable up
* @param scale_down A bool to set if the object is resizeable down
*
* @see elm_image_scale_set()
*
* @ingroup Image
*/
EAPI void elm_image_scale_get(const Evas_Object *obj, Eina_Bool *scale_up, Eina_Bool *scale_down) EINA_ARG_NONNULL(1);
/**
* Set if the image fill the entire object area when keeping the aspect ratio.
*
* @param obj The image object
* @param fill_outside #EINA_TRUE if the object is filled outside,
* #EINA_FALSE otherwise. Default is #EINA_FALSE.
*
* When the image should keep its aspect ratio even if resized to another
* aspect ratio, there are two possibilities to resize it: keep the entire
* image inside the limits of height and width of the object (@p fill_outside
* is #EINA_FALSE) or let the extra width or height go outside of the object,
* and the image will fill the entire object (@p fill_outside is #EINA_TRUE).
*
* @note This option will have no effect if
* elm_image_aspect_ratio_retained_set() is set to #EINA_FALSE.
*
* @see elm_image_fill_outside_get()
* @see elm_image_aspect_ratio_retained_set()
*
* @ingroup Image
*/
EAPI void elm_image_fill_outside_set(Evas_Object *obj, Eina_Bool fill_outside) EINA_ARG_NONNULL(1);
/**
* Get if the object is filled outside
*
* @param obj The image object
* @return #EINA_TRUE if the object is filled outside, #EINA_FALSE otherwise.
*
* @see elm_image_fill_outside_set()
*
* @ingroup Image
*/
EAPI Eina_Bool elm_image_fill_outside_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
/**
* Set the prescale size for the image
*
* @param obj The image object
* @param size The prescale size. This value is used for both width and
* height.
*
* This function sets a new size for pixmap representation of the given
* image. It allows the image to be loaded already in the specified size,
* reducing the memory usage and load time when loading a big image with load
* size set to a smaller size.
*
* It's equivalent to the elm_bg_load_size_set() function for bg.
*
* @note this is just a hint, the real size of the pixmap may differ
* depending on the type of image being loaded, being bigger than requested.
*
* @see elm_image_prescale_get()
* @see elm_bg_load_size_set()
*
* @ingroup Image
*/
EAPI void elm_image_prescale_set(Evas_Object *obj, int size) EINA_ARG_NONNULL(1);
/**
* Get the prescale size for the image
*
* @param obj The image object
* @return The prescale size
*
* @see elm_image_prescale_set()
*
* @ingroup Image
*/
EAPI int elm_image_prescale_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
/**
* Set the image orientation.
*
* @param obj The image object
* @param orient The image orientation
* (one of #ELM_IMAGE_ORIENT_NONE, #ELM_IMAGE_ROTATE_90_CW,
* #ELM_IMAGE_ROTATE_180_CW, #ELM_IMAGE_ROTATE_90_CCW,
* #ELM_IMAGE_FLIP_HORIZONTAL, #ELM_IMAGE_FLIP_VERTICAL,
* #ELM_IMAGE_FLIP_TRANSPOSE, #ELM_IMAGE_FLIP_TRANSVERSE).
* Default is #ELM_IMAGE_ORIENT_NONE.
*
* This function allows to rotate or flip the given image.
*
* @see elm_image_orient_get()
* @see @ref Elm_Image_Orient
*
* @ingroup Image
*/
EAPI void elm_image_orient_set(Evas_Object *obj, Elm_Image_Orient orient) EINA_ARG_NONNULL(1);
/**
* Get the image orientation.
*
* @param obj The image object
* @return The image orientation
* (one of #ELM_IMAGE_ORIENT_NONE, #ELM_IMAGE_ROTATE_90_CW,
* #ELM_IMAGE_ROTATE_180_CW, #ELM_IMAGE_ROTATE_90_CCW,
* #ELM_IMAGE_FLIP_HORIZONTAL, #ELM_IMAGE_FLIP_VERTICAL,
* #ELM_IMAGE_FLIP_TRANSPOSE, #ELM_IMAGE_FLIP_TRANSVERSE)
*
* @see elm_image_orient_set()
* @see @ref Elm_Image_Orient
*
* @ingroup Image
*/
EAPI Elm_Image_Orient elm_image_orient_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
/**
* Make the image 'editable'.
*
* @param obj Image object.
* @param set Turn on or off editability. Default is #EINA_FALSE.
*
* This means the image is a valid drag target for drag and drop, and can be
* cut or pasted too.
*
* @ingroup Image
*/
EAPI void elm_image_editable_set(Evas_Object *obj, Eina_Bool set) EINA_ARG_NONNULL(1);
/**
* Make the image 'editable'.
*
* @param obj Image object.
* @return Editability.
*
* This means the image is a valid drag target for drag and drop, and can be
* cut or pasted too.
*
* @ingroup Image
*/
EAPI Eina_Bool elm_image_editable_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
/**
* Get the basic Evas_Image object from this object (widget).
*
* @param obj The image object to get the inlined image from
* @return The inlined image object, or NULL if none exists
*
* This function allows one to get the underlying @c Evas_Object of type
* Image from this elementary widget. It can be useful to do things like get
* the pixel data, save the image to a file, etc.
*
* @note Be careful to not manipulate it, as it is under control of
* elementary.
*
* @ingroup Image
*/
EAPI Evas_Object *elm_image_object_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
/**
* Set whether the original aspect ratio of the image should be kept on resize.
*
* @param obj The image object.
* @param retained #EINA_TRUE if the image should retain the aspect,
* #EINA_FALSE otherwise.
*
* The original aspect ratio (width / height) of the image is usually
* distorted to match the object's size. Enabling this option will retain
* this original aspect, and the way that the image is fit into the object's
* area depends on the option set by elm_image_fill_outside_set().
*
* @see elm_image_aspect_ratio_retained_get()
* @see elm_image_fill_outside_set()
*
* @ingroup Image
*/
EAPI void elm_image_aspect_ratio_retained_set(Evas_Object *obj, Eina_Bool retained) EINA_ARG_NONNULL(1);
/**
* Get if the object retains the original aspect ratio.
*
* @param obj The image object.
* @return #EINA_TRUE if the object keeps the original aspect, #EINA_FALSE
* otherwise.
*
* @ingroup Image
*/
EAPI Eina_Bool elm_image_aspect_ratio_retained_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
/* smart callbacks called:
* "clicked" - the user clicked the image
*/
/**
* @}
*/
/* glview */
typedef void (*Elm_GLView_Func)(Evas_Object *obj);

View File

@ -1,19 +1,6 @@
#include <Elementary.h>
#include "elm_priv.h"
/**
* @defgroup Image Image
*
* A standard image that may be provided by the theme (delete, edit,
* arrows etc.) or a custom file (PNG, JPG, EDJE etc.) used for an
* icon. The Icon may scale or not and of course... support alpha
* channels.
*
* Signals that you can add callbacks for are:
*
* "clicked" - This is called when a user has clicked the image
*/
typedef struct _Widget_Data Widget_Data;
struct _Widget_Data
@ -106,14 +93,6 @@ _mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *eve
evas_object_smart_callback_call(data, SIG_CLICKED, NULL);
}
/**
* Add a new image to the parent
*
* @param parent The parent object
* @return The new object or NULL if it cannot be created
*
* @ingroup Image
*/
EAPI Evas_Object *
elm_image_add(Evas_Object *parent)
{
@ -150,17 +129,6 @@ elm_image_add(Evas_Object *parent)
return obj;
}
/**
* Set the file that will be used as image
*
* @param obj The image object
* @param file The path to file that will be used as image
* @param group The group that the image belongs in edje file
*
* @return (1 = success, 0 = error)
*
* @ingroup Image
*/
EAPI Eina_Bool
elm_image_file_set(Evas_Object *obj, const char *file, const char *group)
{
@ -179,15 +147,6 @@ elm_image_file_set(Evas_Object *obj, const char *file, const char *group)
return ret;
}
/**
* Get the file that will be used as image
*
* @param obj The image object
* @param file The path to file
* @param group The group that the image belongs in edje file
*
* @ingroup Image
*/
EAPI void
elm_image_file_get(const Evas_Object *obj, const char **file, const char **group)
{
@ -197,15 +156,6 @@ elm_image_file_get(const Evas_Object *obj, const char **file, const char **group
_els_smart_icon_file_get(wd->img, file, group);
}
/**
* Set the smooth effect for a image
*
* @param obj The image object
* @param smooth A bool to set (or no) smooth effect
* (1 = smooth, 0 = not smooth)
*
* @ingroup Image
*/
EAPI void
elm_image_smooth_set(Evas_Object *obj, Eina_Bool smooth)
{
@ -217,14 +167,6 @@ elm_image_smooth_set(Evas_Object *obj, Eina_Bool smooth)
_sizing_eval(obj);
}
/**
* Get the smooth effect for a image
*
* @param obj The image object
* @return If setted smooth effect
*
* @ingroup Image
*/
EAPI Eina_Bool
elm_image_smooth_get(const Evas_Object *obj)
{
@ -235,19 +177,6 @@ elm_image_smooth_get(const Evas_Object *obj)
return wd->smooth;
}
/**
* Gets the current size of the image.
*
* Either width or height (or both) may be NULL.
*
* On error, neither w or h will be written too.
*
* @param obj The image object.
* @param w Pointer to store width, or NULL.
* @param h Pointer to store height, or NULL.
*
* @ingroup Image
*/
EAPI void
elm_image_object_size_get(const Evas_Object *obj, int *w, int *h)
{
@ -258,15 +187,6 @@ elm_image_object_size_get(const Evas_Object *obj, int *w, int *h)
_els_smart_icon_size_get(wd->img, w, h);
}
/**
* Set if the object are scalable
*
* @param obj The image object.
* @param no_scale A bool to set scale (or no).
* (1 = no_scale, 0 = scale)
*
* @ingroup Image
*/
EAPI void
elm_image_no_scale_set(Evas_Object *obj, Eina_Bool no_scale)
{
@ -279,14 +199,6 @@ elm_image_no_scale_set(Evas_Object *obj, Eina_Bool no_scale)
}
/**
* Get if the object isn't scalable
*
* @param obj The image object
* @return If isn't scalable
*
* @ingroup Image
*/
EAPI Eina_Bool
elm_image_no_scale_get(const Evas_Object *obj)
{
@ -296,15 +208,6 @@ elm_image_no_scale_get(const Evas_Object *obj)
return wd->no_scale;
}
/**
* Set if the object is (up/down) scalable
*
* @param obj The image object
* @param scale_up A bool to set if the object is scalable up
* @param scale_down A bool to set if the object is scalable down
*
* @ingroup Image
*/
EAPI void
elm_image_scale_set(Evas_Object *obj, Eina_Bool scale_up, Eina_Bool scale_down)
{
@ -317,15 +220,6 @@ elm_image_scale_set(Evas_Object *obj, Eina_Bool scale_up, Eina_Bool scale_down)
_sizing_eval(obj);
}
/**
* Get if the object is (up/down) scalable
*
* @param obj The image object
* @param scale_up A bool to set if the object is scalable up
* @param scale_down A bool to set if the object is scalable down
*
* @ingroup Image
*/
EAPI void
elm_image_scale_get(const Evas_Object *obj, Eina_Bool *scale_up, Eina_Bool *scale_down)
{
@ -336,15 +230,6 @@ elm_image_scale_get(const Evas_Object *obj, Eina_Bool *scale_up, Eina_Bool *scal
if (scale_down) *scale_down = wd->scale_down;
}
/**
* Set if the object is filled outside
*
* @param obj The image object
* @param fill_outside A bool to set if the object is filled outside
* (1 = filled, 0 = no filled)
*
* @ingroup Image
*/
EAPI void
elm_image_fill_outside_set(Evas_Object *obj, Eina_Bool fill_outside)
{
@ -356,14 +241,6 @@ elm_image_fill_outside_set(Evas_Object *obj, Eina_Bool fill_outside)
_sizing_eval(obj);
}
/**
* Get if the object is filled outside
*
* @param obj The image object
* @return If the object is filled outside
*
* @ingroup Image
*/
EAPI Eina_Bool
elm_image_fill_outside_get(const Evas_Object *obj)
{
@ -374,14 +251,6 @@ elm_image_fill_outside_get(const Evas_Object *obj)
return wd->fill_outside;
}
/**
* Set the prescale size for the image
*
* @param obj The image object
* @param size The prescale size
*
* @ingroup Image
*/
EAPI void
elm_image_prescale_set(Evas_Object *obj, int size)
{
@ -392,14 +261,6 @@ elm_image_prescale_set(Evas_Object *obj, int size)
_els_smart_icon_scale_size_set(wd->img, size);
}
/**
* Get the prescale size for the image
*
* @param obj The image object
* @return The prescale size
*
* @ingroup Image
*/
EAPI int
elm_image_prescale_get(const Evas_Object *obj)
{
@ -410,18 +271,6 @@ elm_image_prescale_get(const Evas_Object *obj)
return _els_smart_icon_scale_size_get(wd->img);
}
/**
* Set the image orient
*
* @param obj The image object
* @param orient The image orient
* (ELM_IMAGE_ORIENT_NONE, ELM_IMAGE_ROTATE_90_CW,
* ELM_IMAGE_ROTATE_180_CW, ELM_IMAGE_ROTATE_90_CCW,
* ELM_IMAGE_FLIP_HORIZONTAL,ELM_IMAGE_FLIP_VERTICAL,
* ELM_IMAGE_FLIP_TRANSPOSE, ELM_IMAGE_FLIP_TRANSVERSE)
*
* @ingroup Image
*/
EAPI void
elm_image_orient_set(Evas_Object *obj, Elm_Image_Orient orient)
{
@ -432,18 +281,6 @@ elm_image_orient_set(Evas_Object *obj, Elm_Image_Orient orient)
_els_smart_icon_orient_set(wd->img, orient);
}
/**
* Get the image orient
*
* @param obj The image object
* @return The image orient
* (ELM_IMAGE_ORIENT_NONE, ELM_IMAGE_ROTATE_90_CW,
* ELM_IMAGE_ROTATE_180_CW, ELM_IMAGE_ROTATE_90_CCW,
* ELM_IMAGE_FLIP_HORIZONTAL,ELM_IMAGE_FLIP_VERTICAL,
* ELM_IMAGE_FLIP_TRANSPOSE, ELM_IMAGE_FLIP_TRANSVERSE)
*
* @ingroup Image
*/
EAPI Elm_Image_Orient
elm_image_orient_get(const Evas_Object *obj)
{
@ -453,17 +290,6 @@ elm_image_orient_get(const Evas_Object *obj)
return _els_smart_icon_orient_get(wd->img);
}
/**
* Make the image 'editable'.
*
* This means the image is a valid drag target for drag and drop, and can be
* cut or pasted too.
*
* @param obj Image object.
* @param set Turn on or off editability.
*
* @ingroup Image
*/
EAPI void
elm_image_editable_set(Evas_Object *obj, Eina_Bool set)
{
@ -474,15 +300,6 @@ elm_image_editable_set(Evas_Object *obj, Eina_Bool set)
_els_smart_icon_edit_set(wd->img, set, obj);
}
/**
* Make the image 'editable'.
*
* This means the image is a valid drag target for drag and drop, and can be
* cut or pasted too.
*
* @param obj Image object.
* @return Editability.
*/
EAPI Eina_Bool
elm_image_editable_get(const Evas_Object *obj)
{
@ -492,18 +309,6 @@ elm_image_editable_get(const Evas_Object *obj)
return _els_smart_icon_edit_get(wd->img);
}
/**
* Get the image object
*
* When you create a image with elm_image_add(). You can get this object (be
* careful to not manipulate it as it is under control of elementary), and use
* it to do things like get pixel data, save the image to a file, etc.
*
* @param obj The image object to get the inlined image from
* @return The inlined image object, or NULL if none exists
*
* @ingroup Image
*/
EAPI Evas_Object *
elm_image_object_get(const Evas_Object *obj)
{
@ -513,14 +318,6 @@ elm_image_object_get(const Evas_Object *obj)
return _els_smart_icon_object_get(wd->img);
}
/**
* Enable/disable retaining up the aspect ratio of the image.
*
* @param obj The image object.
* @param retained Retaining or Non retaining.
*
* @ingroup Image
*/
EAPI void
elm_image_aspect_ratio_retained_set(Evas_Object *obj, Eina_Bool retained)
{
@ -530,14 +327,6 @@ elm_image_aspect_ratio_retained_set(Evas_Object *obj, Eina_Bool retained)
return _els_smart_icon_aspect_ratio_retained_set(wd->img, retained);
}
/**
* Get if the object retains the aspect ratio.
*
* @param obj The image object.
* @return If the object retains the aspect ratio.
*
* @ingroup Image
*/
EAPI Eina_Bool
elm_image_aspect_ratio_retained_get(const Evas_Object *obj)
{