Merge branch 'GtkPartialMerge' into 'main'

GTK3: Updated Pango1 unit generated with new gir2pas version.

See merge request freepascal.org/lazarus/lazarus!195
This commit is contained in:
Maxim Ganetsky 2023-06-04 00:48:44 +00:00
commit dcbf685e78
4 changed files with 1243 additions and 436 deletions

File diff suppressed because it is too large Load Diff

View File

@ -63,9 +63,9 @@ function PANGO_IS_CAIRO_FONT_MAP(objekt : pointer) : boolean;
function pango_cairo_font_map_get_type():GType;cdecl;external pangocairolib;
function pango_cairo_font_map_new:PPangoFontMap;cdecl;external pangocairolib;
function pango_cairo_font_map_new_for_font_type(fonttype:cairo_font_type_t):PPangoFontMap;cdecl;external pangocairolib;
function pango_cairo_font_map_new_for_font_type(fonttype:Tcairo_font_type_t):PPangoFontMap;cdecl;external pangocairolib;
function pango_cairo_font_map_get_default:PPangoFontMap;cdecl;external pangocairolib;
function pango_cairo_font_map_get_font_type(fontmap:PPangoCairoFontMap):cairo_font_type_t;cdecl;external pangocairolib;
function pango_cairo_font_map_get_font_type(fontmap:PPangoCairoFontMap):Tcairo_font_type_t;cdecl;external pangocairolib;
procedure pango_cairo_font_map_set_resolution(fontmap:PPangoCairoFontMap; dpi:double);cdecl;external pangocairolib;
function pango_cairo_font_map_get_resolution(fontmap:PPangoCairoFontMap):double;cdecl;external pangocairolib;

View File

@ -680,21 +680,21 @@ begin
if not Assigned(fHandle) then exit;
fillchar(fLogFont,sizeof(fLogFont),0);
members:=fHandle^.get_set_fields;
if (PANGO_FONT_MASK_FAMILY and members<>0) then
if PANGO_FONT_MASK_FAMILY in members then
begin
fLogFont.lfFaceName:=PChar(fHandle^.get_family);
end;
if (PANGO_FONT_MASK_STYLE and members<>0) then
if PANGO_FONT_MASK_STYLE in members then
begin
AStyle := fHandle^.get_style;
if AStyle = PANGO_STYLE_ITALIC then
fLogFont.lfItalic:=1;
end;
if (PANGO_FONT_MASK_WEIGHT and members<>0) then
if PANGO_FONT_MASK_WEIGHT in members then
begin
fLogFont.lfWeight:=fHandle^.get_weight();
fLogFont.lfWeight := Integer(fHandle^.get_weight());
end;
if (PANGO_FONT_MASK_GRAVITY and members<>0) then
if PANGO_FONT_MASK_GRAVITY in members then
begin
AGravity := fHandle^.get_gravity;
if AGravity = PANGO_GRAVITY_SOUTH then
@ -709,7 +709,7 @@ begin
if AGravity = PANGO_GRAVITY_WEST then
fLogFont.lfOrientation := 2700;
end;
if (PANGO_FONT_MASK_SIZE and members<>0) then
if PANGO_FONT_MASK_SIZE in members then
begin
sz:=fHandle^.get_size;
if fHandle^.get_size_is_absolute then
@ -785,7 +785,7 @@ begin
FHandle^.set_absolute_size(Abs(ALogFont.lfHeight) * PANGO_SCALE);
if ALogFont.lfItalic > 0 then
FHandle^.set_style(PANGO_STYLE_ITALIC);
FHandle^.set_weight(ALogFont.lfWeight);
FHandle^.set_weight(TPangoWeight(ALogFont.lfWeight));
FLayout := pango_layout_new(AContext);
FLayout^.set_font_description(FHandle);
@ -2151,7 +2151,7 @@ begin
GTK_STATE_FLAG_DIR_LTR: TGtkStateFlags = 128;
GTK_STATE_FLAG_DIR_RTL: TGtkStateFlags = 256;
}
gtk_style_context_set_state (context, TGtkStateFlags(Ord(GTK_STATE_FLAG_FOCUSED) or Ord(GTK_STATE_FLAG_PRELIGHT)));
gtk_style_context_set_state (context, TGtkStateFlags(Integer(GTK_STATE_FLAG_FOCUSED) or Integer(GTK_STATE_FLAG_PRELIGHT)));
pw:=w;
while Assigned(pw) do

View File

@ -1231,13 +1231,13 @@ var
ALogFontA.lfItalic := Byte(FontStyle = PANGO_STYLE_ITALIC);
// keep newer pango compat to LCL
if FontWeight = 380 {PANGO_WEIGHT_BOOK as of pango 1.24} then
if FontWeight = PANGO_WEIGHT_BOOK {380 as of pango 1.24} then
FontWeight := PANGO_WEIGHT_NORMAL
else
if FontWeight = 1000 {PANGO_WEIGHT_ULTRAHEAVY as of pango 1.24} then
if FontWeight = PANGO_WEIGHT_ULTRAHEAVY {1000 as of pango 1.24} then
FontWeight := PANGO_WEIGHT_HEAVY;
ALogFontA.lfWeight := FontWeight;
ALogFontA.lfWeight := Integer(FontWeight);
ALogFontA.lfHeight := pango_font_description_get_size(Font);
if not pango_font_description_get_size_is_absolute(Font) then
@ -2670,7 +2670,7 @@ begin
if APangoWeight > PANGO_WEIGHT_HEAVY then
APangoWeight := PANGO_WEIGHT_HEAVY;
TM.tmWeight := APangoWeight;
TM.tmWeight := Integer(APangoWeight);
TM.tmFirstChar := 'a';
TM.tmLastChar := 'z';