Lines Matching refs:cr
146 render_shadow(cairo_t *cr, cairo_surface_t *surface, in render_shadow() argument
153 cairo_set_source_rgba(cr, 0, 0, 0, 0.45); in render_shadow()
154 cairo_set_operator(cr, CAIRO_OPERATOR_OVER); in render_shadow()
191 cairo_reset_clip(cr); in render_shadow()
192 cairo_rectangle(cr, in render_shadow()
196 cairo_clip (cr); in render_shadow()
197 cairo_mask(cr, pattern); in render_shadow()
212 cairo_rectangle(cr, x + margin, y, shadow_width, shadow_height); in render_shadow()
214 cairo_reset_clip(cr); in render_shadow()
215 cairo_rectangle(cr, in render_shadow()
218 cairo_clip (cr); in render_shadow()
219 cairo_mask(cr, pattern); in render_shadow()
225 cairo_reset_clip(cr); in render_shadow()
226 cairo_rectangle(cr, x + margin, y + height - margin, in render_shadow()
228 cairo_clip (cr); in render_shadow()
229 cairo_mask(cr, pattern); in render_shadow()
246 cairo_reset_clip(cr); in render_shadow()
247 cairo_rectangle(cr, x, y + top_margin, in render_shadow()
249 cairo_clip (cr); in render_shadow()
250 cairo_mask(cr, pattern); in render_shadow()
255 cairo_rectangle(cr, x + width - shadow_width, y + top_margin, in render_shadow()
257 cairo_reset_clip(cr); in render_shadow()
258 cairo_clip (cr); in render_shadow()
259 cairo_mask(cr, pattern); in render_shadow()
263 cairo_reset_clip(cr); in render_shadow()
267 tile_source(cairo_t *cr, cairo_surface_t *surface, in tile_source() argument
274 cairo_set_operator(cr, CAIRO_OPERATOR_OVER); in tile_source()
277 cairo_set_source(cr, pattern); in tile_source()
294 cairo_rectangle(cr, in tile_source()
298 cairo_fill(cr); in tile_source()
306 cairo_rectangle(cr, x + margin, y, width - 2 * margin, top_margin); in tile_source()
307 cairo_fill(cr); in tile_source()
312 cairo_rectangle(cr, x + margin, y + height - margin, in tile_source()
314 cairo_fill(cr); in tile_source()
321 cairo_rectangle(cr, x, y + top_margin, in tile_source()
323 cairo_fill(cr); in tile_source()
328 cairo_rectangle(cr, x + width - margin, y + top_margin, in tile_source()
330 cairo_fill(cr); in tile_source()
334 rounded_rect(cairo_t *cr, int x0, int y0, int x1, int y1, int radius) in rounded_rect() argument
336 cairo_move_to(cr, x0, y0 + radius); in rounded_rect()
337 cairo_arc(cr, x0 + radius, y0 + radius, radius, M_PI, 3 * M_PI / 2); in rounded_rect()
338 cairo_line_to(cr, x1 - radius, y0); in rounded_rect()
339 cairo_arc(cr, x1 - radius, y0 + radius, radius, 3 * M_PI / 2, 2 * M_PI); in rounded_rect()
340 cairo_line_to(cr, x1, y1 - radius); in rounded_rect()
341 cairo_arc(cr, x1 - radius, y1 - radius, radius, 0, M_PI / 2); in rounded_rect()
342 cairo_line_to(cr, x0 + radius, y1); in rounded_rect()
343 cairo_arc(cr, x0 + radius, y1 - radius, radius, M_PI / 2, M_PI); in rounded_rect()
344 cairo_close_path(cr); in rounded_rect()
369 theme_set_background_source(struct theme *t, cairo_t *cr, uint32_t flags) in theme_set_background_source() argument
377 cairo_set_source(cr, pattern); in theme_set_background_source()
380 cairo_set_source_rgba(cr, 0.75, 0.75, 0.75, 1); in theme_set_background_source()
388 cairo_t *cr; in theme_create() local
399 cr = cairo_create(t->shadow); in theme_create()
400 cairo_set_operator(cr, CAIRO_OPERATOR_OVER); in theme_create()
401 cairo_set_source_rgba(cr, 0, 0, 0, 1); in theme_create()
402 rounded_rect(cr, 32, 32, 96, 96, t->frame_radius); in theme_create()
403 cairo_fill(cr); in theme_create()
404 if (cairo_status (cr) != CAIRO_STATUS_SUCCESS) in theme_create()
406 cairo_destroy(cr); in theme_create()
412 cr = cairo_create(t->active_frame); in theme_create()
413 cairo_set_operator(cr, CAIRO_OPERATOR_OVER); in theme_create()
415 theme_set_background_source(t, cr, THEME_FRAME_ACTIVE); in theme_create()
416 rounded_rect(cr, 0, 0, 128, 128, t->frame_radius); in theme_create()
417 cairo_fill(cr); in theme_create()
419 if (cairo_status(cr) != CAIRO_STATUS_SUCCESS) in theme_create()
422 cairo_destroy(cr); in theme_create()
426 cr = cairo_create(t->inactive_frame); in theme_create()
427 cairo_set_operator(cr, CAIRO_OPERATOR_OVER); in theme_create()
428 theme_set_background_source(t, cr, 0); in theme_create()
429 rounded_rect(cr, 0, 0, 128, 128, t->frame_radius); in theme_create()
430 cairo_fill(cr); in theme_create()
432 if (cairo_status (cr) != CAIRO_STATUS_SUCCESS) in theme_create()
435 cairo_destroy(cr); in theme_create()
460 create_layout(cairo_t *cr, const char *title) in create_layout() argument
465 layout = pango_cairo_create_layout(cr); in create_layout()
483 #define SHOW_TEXT(cr) \ argument
484 pango_cairo_show_layout(cr, title_layout)
486 #define SHOW_TEXT(cr) \ argument
487 cairo_show_text(cr, title)
492 cairo_t *cr, int width, int height, in theme_render_frame() argument
500 cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); in theme_render_frame()
501 cairo_set_source_rgba(cr, 0, 0, 0, 0); in theme_render_frame()
502 cairo_paint(cr); in theme_render_frame()
507 render_shadow(cr, t->shadow, in theme_render_frame()
523 tile_source(cr, source, in theme_render_frame()
530 cairo_rectangle (cr, title_rect->x, title_rect->y, in theme_render_frame()
532 cairo_clip(cr); in theme_render_frame()
533 cairo_set_operator(cr, CAIRO_OPERATOR_OVER); in theme_render_frame()
539 title_layout = create_layout(cr, title); in theme_render_frame()
551 cairo_select_font_face(cr, "sans", in theme_render_frame()
554 cairo_set_font_size(cr, 14); in theme_render_frame()
555 cairo_text_extents(cr, title, &extents); in theme_render_frame()
556 cairo_font_extents (cr, &font_extents); in theme_render_frame()
569 cairo_move_to(cr, x + 1, y + 1); in theme_render_frame()
570 cairo_set_source_rgb(cr, 1, 1, 1); in theme_render_frame()
571 SHOW_TEXT(cr); in theme_render_frame()
572 cairo_move_to(cr, x, y); in theme_render_frame()
573 cairo_set_source_rgb(cr, 0, 0, 0); in theme_render_frame()
574 SHOW_TEXT(cr); in theme_render_frame()
576 cairo_move_to(cr, x, y); in theme_render_frame()
577 cairo_set_source_rgb(cr, 0.4, 0.4, 0.4); in theme_render_frame()
578 SHOW_TEXT(cr); in theme_render_frame()