Changeset 4583015 in mainline for uspace/lib/ui/src
- Timestamp:
- 2022-03-07T16:10:44Z (3 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ca2680d
- Parents:
- 5c27e77
- Location:
- uspace/lib/ui/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/checkbox.c
r5c27e77 r4583015 192 192 193 193 gfx_text_fmt_init(&fmt); 194 fmt.font = checkbox->res->font; 194 195 fmt.color = checkbox->res->entry_fg_color; 195 196 fmt.halign = gfx_halign_center; 196 197 fmt.valign = gfx_valign_center; 197 198 198 rc = gfx_puttext( checkbox->res->font,&box_center, &fmt, "X");199 rc = gfx_puttext(&box_center, &fmt, "X"); 199 200 if (rc != EOK) 200 201 goto error; … … 207 208 208 209 gfx_text_fmt_init(&fmt); 210 fmt.font = checkbox->res->font; 209 211 fmt.color = checkbox->res->wnd_text_color; 210 212 fmt.halign = gfx_halign_left; 211 213 fmt.valign = gfx_valign_center; 212 214 213 rc = gfx_puttext( checkbox->res->font,&pos, &fmt, checkbox->caption);215 rc = gfx_puttext(&pos, &fmt, checkbox->caption); 214 216 if (rc != EOK) 215 217 goto error; … … 244 246 245 247 gfx_text_fmt_init(&fmt); 248 fmt.font = checkbox->res->font; 246 249 fmt.color = depressed ? checkbox->res->entry_act_bg_color : 247 250 checkbox->res->wnd_text_color; … … 249 252 fmt.valign = gfx_valign_top; 250 253 251 rc = gfx_puttext(checkbox->res->font, &pos, &fmt, 252 checkbox->checked ? "[X]" : "[ ]"); 254 rc = gfx_puttext(&pos, &fmt, checkbox->checked ? "[X]" : "[ ]"); 253 255 if (rc != EOK) 254 256 goto error; … … 259 261 fmt.color = checkbox->res->wnd_text_color; 260 262 261 rc = gfx_puttext( checkbox->res->font,&pos, &fmt, checkbox->caption);263 rc = gfx_puttext(&pos, &fmt, checkbox->caption); 262 264 if (rc != EOK) 263 265 goto error; -
uspace/lib/ui/src/entry.c
r5c27e77 r4583015 314 314 315 315 gfx_text_fmt_init(&fmt); 316 fmt.font = res->font; 316 317 fmt.color = res->entry_fg_color; 317 318 fmt.halign = gfx_halign_left; … … 329 330 entry->text[off1] = '\0'; 330 331 331 rc = gfx_puttext( res->font,&pos, &fmt, entry->text);332 rc = gfx_puttext(&pos, &fmt, entry->text); 332 333 if (rc != EOK) { 333 334 (void) gfx_set_clip_rect(res->gc, NULL); … … 335 336 } 336 337 337 gfx_text_cont( res->font,&pos, &fmt, entry->text, &cpos, &cfmt);338 gfx_text_cont(&pos, &fmt, entry->text, &cpos, &cfmt); 338 339 entry->text[off1] = c; 339 340 … … 345 346 cfmt.color = res->entry_sel_text_fg_color; 346 347 347 gfx_text_rect( res->font,&cpos, &cfmt, entry->text + off1, &sel);348 gfx_text_rect(&cpos, &cfmt, entry->text + off1, &sel); 348 349 sel.p0.x -= ui_entry_sel_hpad; 349 350 sel.p0.y -= ui_entry_sel_vpad; … … 359 360 goto error; 360 361 361 rc = gfx_puttext( res->font,&cpos, &cfmt, entry->text + off1);362 rc = gfx_puttext(&cpos, &cfmt, entry->text + off1); 362 363 if (rc != EOK) { 363 364 (void) gfx_set_clip_rect(res->gc, NULL); … … 365 366 } 366 367 367 gfx_text_cont(res->font, &cpos, &cfmt, entry->text + off1, 368 &cpos, &cfmt); 368 gfx_text_cont(&cpos, &cfmt, entry->text + off1, &cpos, &cfmt); 369 369 370 370 entry->text[off2] = c; … … 374 374 cfmt.color = res->entry_fg_color; 375 375 376 rc = gfx_puttext( res->font,&cpos, &cfmt, entry->text + off2);376 rc = gfx_puttext(&cpos, &cfmt, entry->text + off2); 377 377 if (rc != EOK) { 378 378 (void) gfx_set_clip_rect(res->gc, NULL); … … 421 421 422 422 gfx_text_fmt_init(&fmt); 423 fmt.font = res->font; 423 424 fmt.halign = gfx_halign_left; 424 425 fmt.valign = gfx_valign_top; 425 426 426 return gfx_text_find_pos(res->font, &geom.text_pos, &fmt, 427 entry->text, fpos); 427 return gfx_text_find_pos(&geom.text_pos, &fmt, entry->text, fpos); 428 428 } 429 429 … … 1111 1111 anchor.y = 0; 1112 1112 gfx_text_fmt_init(&fmt); 1113 fmt.font = res->font; 1113 1114 fmt.halign = entry->halign; 1114 gfx_text_start_pos(res->font, &anchor, &fmt, entry->text, 1115 &tpos); 1115 gfx_text_start_pos(&anchor, &fmt, entry->text, &tpos); 1116 1116 entry->scroll_pos = tpos.x - geom.text_rect.p0.x; 1117 1117 } else if (geom.text_pos.x + width < geom.text_rect.p1.x && -
uspace/lib/ui/src/label.c
r5c27e77 r4583015 215 215 216 216 gfx_text_fmt_init(&fmt); 217 fmt.font = label->res->font; 217 218 fmt.color = label->res->wnd_text_color; 218 219 fmt.halign = label->halign; 219 220 fmt.valign = label->valign; 220 221 221 rc = gfx_puttext( label->res->font,&pos, &fmt, label->text);222 rc = gfx_puttext(&pos, &fmt, label->text); 222 223 if (rc != EOK) 223 224 goto error; -
uspace/lib/ui/src/menubar.c
r5c27e77 r4583015 185 185 186 186 gfx_text_fmt_init(&fmt); 187 fmt.font = res->font; 187 188 fmt.halign = gfx_halign_left; 188 189 fmt.valign = gfx_valign_top; … … 215 216 goto error; 216 217 217 rc = gfx_puttext( res->font,&tpos, &fmt, caption);218 rc = gfx_puttext(&tpos, &fmt, caption); 218 219 if (rc != EOK) 219 220 goto error; -
uspace/lib/ui/src/menuentry.c
r5c27e77 r4583015 351 351 352 352 gfx_text_fmt_init(&fmt); 353 fmt.font = res->font; 353 354 fmt.halign = gfx_halign_left; 354 355 fmt.valign = gfx_valign_top; … … 371 372 goto error; 372 373 373 rc = gfx_puttext( res->font,&geom.caption_pos, &fmt, mentry->caption);374 rc = gfx_puttext(&geom.caption_pos, &fmt, mentry->caption); 374 375 if (rc != EOK) 375 376 goto error; … … 377 378 fmt.halign = gfx_halign_right; 378 379 379 rc = gfx_puttext( res->font,&geom.shortcut_pos, &fmt, mentry->shortcut);380 rc = gfx_puttext(&geom.shortcut_pos, &fmt, mentry->shortcut); 380 381 if (rc != EOK) 381 382 goto error; -
uspace/lib/ui/src/paint.c
r5c27e77 r4583015 402 402 403 403 gfx_text_fmt_init(&fmt); 404 fmt.font = resource->font; 404 405 fmt.color = color; 405 406 … … 427 428 428 429 pos = rect->p0; 429 rc = gfx_puttext( resource->font,&pos, &fmt, str);430 rc = gfx_puttext(&pos, &fmt, str); 430 431 if (rc != EOK) 431 432 goto error; … … 436 437 437 438 pos.x = rect->p0.x; 438 rc = gfx_puttext(resource->font, &pos, &fmt, 439 boxc->c[1][0]); 439 rc = gfx_puttext(&pos, &fmt, boxc->c[1][0]); 440 440 if (rc != EOK) 441 441 goto error; 442 442 443 443 pos.x = rect->p1.x - 1; 444 rc = gfx_puttext(resource->font, &pos, &fmt, 445 boxc->c[1][2]); 444 rc = gfx_puttext(&pos, &fmt, boxc->c[1][2]); 446 445 if (rc != EOK) 447 446 goto error; … … 464 463 pos.x = rect->p0.x; 465 464 pos.y = rect->p1.y - 1; 466 rc = gfx_puttext( resource->font,&pos, &fmt, str);465 rc = gfx_puttext(&pos, &fmt, str); 467 466 if (rc != EOK) 468 467 goto error; … … 519 518 520 519 gfx_text_fmt_init(&fmt); 520 fmt.font = resource->font; 521 521 fmt.color = color; 522 522 … … 542 542 543 543 pos = rect->p0; 544 rc = gfx_puttext( resource->font,&pos, &fmt, str);544 rc = gfx_puttext(&pos, &fmt, str); 545 545 if (rc != EOK) 546 546 goto error; -
uspace/lib/ui/src/pbutton.c
r5c27e77 r4583015 307 307 308 308 gfx_text_fmt_init(&fmt); 309 fmt.font = pbutton->res->font; 309 310 fmt.color = pbutton->res->btn_text_color; 310 311 fmt.halign = gfx_halign_center; 311 312 fmt.valign = gfx_valign_center; 312 313 313 rc = gfx_puttext( pbutton->res->font,&pos, &fmt, pbutton->caption);314 rc = gfx_puttext(&pos, &fmt, pbutton->caption); 314 315 if (rc != EOK) 315 316 goto error; … … 379 380 380 381 gfx_text_fmt_init(&fmt); 382 fmt.font = pbutton->res->font; 381 383 fmt.color = pbutton->res->btn_text_color; 382 384 fmt.halign = gfx_halign_center; 383 385 fmt.valign = gfx_valign_center; 384 386 385 rc = gfx_puttext( pbutton->res->font,&pos, &fmt, pbutton->caption);387 rc = gfx_puttext(&pos, &fmt, pbutton->caption); 386 388 if (rc != EOK) 387 389 goto error; -
uspace/lib/ui/src/rbutton.c
r5c27e77 r4583015 278 278 279 279 gfx_text_fmt_init(&fmt); 280 fmt.font = rbutton->group->res->font; 280 281 fmt.color = rbutton->group->res->wnd_text_color; 281 282 fmt.halign = gfx_halign_left; 282 283 fmt.valign = gfx_valign_center; 283 284 284 rc = gfx_puttext(rbutton->group->res->font, &pos, &fmt, 285 rbutton->caption); 285 rc = gfx_puttext(&pos, &fmt, rbutton->caption); 286 286 if (rc != EOK) 287 287 goto error; … … 316 316 317 317 gfx_text_fmt_init(&fmt); 318 fmt.font = rbutton->group->res->font; 318 319 fmt.color = depressed ? rbutton->group->res->entry_act_bg_color : 319 320 rbutton->group->res->wnd_text_color; … … 321 322 fmt.valign = gfx_valign_top; 322 323 323 rc = gfx_puttext( rbutton->group->res->font, &pos, &fmt,324 rbutton->group->selected == rbutton ?"(\u2022)" : "( )");324 rc = gfx_puttext(&pos, &fmt, rbutton->group->selected == rbutton ? 325 "(\u2022)" : "( )"); 325 326 if (rc != EOK) 326 327 goto error; … … 332 333 fmt.color = rbutton->group->res->wnd_text_color; 333 334 334 rc = gfx_puttext(rbutton->group->res->font, &pos, &fmt, 335 rbutton->caption); 335 rc = gfx_puttext(&pos, &fmt, rbutton->caption); 336 336 if (rc != EOK) 337 337 goto error; -
uspace/lib/ui/src/slider.c
r5c27e77 r4583015 341 341 342 342 gfx_text_fmt_init(&fmt); 343 fmt.font = slider->res->font; 343 344 fmt.color = slider->res->wnd_text_color; 344 345 fmt.halign = gfx_halign_left; … … 357 358 buf[w * gcharsz] = '\0'; 358 359 359 rc = gfx_puttext( slider->res->font,&pos, &fmt, buf);360 rc = gfx_puttext(&pos, &fmt, buf); 360 361 free(buf); 361 362 if (rc != EOK) … … 366 367 pos.x += slider->pos; 367 368 368 rc = gfx_puttext(slider->res->font, &pos, &fmt, 369 "[O]"); 369 rc = gfx_puttext(&pos, &fmt, "[O]"); 370 370 if (rc != EOK) 371 371 goto error; -
uspace/lib/ui/src/wdecor.c
r5c27e77 r4583015 242 242 243 243 gfx_text_fmt_init(&fmt); 244 fmt.font = wdecor->res->font; 244 245 fmt.color = wdecor->active ? 245 246 wdecor->res->tbar_act_text_color : … … 253 254 if (wdecor->res->textmode) { 254 255 /* Make space around caption text */ 255 gfx_text_rect(wdecor->res->font, &pos, &fmt, 256 wdecor->caption, &text_rect); 256 gfx_text_rect(&pos, &fmt, wdecor->caption, &text_rect); 257 257 258 258 /* Only make space if caption is non-empty */ … … 273 273 } 274 274 275 rc = gfx_puttext( wdecor->res->font,&pos, &fmt, wdecor->caption);275 rc = gfx_puttext(&pos, &fmt, wdecor->caption); 276 276 if (rc != EOK) 277 277 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.