<div dir="ltr">I am converting a program from windows to linux mint. The following unit won't compile under linux because uses the windows unit. I have replaced windows unit with linux unit. Now it can't find GetDeviceCaps. Enclosed is the following unit. What do I have to rewrite to get it to compile under linux?<div><br></div><div><div>unit baseformRt;</div><div><br></div><div>interface</div><div>uses StringRt,sysutils,StdCtrls,graphics,d_print,person_type,laz_procs,AddressUnit;</div><div><br></div><div>type</div><div><br></div><div><br></div><div>form_adjust_record=record</div><div>form_name:string[20];</div><div>form_number:integer;</div><div>form_vert_adjust:double;</div><div>form_horiz_adjust:double;</div><div>filled:boolean;</div><div>end;{ends form_adjust_record}</div><div><br></div><div><br></div><div><br></div><div>baseform_Writer=object</div><div>this_adjust:form_adjust_record;</div><div>Top_of_bank:Double;</div><div>Last_line:double;</div><div>right_side:double;</div><div>Bank_Font:TFont;</div><div>Bank_Canvas:TCanvas;</div><div>vert_adjust:double;</div><div>horiz_adjust:double;</div><div>Bank_x_pixels:integer;</div><div>Bank_Y_Pixels:integer;</div><div>b_printer:printrec;</div><div>last_pay:tdatetime;</div><div>form_horiz_adjust:double;</div><div>form_vert_adjust:double;</div><div>ppix,ppiy:integer;</div><div>b_width:double;</div><div>{Del_counter:integer;</div><div>del_string:string;}</div><div>total_down:currency;</div><div>warrantyline:string;</div><div>scalex,scaley:double;</div><div>var today:tdatetime;</div><div>constructor init(var BankCanvas:TCanvas);</div><div><br></div><div>procedure stringinit(a_line:string;a_vert:double;a_horiz:double);</div><div>procedure set_font_size(const dog:double);</div><div>procedure set_font_by_length(const dog:double;const hite:double;const cat:string);</div><div><br></div><div>procedure bottomstring_init(a_line:string;a_vert:double;a_horiz:double);</div><div>procedure int_init(a_int:integer;a_vert:double;a_horiz:double);</div><div>procedure long_init(a_long:longint;a_vert:double;a_horiz:double);</div><div>procedure double_init(a_double:double;a_vert:double;a_horiz:double);</div><div>procedure perc_init(a_perc:double;a_vert:double;a_horiz:double);</div><div>procedure dollar_init(a_dollar:currency;a_vert:double;a_horiz:double);</div><div>procedure x_init(a_vert:double;a_horiz:double);</div><div>procedure big_x_init(a_vert:double;a_horiz:double);</div><div>procedure dot_init(a_vert:double;a_horiz:double);</div><div>procedure na_init(a_vert:double;a_horiz:double);</div><div>procedure phn_init(a_phone:phone_record;a_vert:double;a_horiz:double);</div><div>procedure date_init(a_date:tdatetime;a_vert:double;a_horiz:double);</div><div>procedure street_init(a_street:address_record;a_vert:double;a_horiz:double);</div><div>procedure city_init(a_city:address_record;a_vert:double;a_horiz:double);</div><div>procedure start_line(vert_start:double;horz_start:double);</div><div>procedure draw_line(vert_end:double;horz_end:double);</div><div>procedure draw_thin_line(vert_end:double;horz_end:double);</div><div><br></div><div><br></div><div>end;</div><div><br></div><div>implementation</div><div>uses printers,numtools,messages,linux,</div><div>forms,dialogs,controls,new_dates;</div><div><br></div><div>procedure baseform_writer.draw_line(vert_end:double;horz_end:double);</div><div>var b_x,b_y:integer;</div><div>test_height:double;</div><div>test_string:string;</div><div>begin</div><div>bank_canvas.Pen.Width:=bank_canvas.pen.width*6;</div><div>test_string:='My String';</div><div>test_height:=inchheight(bank_canvas,ppiy,test_string);</div><div>b_x:=round((form_horiz_adjust+horz_end)*ppix);</div><div>b_y:=round((test_height+vert_end+form_vert_adjust)*ppiy);</div><div>bank_canvas.LineTo(b_x,b_y);</div><div>bank_canvas.pen.width:=round(bank_canvas.pen.width/6);</div><div>end;{ends baseform_writer.draw_line}</div><div><br></div><div>procedure baseform_writer.draw_thin_line(vert_end:double;horz_end:double);</div><div>var b_x,b_y:integer;</div><div>test_height:double;</div><div>test_string:string;</div><div>begin</div><div>bank_canvas.Pen.Width:=bank_canvas.pen.width*2;</div><div>test_string:='My String';</div><div>test_height:=inchheight(bank_canvas,ppiy,test_string);</div><div>b_x:=round((form_horiz_adjust+horz_end)*ppix);</div><div>b_y:=round((test_height+vert_end+form_vert_adjust)*ppiy);</div><div>bank_canvas.LineTo(b_x,b_y);</div><div>bank_canvas.pen.width:=round(bank_canvas.pen.width/2);</div><div>end;</div><div><br></div><div>procedure baseform_writer.start_line(vert_start:double;horz_start:double);</div><div>var b_x,b_y:integer;</div><div>test_line:string;</div><div>test_height:double;</div><div>begin</div><div>test_line:='My String';</div><div>test_height:=inchheight(bank_canvas,ppiy,test_line);</div><div>b_y:=round((test_height+vert_start+form_vert_adjust)*ppiy);</div><div>b_x:=round((form_horiz_adjust+horz_start)*ppix);</div><div>bank_canvas.MoveTo(b_x,b_y);</div><div>end;{ends start_line}</div><div><br></div><div><br></div><div>constructor baseform_writer.init(var BankCanvas:TCanvas);</div><div><br></div><div>var right_marg:double;</div><div><br></div><div>message_string:string;</div><div>dealer_only:boolean;</div><div>line:string;</div><div>label end_form;</div><div>begin</div><div><br></div><div>bank_canvas:=bankcanvas;</div><div>b_width:=0;</div><div>top_of_bank:=0;</div><div>Last_line:=0;</div><div>right_side:=0;</div><div><br></div><div>Bank_Font:=tfont.Create;</div><div><br></div><div>bank_font.Size:=10;</div><div>bank_font.Style:=[fsbold];</div><div>bank_font.Name:='Times New Roman';</div><div><br></div><div><br></div><div>ppix:=GetDeviceCaps(Bank_Canvas.Handle,logpixelsX);</div><div>ppiy:=GetDeviceCaps(bank_canvas.Handle,logpixelsY);</div><div><br></div><div>bank_x_pixels:=GetDeviceCaps(bank_canvas.Handle,LogPixelsX);</div><div>Bank_Y_pixels:=GetDeviceCaps(bank_canvas.Handle,LogPixelsY);</div><div><br></div><div>line:='This printer';</div><div><br></div><div>vert_adjust:=inchHeight(Bank_Canvas,Bank_Y_Pixels,line);</div><div>horiz_adjust:=inchWidth(bank_canvas,bank_x_pixels,line);</div><div><br></div><div>Bank_Font.Style:=bank_font.Style-[fsUnderline];</div><div><br></div><div><br></div><div>form_horiz_adjust:=0;</div><div>form_VERT_ADJUST:=0;</div><div><br></div><div><br></div><div><br></div><div>end_form:</div><div>end;{ends baseform_writer.init}</div><div><br></div><div><br></div><div><br></div><div>procedure baseform_writer.stringinit(a_line:string;a_vert:double;a_horiz:double);</div><div><br></div><div>const this_checker=false;</div><div>begin</div><div>today:=now;</div><div>if this_checker then if messagedlg('now testing stringinit',mtconfirmation,[mbok,mbabort],0)=mrabort then halt;</div><div>IF A_LINE<>'' THEN</div><div>b_printer.init('S',today,0,a_line,a_vert,</div><div>a_horiz,bank_font,form_vert_adjust,form_horiz_adjust,bank_canvas);</div><div>if this_checker then if messagedlg('stringinit performed',mtconfirmation,[mbok,mbabort],0)=mrabort then halt;</div><div>end;{ends stringinit}</div><div><br></div><div><br></div><div>  procedure baseform_writer.bottomstring_init(a_line:string;a_vert:double;a_horiz:double);</div><div>var string_height:double;</div><div>test_double:double;</div><div>begin</div><div><br></div><div>string_height:=inchHeight(bank_canvas,ppiy,a_line);</div><div>string_height:=string_Height*0.80;</div><div>test_double:=a_vert-string_height;</div><div>stringinit(a_line,test_double,a_horiz);</div><div>end;{ends bottomstring_init}</div><div><br></div><div>procedure baseform_writer.date_init(a_date:tdatetime;a_vert:double;a_horiz:double);</div><div>begin</div><div>b_printer.init('D',a_date,0,'',a_vert,a_horiz,</div><div>bank_font,form_vert_adjust,form_horiz_adjust,bank_canvas);</div><div>end;</div><div><br></div><div>procedure baseform_writer.int_init(a_int:integer;a_vert:double;a_horiz:double);</div><div>var integer_width:double;</div><div>line:string;</div><div>begin</div><div>str(a_int,line);</div><div>integer_width:=inchWidth(Bank_canvas,Ppix,line);</div><div>b_printer.init('S',today,0,line,a_vert,</div><div>a_horiz-integer_width,bank_font,</div><div>form_vert_adjust,form_horiz_adjust,bank_canvas);</div><div>end;</div><div><br></div><div>procedure baseform_writer.long_init(a_long:longint;a_vert:double;a_horiz:double);</div><div>var longint_width:double;</div><div>line:string;</div><div>begin</div><div>str(a_long,line);</div><div>longint_width:=inchWidth(Bank_canvas,Ppix,line);</div><div>a_horiz:=a_horiz-longint_width;</div><div>b_printer.init('S',today,0,line,a_vert,a_horiz,bank_font,</div><div>form_vert_adjust,form_horiz_adjust,bank_canvas);</div><div>end;</div><div><br></div><div><br></div><div>procedure baseform_writer.dollar_init(a_dollar:currency;a_vert:double;a_horiz:double);</div><div>var string_dollar:string;</div><div>dollar_width:double;</div><div>check_int:integer;</div><div>line_counter:integer;</div><div>test_string_length:integer;</div><div>message_string:string;</div><div>begin</div><div>test_string_length:=1;</div><div>if abs(a_dollar)>1 then test_string_length:=2;</div><div>if abs(a_dollar)>10 then test_string_length:=3;</div><div>if abs(a_dollar)>100 then test_string_length:=4;</div><div>if abs(a_dollar)>1000 then test_string_length:=5;</div><div>if abs(a_dollar)>10000 then test_string_length:=6;</div><div>if abs(a_dollar)>100000 then test_string_length:=7;</div><div>if abs(a_dollar)>1000000 then test_string_length:=8;</div><div>if abs(a_dollar)>10000000 then test_string_length:=9;</div><div><br></div><div>dollar_width:=inchWidth(Bank_Canvas,Bank_X_pixels,string_dollar);</div><div>b_printer.init('c',today,a_dollar,'',a_vert,</div><div>a_horiz-dollar_width,</div><div>bank_font,form_vert_adjust,form_horiz_adjust,bank_canvas);</div><div>end;</div><div><br></div><div><br></div><div>procedure baseform_writer.double_init(a_double:double;a_vert:double;a_horiz:double);</div><div>var string_double:string;</div><div>double_width:double;</div><div>test_string:string;</div><div>test_string_length:integer;</div><div>dec_string_length:integer;</div><div>period_pos:integer;</div><div>copy_string:string;</div><div>begin</div><div>test_string_length:=1;</div><div>if abs(a_double)>1 then test_string_length:=2;</div><div>if abs(a_double)>10 then test_string_length:=3;</div><div>if abs(a_double)>100 then test_string_length:=4;</div><div>if abs(a_double)>1000 then test_string_length:=5;</div><div>if abs(a_double)>10000 then test_string_length:=6;</div><div>if abs(a_double)>100000 then test_string_length:=7;</div><div>if abs(a_double)>1000000 then test_string_length:=8;</div><div>if abs(a_double)>10000000 then test_string_length:=9;</div><div>str(a_Double:test_string_length:6,string_double);</div><div>dec_string_length:=2;</div><div>period_pos:=pos('.',string_double);</div><div>copy_string:=copy(string_double,period_pos,7);</div><div>if copy_string[3]<>'0' then dec_string_length:=3;</div><div>if copy_string[4]<>'0' then dec_string_length:=4;</div><div>if copy_string[5]<>'0' then dec_string_length:=5;</div><div>if copy_string[6]<>'0' then dec_string_length:=6;</div><div> str(a_double:test_string_length:dec_string_length,string_double);</div><div><br></div><div><br></div><div>double_width:=inchWidth(Bank_Canvas,Bank_x_pixels,string_double);</div><div>b_printer.init('R',today,a_double,'',a_vert,a_horiz-double_width,</div><div>bank_font,form_vert_adjust,form_horiz_adjust,bank_canvas);</div><div>end;</div><div><br></div><div><br></div><div>procedure baseform_writer.perc_init(a_perc:double;a_vert:double;a_horiz:double);</div><div>var string_double:string;</div><div>double_width:double;</div><div>begin</div><div>str(a_perc:3:2,string_double);</div><div>double_width:=inchWidth(Bank_Canvas,Bank_x_pixels,string_double);</div><div>b_printer.init('A',today,a_perc,'',a_vert,a_horiz-double_width,</div><div>bank_font,form_vert_adjust,form_horiz_adjust,bank_canvas);</div><div>end;</div><div><br></div><div><br></div><div>procedure baseform_writer.x_init(a_vert:double;a_horiz:double);</div><div>begin</div><div>b_printer.init('S',today,0,'X',a_vert,a_horiz,bank_font,form_vert_adjust,form_horiz_adjust,bank_canvas);</div><div>end;</div><div><br></div><div><br></div><div>procedure baseform_writer.big_x_init(a_vert:double;a_horiz:double);</div><div>var hold_font:integer;</div><div>this_font_size:integer;</div><div>font_line:string;</div><div>test_height:double;</div><div>x_width:double;</div><div>begin{starts procedure big_x_init}</div><div>hold_font:=bank_font.Size;</div><div>this_font_size:=BANK_FONT.Size;</div><div>dec(this_font_size);</div><div>this_font_size:=1;</div><div>REPEAT</div><div>font_line:='X';</div><div>inc(this_font_size);</div><div>bank_font.size:=this_font_size;</div><div>bank_canvas.Font.Size:=bank_font.size;</div><div>test_height:=inchheight(bank_canvas,ppiy,font_line);</div><div>x_width:=inchwidth(bank_canvas,ppiy,font_line);</div><div>str(test_height:3:3,font_line);</div><div>font_line:='test_height:='+font_line;</div><div>{if messagedlg(font_line,mtconfirmation,[mbok,mbabort],0)=mrabort then exit;}</div><div>until test_height>=0.30;</div><div>x_init(a_vert-(test_height/2),a_horiz-(x_width/2));</div><div>bank_font.Size:=hold_font;</div><div>end;{ends procedure big_x_init}</div><div><br></div><div>procedure baseform_writer.dot_init(a_vert:double;a_horiz:double);</div><div>begin</div><div>b_printer.init('S',today,0,'*',a_vert,a_horiz,bank_font,form_vert_adjust,form_horiz_adjust,bank_canvas);</div><div>end;</div><div><br></div><div><br></div><div>procedure baseform_writer.na_init(a_vert:double;a_horiz:double);</div><div>begin</div><div>b_printer.init('S',today,0,'N/A',a_vert,a_horiz,bank_font,form_vert_adjust,form_horiz_adjust,bank_canvas);</div><div>end;</div><div><br></div><div><br></div><div><br></div><div>procedure baseform_writer.phn_init(a_phone:phone_record;a_vert:double;a_horiz:double);</div><div>var phoneline:string;</div><div>begin</div><div>with a_phone do begin</div><div>phoneline:=areacode+'-'+prefix+'-'+numm;</div><div>end;</div><div>stringinit(phoneline,a_vert,a_horiz);</div><div>end;</div><div><br></div><div><br></div><div><br></div><div>procedure baseform_writer.street_init(a_street:address_record;a_vert:double;a_horiz:double);</div><div>var x:integer;</div><div>line:string;</div><div>begin</div><div>LINE:=ADD_LINE(a_street);</div><div>X:=POS(a_street.CITY,LINE);</div><div>LINE:=COPY(LINE,1,X-1);</div><div>stringinit(line,a_vert,a_horiz);</div><div>end;</div><div><br></div><div>procedure baseform_writer.city_init(a_city:address_record;a_vert:double;a_horiz:double);</div><div>var line:string;</div><div>begin</div><div>with a_city do begin</div><div>line:=city+' '+state+' '+zip;</div><div>end;</div><div>stringinit(line,a_vert,a_horiz);</div><div>end;</div><div><br></div><div>procedure baseform_writer.set_font_size(const dog:double);</div><div>var this_font_size:integer;</div><div>font_line:string;</div><div>test_height:double;</div><div>x_width:double;</div><div>begin{starts procedure baseform_writer.set_font_size;}</div><div><br></div><div>this_font_size:=60;</div><div>REPEAT                  </div><div>font_line:='X';</div><div>dec(this_font_size);</div><div>bank_font.size:=this_font_size;</div><div>bank_canvas.Font.Size:=bank_font.size;</div><div>test_height:=inchheight(bank_canvas,ppiy,font_line);</div><div>x_width:=inchwidth(bank_canvas,ppiy,font_line);</div><div>str(test_height:3:3,font_line);</div><div>font_line:='test_height:='+font_line;</div><div>until dog>=test_height;</div><div><br></div><div><br></div><div>end;{ends procedure baseform_writer.set_font_size;}</div><div><br></div><div>procedure baseform_writer.set_font_by_length(const dog:double;const hite:double;const cat:string);</div><div><br></div><div>var font_line:string;</div><div>test_height:double;</div><div>x_width:double;</div><div>this_font_size:integer;</div><div>base_font_size:integer;</div><div>begin{starts procedure baseform_writer.set_font_by_length;}</div><div><br></div><div>this_font_size:=60;</div><div>REPEAT</div><div>font_line:=cat;</div><div>dec(this_font_size);</div><div>bank_font.size:=this_font_size;</div><div>bank_canvas.Font.Size:=bank_font.size;</div><div>test_height:=inchheight(bank_canvas,ppiy,font_line);</div><div>x_width:=inchwidth(bank_canvas,ppiy,font_line);</div><div>str(test_height:3:3,font_line);</div><div>font_line:='test_height:='+font_line;</div><div>until dog>=x_width;;</div><div>bank_font.size:=this_font_size;</div><div>base_font_size:=this_font_size;</div><div>if test_height>hite then</div><div>set_font_size(hite);</div><div>if bank_font.size>base_font_size then</div><div>bank_font.size:=base_font_size;</div><div><br></div><div>end;{ends procedure baseform_writer.set_font_by_length;}</div><div>                    </div><div><br></div><div><br></div><div>end.</div></div></div>