1 --- src/Pager/Pager.c 2008-02-22 08:20:00.000000000 -0600
2 +++ src/Pager/Pager.c 2008-03-25 12:54:44.000000000 -0500
5 int page_rows, page_columns ;
6 /* x and y size of desktop */
7 - int vscaled_desk_width, vscaled_desk_height ; /* calculated in accordance to Scale param in database */
8 int desk_width, desk_height ; /* adjusted for the size of title */
9 /* area of the main window used up by labels, borders and other garbadge :*/
10 int wasted_width, wasted_height ;
12 /*****************************************************************************
13 * This routine is responsible for reading and parsing the config file
14 ****************************************************************************/
20 if (Config->geometry.width <= Config->columns )
21 clear_flags(Config->geometry.flags, WidthValue);
22 if (!get_flags(Config->geometry.flags, WidthValue) )
23 - Config->geometry.width = PagerState.vscaled_desk_width*Config->columns ;
24 + Config->geometry.width = (PagerState.vscreen_width*Config->columns)/Scr.VScale ;
26 PagerState.desk_width = Config->geometry.width/Config->columns ;
27 Config->geometry.width = PagerState.desk_width*Config->columns ;
29 if (Config->geometry.height <= Config->rows )
30 clear_flags(Config->geometry.flags, HeightValue);
31 if (!get_flags(Config->geometry.flags, HeightValue) || Config->geometry.height <= Config->rows )
32 - Config->geometry.height = PagerState.vscaled_desk_height*Config->rows ;
33 + Config->geometry.height = (PagerState.vscreen_height*Config->rows)/Scr.VScale ;
35 PagerState.desk_height = Config->geometry.height/Config->rows ;
36 Config->geometry.height = PagerState.desk_height*Config->rows ;
39 PagerState.wasted_width = PagerState.wasted_height = 0 ;
41 if( !get_flags(Config->geometry.flags, XValue))
43 PagerState.vscreen_width = Scr.VxMax + Scr.MyDisplayWidth;
44 PagerState.vscreen_height = Scr.VyMax + Scr.MyDisplayHeight;
46 - PagerState.vscaled_desk_width = PagerState.vscreen_width/Scr.VScale;
47 - PagerState.vscaled_desk_height = PagerState.vscreen_height/Scr.VScale;
49 SHOW_TIME("BaseConfigParsingTime",started);
50 LOCAL_DEBUG_OUT("desk_size(%dx%d),vscreen_size(%dx%d),vscale(%d)", PagerState.desk_width, PagerState.desk_height, PagerState.vscreen_width, PagerState.vscreen_height, Scr.VScale );
58 calculate_desk_width( ASPagerDesk *d )
60 unsigned int width = PagerState.desk_width;
64 register int p = PagerState.page_columns-1;
65 - int pos_inc = Scr.MyDisplayWidth/Scr.VScale;
66 + int pos_inc = (Scr.MyDisplayWidth * d->background->width)/PagerState.vscreen_width;
67 /* d->background->width/PagerState.page_columns ; */
68 int pos = d->background->win_x+p*pos_inc;
69 int size = d->background->height ;
71 wa += PagerState.page_columns-1;
72 wrecta += PagerState.page_columns-1;
73 p = PagerState.page_rows-1;
74 - pos_inc = Scr.MyDisplayHeight/Scr.VScale;
75 + pos_inc = (Scr.MyDisplayHeight * d->background->height)/PagerState.vscreen_height;
76 + /* Scr.MyDisplayHeight/PagerState.vscale_v; */
77 /* d->background->height/PagerState.page_rows ; */
78 pos = d->background->win_y + p*pos_inc;
79 pos2 = d->background->win_x ;
80 @@ -1206,8 +1204,10 @@
82 int sel_x = sel_desk->background->win_x ;
83 int sel_y = sel_desk->background->win_y ;
84 - int page_width = Scr.MyDisplayWidth/Scr.VScale ;
85 - int page_height = Scr.MyDisplayHeight/Scr.VScale ;
86 + int page_width = /*Scr.MyDisplayWidth/PagerState.vscale_h ;*/
87 + (Scr.MyDisplayWidth * sel_desk->background->width)/PagerState.vscreen_width;
88 + int page_height = /* Scr.MyDisplayHeight/PagerState.vscale_v ;*/
89 + (Scr.MyDisplayHeight * sel_desk->background->height)/PagerState.vscreen_height;
92 sel_x += (Scr.Vx*page_width)/Scr.MyDisplayWidth ;
94 if( height > row_height )
97 - LOCAL_DEBUG_OUT( " :RESIZING: desk = %d, size = %dx%d, all_size = %+d%+d", i, width, height, all_width, all_height );
99 if( ++col >= Config->columns )
101 if( all_width < x+width )
102 @@ -1513,6 +1511,8 @@
106 + LOCAL_DEBUG_OUT( " :RESIZING: desk = %d, size = %dx%d, all_size = %+d%+d, +x+y = %+d%+d, row_height = %d", i, width, height, all_width, all_height, x, y, row_height );
111 @@ -1572,20 +1572,25 @@
112 * and then devide size of the main canvas by this number : */
113 for( col = 0 ; col < Config->columns ; ++col )
115 - Bool unshaded = False ;
116 unsigned int col_shaded_width = 0 ;
119 for( i = col ; i < PagerState.desks_num ; i+= Config->columns )
121 ASPagerDesk *d = &(PagerState.desks[i]);
123 if( !get_flags(d->flags, ASP_DeskShaded ) )
125 - else if( col_shaded_width < d->title_width )
126 - col_shaded_width = d->title_width ;
128 + ++unshaded_col_count ;
129 + col_shaded_width = 0;
133 + int dw = calculate_desk_width(d);
134 + if( col_shaded_width < dw )
135 + col_shaded_width = dw;
139 - ++unshaded_col_count ;
140 shaded_width += col_shaded_width ;
143 @@ -1611,7 +1616,6 @@
144 * and then devide size of the main canvas by this number : */
145 for( row = 0 ; row < Config->rows ; ++row )
147 - Bool unshaded = False ;
148 unsigned int row_shaded_height = 0 ;
149 int i, max_i = (row+1)*Config->columns ;
151 @@ -1622,15 +1626,20 @@
153 ASPagerDesk *d = &(PagerState.desks[i]);
154 if( !get_flags(d->flags, ASP_DeskShaded ) )
156 - else if( row_shaded_height < d->title_height )
157 - row_shaded_height = d->title_height ;
159 + ++unshaded_row_count ;
160 + row_shaded_height = 0;
164 + int dh = calculate_desk_height(d);
165 + if( row_shaded_height < dh )
166 + row_shaded_height = dh;
170 - ++unshaded_row_count ;
171 shaded_height += row_shaded_height ;
173 -LOCAL_DEBUG_OUT( "unshaded_row_count = %d", unshaded_row_count );
174 +LOCAL_DEBUG_OUT( "unshaded_row_count = %d, shaded_height = %d, main_height = %d", unshaded_row_count, shaded_height, main_height );
175 if( unshaded_row_count == 0 )
176 return PagerState.desk_height;
177 return (main_height - shaded_height)/unshaded_row_count;
178 @@ -2755,9 +2764,10 @@
179 if( new_desk_width != PagerState.desk_width ||
180 new_desk_height != PagerState.desk_height )
182 - PagerState.desk_width = new_desk_width ;
183 - PagerState.desk_height = new_desk_height ;
185 + PagerState.desk_width = new_desk_width;
186 + PagerState.desk_height = new_desk_height;
189 rearrange_pager_desks( True );
190 }else if( changes != 0 )