Lines Matching full:layout
787 typedef struct Layout {
797 } Layout;
799 #define LAYOUT_LOOP_BUTTONS(layout,button) \
801 Button* __button = (layout)->buttons; \
802 Button* __button_end = __button + (layout)->num_buttons; \
810 #define LAYOUT_LOOP_DISPLAYS(layout,display) \
812 ADisplay* __display = (layout)->displays; \
813 ADisplay* __display_end = __display + (layout)->num_displays; \
823 layout_done( Layout* layout )
827 for (nn = 0; nn < layout->num_buttons; nn++)
828 button_done( &layout->buttons[nn] );
830 for (nn = 0; nn < layout->num_backgrounds; nn++)
831 background_done( &layout->backgrounds[nn] );
833 for (nn = 0; nn < layout->num_displays; nn++)
834 display_done( &layout->displays[nn] );
836 AFREE( layout->buttons );
837 layout->buttons = NULL;
839 AFREE( layout->backgrounds );
840 layout->backgrounds = NULL;
842 AFREE( layout->displays );
843 layout->displays = NULL;
845 layout->num_buttons = 0;
846 layout->num_backgrounds = 0;
847 layout->num_displays = 0;
851 layout_init( Layout* layout, SkinLayout* slayout )
860 layout->color = slayout->color;
861 layout->slayout = slayout;
877 layout->num_buttons = n_buttons;
878 layout->num_backgrounds = n_backgrounds;
879 layout->num_displays = n_displays;
882 AARRAY_NEW0(layout->buttons, n_buttons);
883 AARRAY_NEW0(layout->backgrounds, n_backgrounds);
884 AARRAY_NEW0(layout->displays, n_displays);
886 if (layout->buttons == NULL && n_buttons > 0) goto Fail;
887 if (layout->backgrounds == NULL && n_backgrounds > 0) goto Fail;
888 if (layout->displays == NULL && n_displays > 0) goto Fail;
894 layout->rect.pos.x = 0;
895 layout->rect.pos.y = 0;
896 layout->rect.size = slayout->size;
903 back = layout->backgrounds + n_backgrounds;
904 background_init( back, part->background, loc, &layout->rect );
908 ADisplay* disp = layout->displays + n_displays;
909 display_init( disp, part->display, loc, &layout->rect );
914 Button* button = layout->buttons + n_buttons;
915 button_init( button, sbutton, loc, back, &layout->rect, slayout );
923 layout_done(layout);
929 Layout layout;
986 LAYOUT_LOOP_DISPLAYS(&window->layout,disp)
1048 LAYOUT_LOOP_BUTTONS( &window->layout, butt )
1158 ADisplay* disp = window->layout.displays;
1325 int layout_w = window->layout.rect.size.w;
1326 int layout_h = window->layout.rect.size.h;
1419 Layout layout;
1422 if ( layout_init( &layout, slayout ) < 0 )
1425 layout_done( &window->layout );
1426 window->layout = layout;
1428 disp = window->layout.displays;
1470 ADisplay* disp = window->layout.displays;
1502 layout_done( &window->layout );
1522 disp = window->layout.displays;
1549 Layout* layout = &window->layout;
1552 rect = &layout->rect;
1557 if ( skin_rect_intersect( &r, rect, &layout->rect ) ) {
1564 SDL_FillRect( window->surface, &rd, layout->color );
1569 Background* back = layout->backgrounds;
1570 Background* end = back + layout->num_backgrounds;
1576 ADisplay* disp = layout->displays;
1577 ADisplay* end = disp + layout->num_displays;
1583 Button* button = layout->buttons;
1584 Button* end = button + layout->num_buttons;
1624 ADisplay* disp = window->layout.displays;
1744 return window->layout.displays;