vidconsole-uclass.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (c) 2015 Google, Inc
  4. * (C) Copyright 2001-2015
  5. * DENX Software Engineering -- wd@denx.de
  6. * Compulab Ltd - http://compulab.co.il/
  7. * Bernecker & Rainer Industrieelektronik GmbH - http://www.br-automation.com
  8. */
  9. #define LOG_CATEGORY UCLASS_VIDEO_CONSOLE
  10. #include <common.h>
  11. #include <command.h>
  12. #include <console.h>
  13. #include <log.h>
  14. #include <dm.h>
  15. #include <video.h>
  16. #include <video_console.h>
  17. #include <video_font.h> /* Bitmap font for code page 437 */
  18. #include <linux/ctype.h>
  19. int vidconsole_putc_xy(struct udevice *dev, uint x, uint y, char ch)
  20. {
  21. struct vidconsole_ops *ops = vidconsole_get_ops(dev);
  22. if (!ops->putc_xy)
  23. return -ENOSYS;
  24. return ops->putc_xy(dev, x, y, ch);
  25. }
  26. int vidconsole_move_rows(struct udevice *dev, uint rowdst, uint rowsrc,
  27. uint count)
  28. {
  29. struct vidconsole_ops *ops = vidconsole_get_ops(dev);
  30. if (!ops->move_rows)
  31. return -ENOSYS;
  32. return ops->move_rows(dev, rowdst, rowsrc, count);
  33. }
  34. int vidconsole_set_row(struct udevice *dev, uint row, int clr)
  35. {
  36. struct vidconsole_ops *ops = vidconsole_get_ops(dev);
  37. if (!ops->set_row)
  38. return -ENOSYS;
  39. return ops->set_row(dev, row, clr);
  40. }
  41. static int vidconsole_entry_start(struct udevice *dev)
  42. {
  43. struct vidconsole_ops *ops = vidconsole_get_ops(dev);
  44. if (!ops->entry_start)
  45. return -ENOSYS;
  46. return ops->entry_start(dev);
  47. }
  48. /* Move backwards one space */
  49. static int vidconsole_back(struct udevice *dev)
  50. {
  51. struct vidconsole_priv *priv = dev_get_uclass_priv(dev);
  52. struct vidconsole_ops *ops = vidconsole_get_ops(dev);
  53. int ret;
  54. if (ops->backspace) {
  55. ret = ops->backspace(dev);
  56. if (ret != -ENOSYS)
  57. return ret;
  58. }
  59. priv->xcur_frac -= VID_TO_POS(priv->x_charsize);
  60. if (priv->xcur_frac < priv->xstart_frac) {
  61. priv->xcur_frac = (priv->cols - 1) *
  62. VID_TO_POS(priv->x_charsize);
  63. priv->ycur -= priv->y_charsize;
  64. if (priv->ycur < 0)
  65. priv->ycur = 0;
  66. }
  67. return video_sync(dev->parent, false);
  68. }
  69. /* Move to a newline, scrolling the display if necessary */
  70. static void vidconsole_newline(struct udevice *dev)
  71. {
  72. struct vidconsole_priv *priv = dev_get_uclass_priv(dev);
  73. struct udevice *vid_dev = dev->parent;
  74. struct video_priv *vid_priv = dev_get_uclass_priv(vid_dev);
  75. const int rows = CONFIG_VAL(CONSOLE_SCROLL_LINES);
  76. int i, ret;
  77. priv->xcur_frac = priv->xstart_frac;
  78. priv->ycur += priv->y_charsize;
  79. /* Check if we need to scroll the terminal */
  80. if ((priv->ycur + priv->y_charsize) / priv->y_charsize > priv->rows) {
  81. vidconsole_move_rows(dev, 0, rows, priv->rows - rows);
  82. for (i = 0; i < rows; i++)
  83. vidconsole_set_row(dev, priv->rows - i - 1,
  84. vid_priv->colour_bg);
  85. priv->ycur -= rows * priv->y_charsize;
  86. }
  87. priv->last_ch = 0;
  88. ret = video_sync(dev->parent, false);
  89. if (ret) {
  90. #ifdef DEBUG
  91. console_puts_select_stderr(true, "[vc err: video_sync]");
  92. #endif
  93. }
  94. }
  95. static char *parsenum(char *s, int *num)
  96. {
  97. char *end;
  98. *num = simple_strtol(s, &end, 10);
  99. return end;
  100. }
  101. void vidconsole_set_cursor_pos(struct udevice *dev, int x, int y)
  102. {
  103. struct vidconsole_priv *priv = dev_get_uclass_priv(dev);
  104. priv->xcur_frac = VID_TO_POS(x);
  105. priv->xstart_frac = priv->xcur_frac;
  106. priv->ycur = y;
  107. }
  108. /**
  109. * set_cursor_position() - set cursor position
  110. *
  111. * @priv: private data of the video console
  112. * @row: new row
  113. * @col: new column
  114. */
  115. static void set_cursor_position(struct vidconsole_priv *priv, int row, int col)
  116. {
  117. /*
  118. * Ensure we stay in the bounds of the screen.
  119. */
  120. if (row >= priv->rows)
  121. row = priv->rows - 1;
  122. if (col >= priv->cols)
  123. col = priv->cols - 1;
  124. priv->ycur = row * priv->y_charsize;
  125. priv->xcur_frac = priv->xstart_frac +
  126. VID_TO_POS(col * priv->x_charsize);
  127. }
  128. /**
  129. * get_cursor_position() - get cursor position
  130. *
  131. * @priv: private data of the video console
  132. * @row: row
  133. * @col: column
  134. */
  135. static void get_cursor_position(struct vidconsole_priv *priv,
  136. int *row, int *col)
  137. {
  138. *row = priv->ycur / priv->y_charsize;
  139. *col = VID_TO_PIXEL(priv->xcur_frac - priv->xstart_frac) /
  140. priv->x_charsize;
  141. }
  142. /*
  143. * Process a character while accumulating an escape string. Chars are
  144. * accumulated into escape_buf until the end of escape sequence is
  145. * found, at which point the sequence is parsed and processed.
  146. */
  147. static void vidconsole_escape_char(struct udevice *dev, char ch)
  148. {
  149. struct vidconsole_priv *priv = dev_get_uclass_priv(dev);
  150. if (!IS_ENABLED(CONFIG_VIDEO_ANSI))
  151. goto error;
  152. /* Sanity checking for bogus ESC sequences: */
  153. if (priv->escape_len >= sizeof(priv->escape_buf))
  154. goto error;
  155. if (priv->escape_len == 0) {
  156. switch (ch) {
  157. case '7':
  158. /* Save cursor position */
  159. get_cursor_position(priv, &priv->row_saved,
  160. &priv->col_saved);
  161. priv->escape = 0;
  162. return;
  163. case '8': {
  164. /* Restore cursor position */
  165. int row = priv->row_saved;
  166. int col = priv->col_saved;
  167. set_cursor_position(priv, row, col);
  168. priv->escape = 0;
  169. return;
  170. }
  171. case '[':
  172. break;
  173. default:
  174. goto error;
  175. }
  176. }
  177. priv->escape_buf[priv->escape_len++] = ch;
  178. /*
  179. * Escape sequences are terminated by a letter, so keep
  180. * accumulating until we get one:
  181. */
  182. if (!isalpha(ch))
  183. return;
  184. /*
  185. * clear escape mode first, otherwise things will get highly
  186. * surprising if you hit any debug prints that come back to
  187. * this console.
  188. */
  189. priv->escape = 0;
  190. switch (ch) {
  191. case 'A':
  192. case 'B':
  193. case 'C':
  194. case 'D':
  195. case 'E':
  196. case 'F': {
  197. int row, col, num;
  198. char *s = priv->escape_buf;
  199. /*
  200. * Cursor up/down: [%dA, [%dB, [%dE, [%dF
  201. * Cursor left/right: [%dD, [%dC
  202. */
  203. s++; /* [ */
  204. s = parsenum(s, &num);
  205. if (num == 0) /* No digit in sequence ... */
  206. num = 1; /* ... means "move by 1". */
  207. get_cursor_position(priv, &row, &col);
  208. if (ch == 'A' || ch == 'F')
  209. row -= num;
  210. if (ch == 'C')
  211. col += num;
  212. if (ch == 'D')
  213. col -= num;
  214. if (ch == 'B' || ch == 'E')
  215. row += num;
  216. if (ch == 'E' || ch == 'F')
  217. col = 0;
  218. if (col < 0)
  219. col = 0;
  220. if (row < 0)
  221. row = 0;
  222. /* Right and bottom overflows are handled in the callee. */
  223. set_cursor_position(priv, row, col);
  224. break;
  225. }
  226. case 'H':
  227. case 'f': {
  228. int row, col;
  229. char *s = priv->escape_buf;
  230. /*
  231. * Set cursor position: [%d;%df or [%d;%dH
  232. */
  233. s++; /* [ */
  234. s = parsenum(s, &row);
  235. s++; /* ; */
  236. s = parsenum(s, &col);
  237. /*
  238. * Video origin is [0, 0], terminal origin is [1, 1].
  239. */
  240. if (row)
  241. --row;
  242. if (col)
  243. --col;
  244. set_cursor_position(priv, row, col);
  245. break;
  246. }
  247. case 'J': {
  248. int mode;
  249. /*
  250. * Clear part/all screen:
  251. * [J or [0J - clear screen from cursor down
  252. * [1J - clear screen from cursor up
  253. * [2J - clear entire screen
  254. *
  255. * TODO we really only handle entire-screen case, others
  256. * probably require some additions to video-uclass (and
  257. * are not really needed yet by efi_console)
  258. */
  259. parsenum(priv->escape_buf + 1, &mode);
  260. if (mode == 2) {
  261. int ret;
  262. video_clear(dev->parent);
  263. ret = video_sync(dev->parent, false);
  264. if (ret) {
  265. #ifdef DEBUG
  266. console_puts_select_stderr(true, "[vc err: video_sync]");
  267. #endif
  268. }
  269. priv->ycur = 0;
  270. priv->xcur_frac = priv->xstart_frac;
  271. } else {
  272. debug("unsupported clear mode: %d\n", mode);
  273. }
  274. break;
  275. }
  276. case 'K': {
  277. struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent);
  278. int mode;
  279. /*
  280. * Clear (parts of) current line
  281. * [0K - clear line to end
  282. * [2K - clear entire line
  283. */
  284. parsenum(priv->escape_buf + 1, &mode);
  285. if (mode == 2) {
  286. int row, col;
  287. get_cursor_position(priv, &row, &col);
  288. vidconsole_set_row(dev, row, vid_priv->colour_bg);
  289. }
  290. break;
  291. }
  292. case 'm': {
  293. struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent);
  294. char *s = priv->escape_buf;
  295. char *end = &priv->escape_buf[priv->escape_len];
  296. /*
  297. * Set graphics mode: [%d;...;%dm
  298. *
  299. * Currently only supports the color attributes:
  300. *
  301. * Foreground Colors:
  302. *
  303. * 30 Black
  304. * 31 Red
  305. * 32 Green
  306. * 33 Yellow
  307. * 34 Blue
  308. * 35 Magenta
  309. * 36 Cyan
  310. * 37 White
  311. *
  312. * Background Colors:
  313. *
  314. * 40 Black
  315. * 41 Red
  316. * 42 Green
  317. * 43 Yellow
  318. * 44 Blue
  319. * 45 Magenta
  320. * 46 Cyan
  321. * 47 White
  322. */
  323. s++; /* [ */
  324. while (s < end) {
  325. int val;
  326. s = parsenum(s, &val);
  327. s++;
  328. switch (val) {
  329. case 0:
  330. /* all attributes off */
  331. video_set_default_colors(dev->parent, false);
  332. break;
  333. case 1:
  334. /* bold */
  335. vid_priv->fg_col_idx |= 8;
  336. vid_priv->colour_fg = video_index_to_colour(
  337. vid_priv, vid_priv->fg_col_idx);
  338. break;
  339. case 7:
  340. /* reverse video */
  341. vid_priv->colour_fg = video_index_to_colour(
  342. vid_priv, vid_priv->bg_col_idx);
  343. vid_priv->colour_bg = video_index_to_colour(
  344. vid_priv, vid_priv->fg_col_idx);
  345. break;
  346. case 30 ... 37:
  347. /* foreground color */
  348. vid_priv->fg_col_idx &= ~7;
  349. vid_priv->fg_col_idx |= val - 30;
  350. vid_priv->colour_fg = video_index_to_colour(
  351. vid_priv, vid_priv->fg_col_idx);
  352. break;
  353. case 40 ... 47:
  354. /* background color, also mask the bold bit */
  355. vid_priv->bg_col_idx &= ~0xf;
  356. vid_priv->bg_col_idx |= val - 40;
  357. vid_priv->colour_bg = video_index_to_colour(
  358. vid_priv, vid_priv->bg_col_idx);
  359. break;
  360. default:
  361. /* ignore unsupported SGR parameter */
  362. break;
  363. }
  364. }
  365. break;
  366. }
  367. default:
  368. debug("unrecognized escape sequence: %*s\n",
  369. priv->escape_len, priv->escape_buf);
  370. }
  371. return;
  372. error:
  373. /* something went wrong, just revert to normal mode: */
  374. priv->escape = 0;
  375. }
  376. /* Put that actual character on the screen (using the CP437 code page). */
  377. static int vidconsole_output_glyph(struct udevice *dev, char ch)
  378. {
  379. struct vidconsole_priv *priv = dev_get_uclass_priv(dev);
  380. int ret;
  381. /*
  382. * Failure of this function normally indicates an unsupported
  383. * colour depth. Check this and return an error to help with
  384. * diagnosis.
  385. */
  386. ret = vidconsole_putc_xy(dev, priv->xcur_frac, priv->ycur, ch);
  387. if (ret == -EAGAIN) {
  388. vidconsole_newline(dev);
  389. ret = vidconsole_putc_xy(dev, priv->xcur_frac, priv->ycur, ch);
  390. }
  391. if (ret < 0)
  392. return ret;
  393. priv->xcur_frac += ret;
  394. priv->last_ch = ch;
  395. if (priv->xcur_frac >= priv->xsize_frac)
  396. vidconsole_newline(dev);
  397. return 0;
  398. }
  399. int vidconsole_put_char(struct udevice *dev, char ch)
  400. {
  401. struct vidconsole_priv *priv = dev_get_uclass_priv(dev);
  402. int ret;
  403. if (priv->escape) {
  404. vidconsole_escape_char(dev, ch);
  405. return 0;
  406. }
  407. switch (ch) {
  408. case '\x1b':
  409. priv->escape_len = 0;
  410. priv->escape = 1;
  411. break;
  412. case '\a':
  413. /* beep */
  414. break;
  415. case '\r':
  416. priv->xcur_frac = priv->xstart_frac;
  417. break;
  418. case '\n':
  419. vidconsole_newline(dev);
  420. vidconsole_entry_start(dev);
  421. break;
  422. case '\t': /* Tab (8 chars alignment) */
  423. priv->xcur_frac = ((priv->xcur_frac / priv->tab_width_frac)
  424. + 1) * priv->tab_width_frac;
  425. if (priv->xcur_frac >= priv->xsize_frac)
  426. vidconsole_newline(dev);
  427. break;
  428. case '\b':
  429. vidconsole_back(dev);
  430. priv->last_ch = 0;
  431. break;
  432. default:
  433. ret = vidconsole_output_glyph(dev, ch);
  434. if (ret < 0)
  435. return ret;
  436. break;
  437. }
  438. return 0;
  439. }
  440. int vidconsole_put_string(struct udevice *dev, const char *str)
  441. {
  442. const char *s;
  443. int ret;
  444. for (s = str; *s; s++) {
  445. ret = vidconsole_put_char(dev, *s);
  446. if (ret)
  447. return ret;
  448. }
  449. return 0;
  450. }
  451. static void vidconsole_putc(struct stdio_dev *sdev, const char ch)
  452. {
  453. struct udevice *dev = sdev->priv;
  454. int ret;
  455. ret = vidconsole_put_char(dev, ch);
  456. if (ret) {
  457. #ifdef DEBUG
  458. console_puts_select_stderr(true, "[vc err: putc]");
  459. #endif
  460. }
  461. ret = video_sync(dev->parent, false);
  462. if (ret) {
  463. #ifdef DEBUG
  464. console_puts_select_stderr(true, "[vc err: video_sync]");
  465. #endif
  466. }
  467. }
  468. static void vidconsole_puts(struct stdio_dev *sdev, const char *s)
  469. {
  470. struct udevice *dev = sdev->priv;
  471. int ret;
  472. ret = vidconsole_put_string(dev, s);
  473. if (ret) {
  474. #ifdef DEBUG
  475. char str[30];
  476. snprintf(str, sizeof(str), "[vc err: puts %d]", ret);
  477. console_puts_select_stderr(true, str);
  478. #endif
  479. }
  480. ret = video_sync(dev->parent, false);
  481. if (ret) {
  482. #ifdef DEBUG
  483. console_puts_select_stderr(true, "[vc err: video_sync]");
  484. #endif
  485. }
  486. }
  487. void vidconsole_list_fonts(struct udevice *dev)
  488. {
  489. struct vidfont_info info;
  490. int ret, i;
  491. for (i = 0, ret = 0; !ret; i++) {
  492. ret = vidconsole_get_font(dev, i, &info);
  493. if (!ret)
  494. printf("%s\n", info.name);
  495. }
  496. }
  497. int vidconsole_get_font(struct udevice *dev, int seq,
  498. struct vidfont_info *info)
  499. {
  500. struct vidconsole_ops *ops = vidconsole_get_ops(dev);
  501. if (!ops->get_font)
  502. return -ENOSYS;
  503. return ops->get_font(dev, seq, info);
  504. }
  505. int vidconsole_get_font_size(struct udevice *dev, const char **name, uint *sizep)
  506. {
  507. struct vidconsole_ops *ops = vidconsole_get_ops(dev);
  508. if (!ops->get_font_size)
  509. return -ENOSYS;
  510. *name = ops->get_font_size(dev, sizep);
  511. return 0;
  512. }
  513. int vidconsole_select_font(struct udevice *dev, const char *name, uint size)
  514. {
  515. struct vidconsole_ops *ops = vidconsole_get_ops(dev);
  516. if (!ops->select_font)
  517. return -ENOSYS;
  518. return ops->select_font(dev, name, size);
  519. }
  520. int vidconsole_measure(struct udevice *dev, const char *name, uint size,
  521. const char *text, struct vidconsole_bbox *bbox)
  522. {
  523. struct vidconsole_priv *priv = dev_get_uclass_priv(dev);
  524. struct vidconsole_ops *ops = vidconsole_get_ops(dev);
  525. int ret;
  526. if (ops->measure) {
  527. ret = ops->measure(dev, name, size, text, bbox);
  528. if (ret != -ENOSYS)
  529. return ret;
  530. }
  531. bbox->valid = true;
  532. bbox->x0 = 0;
  533. bbox->y0 = 0;
  534. bbox->x1 = priv->x_charsize * strlen(text);
  535. bbox->y1 = priv->y_charsize;
  536. return 0;
  537. }
  538. void vidconsole_push_colour(struct udevice *dev, enum colour_idx fg,
  539. enum colour_idx bg, struct vidconsole_colour *old)
  540. {
  541. struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent);
  542. old->colour_fg = vid_priv->colour_fg;
  543. old->colour_bg = vid_priv->colour_bg;
  544. vid_priv->colour_fg = video_index_to_colour(vid_priv, fg);
  545. vid_priv->colour_bg = video_index_to_colour(vid_priv, bg);
  546. }
  547. void vidconsole_pop_colour(struct udevice *dev, struct vidconsole_colour *old)
  548. {
  549. struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent);
  550. vid_priv->colour_fg = old->colour_fg;
  551. vid_priv->colour_bg = old->colour_bg;
  552. }
  553. /* Set up the number of rows and colours (rotated drivers override this) */
  554. static int vidconsole_pre_probe(struct udevice *dev)
  555. {
  556. struct vidconsole_priv *priv = dev_get_uclass_priv(dev);
  557. struct udevice *vid = dev->parent;
  558. struct video_priv *vid_priv = dev_get_uclass_priv(vid);
  559. priv->xsize_frac = VID_TO_POS(vid_priv->xsize);
  560. return 0;
  561. }
  562. /* Register the device with stdio */
  563. static int vidconsole_post_probe(struct udevice *dev)
  564. {
  565. struct vidconsole_priv *priv = dev_get_uclass_priv(dev);
  566. struct stdio_dev *sdev = &priv->sdev;
  567. if (!priv->tab_width_frac)
  568. priv->tab_width_frac = VID_TO_POS(priv->x_charsize) * 8;
  569. if (dev_seq(dev)) {
  570. snprintf(sdev->name, sizeof(sdev->name), "vidconsole%d",
  571. dev_seq(dev));
  572. } else {
  573. strcpy(sdev->name, "vidconsole");
  574. }
  575. sdev->flags = DEV_FLAGS_OUTPUT;
  576. sdev->putc = vidconsole_putc;
  577. sdev->puts = vidconsole_puts;
  578. sdev->priv = dev;
  579. return stdio_register(sdev);
  580. }
  581. UCLASS_DRIVER(vidconsole) = {
  582. .id = UCLASS_VIDEO_CONSOLE,
  583. .name = "vidconsole0",
  584. .pre_probe = vidconsole_pre_probe,
  585. .post_probe = vidconsole_post_probe,
  586. .per_device_auto = sizeof(struct vidconsole_priv),
  587. };
  588. #ifdef CONFIG_VIDEO_COPY
  589. int vidconsole_sync_copy(struct udevice *dev, void *from, void *to)
  590. {
  591. struct udevice *vid = dev_get_parent(dev);
  592. return video_sync_copy(vid, from, to);
  593. }
  594. int vidconsole_memmove(struct udevice *dev, void *dst, const void *src,
  595. int size)
  596. {
  597. memmove(dst, src, size);
  598. return vidconsole_sync_copy(dev, dst, dst + size);
  599. }
  600. #endif
  601. int vidconsole_clear_and_reset(struct udevice *dev)
  602. {
  603. int ret;
  604. ret = video_clear(dev_get_parent(dev));
  605. if (ret)
  606. return ret;
  607. vidconsole_position_cursor(dev, 0, 0);
  608. return 0;
  609. }
  610. void vidconsole_position_cursor(struct udevice *dev, unsigned col, unsigned row)
  611. {
  612. struct vidconsole_priv *priv = dev_get_uclass_priv(dev);
  613. struct udevice *vid_dev = dev->parent;
  614. struct video_priv *vid_priv = dev_get_uclass_priv(vid_dev);
  615. short x, y;
  616. x = min_t(short, col * priv->x_charsize, vid_priv->xsize - 1);
  617. y = min_t(short, row * priv->y_charsize, vid_priv->ysize - 1);
  618. vidconsole_set_cursor_pos(dev, x, y);
  619. }