diff --git a/src/BaselineOfGtk/BaselineOfGtk.class.st b/src/BaselineOfGtk/BaselineOfGtk.class.st index ac197239..f808632a 100644 --- a/src/BaselineOfGtk/BaselineOfGtk.class.st +++ b/src/BaselineOfGtk/BaselineOfGtk.class.st @@ -15,11 +15,11 @@ BaselineOfGtk >> baseline: spec [ self glib: spec. self gio: spec. + self pango: spec. spec "core" package: 'Gdk' with: [ spec requires: #('GIO') ]; - package: 'Pango' with: [ spec requires: #('Glib') ]; package: 'Gtk' with: [ spec requires: #('Glib' 'Gdk' 'Pango') ]; "code" @@ -79,6 +79,16 @@ BaselineOfGtk >> installGtkDriver [ ifPresent: [ :driverClass | OSWindowDriver driverClass: driverClass ] ] +{ #category : #baseline } +BaselineOfGtk >> pango: spec [ + + spec baseline: 'Pango' with: [ + spec + loads: #('default'); + repository: self packageRepositoryURL ]. + +] + { #category : #doits } BaselineOfGtk >> postLoad [ diff --git a/src/BaselineOfPango/BaselineOfPango.class.st b/src/BaselineOfPango/BaselineOfPango.class.st new file mode 100644 index 00000000..fda0d8f7 --- /dev/null +++ b/src/BaselineOfPango/BaselineOfPango.class.st @@ -0,0 +1,29 @@ +Class { + #name : #BaselineOfPango, + #superclass : #BaselineOf, + #category : #BaselineOfPango +} + +{ #category : #baseline } +BaselineOfPango >> baseline: spec [ + + + spec + for: #common + do: [ + self glib: spec. + + spec + package: 'Pango' with: [ spec requires: #('Glib') ]]. + +] + +{ #category : #baseline } +BaselineOfPango >> glib: spec [ + + spec baseline: 'Glib' with: [ + spec + loads: #('default'); + repository: self packageRepositoryURL ]. + +] diff --git a/src/BaselineOfPango/package.st b/src/BaselineOfPango/package.st new file mode 100644 index 00000000..c0cd7e40 --- /dev/null +++ b/src/BaselineOfPango/package.st @@ -0,0 +1 @@ +Package { #name : #BaselineOfPango } diff --git a/src/Pango/PangoFT2FontMap.class.st b/src/Pango/PangoFT2FontMap.class.st index e92f0b2b..5985f4d9 100644 --- a/src/Pango/PangoFT2FontMap.class.st +++ b/src/Pango/PangoFT2FontMap.class.st @@ -32,6 +32,11 @@ PangoFT2FontMap >> createContext [ ^ self ffiCall: #(PangoContext *pango_ft2_font_map_create_context (self)) ] +{ #category : #misc } +PangoFT2FontMap >> ft2Library [ + ^ self ffiCall: #(void *_pango_cairo_fc_font_map_get_library (self)) +] + { #category : #initialization } PangoFT2FontMap >> initialize [ self autoRelease diff --git a/src/Pango/PangoFontDescription.class.st b/src/Pango/PangoFontDescription.class.st index f888469e..32dab936 100644 --- a/src/Pango/PangoFontDescription.class.st +++ b/src/Pango/PangoFontDescription.class.st @@ -30,6 +30,12 @@ PangoFontDescription class >> new [ ^ self pango_font_description_new initialize ] +{ #category : #'instance creation' } +PangoFontDescription class >> new [ + + ^ self pango_font_description_new initialize +] + { #category : #'instance creation' } PangoFontDescription class >> newFromString: aString [ @@ -48,7 +54,13 @@ PangoFontDescription class >> pango_font_description_from_string: str [ { #category : #private } PangoFontDescription class >> pango_font_description_new [ - ^ self ffiCall: #(PangoFontDescription *pango_font_description_new ()) + self ffiCall: #(PangoFontDescription* pango_font_description_new ()) +] + +{ #category : #accessing } +PangoFontDescription >> absoluteSize: size [ + + ^ self ffiCall: #( void pango_font_description_set_absolute_size(self , uint size ) ) ] { #category : #accessing } @@ -63,10 +75,40 @@ PangoFontDescription >> familyName: family [ ^ self ffiCall: #(void pango_font_description_set_family(self, String family)) ] +{ #category : #'initialize-release' } +PangoFontDescription >> free [ + + self class pango_font_description_free: handle +] + +{ #category : #isValid } +PangoFontDescription >> isValid [ + + ^ handle isNull not +] + { #category : #accessing } PangoFontDescription >> fontSize [ - ^ self ffiCall: #(gint pango_font_description_get_size ( self )) + ^ self ffiCall: #( uint pango_font_description_get_size(self) ) +] + +{ #category : #accessing } +PangoFontDescription >> fontSize: size [ + + ^ self ffiCall: #( void pango_font_description_set_size(self , uint size ) ) +] + +{ #category : #accessing } +PangoFontDescription >> stretch: stretch [ + + ^ self ffiCall: #( void pango_font_description_set_stretch( self , PangoStretch stretch ) ) +] + +{ #category : #accessing } +PangoFontDescription >> weight: weight [ + + ^ self ffiCall: #( void pango_font_description_set_weight( self , PangoStyle weight ) ) ] { #category : #accessing } diff --git a/src/Pango/PangoLayout.class.st b/src/Pango/PangoLayout.class.st index 357d5e49..405e4f3a 100644 --- a/src/Pango/PangoLayout.class.st +++ b/src/Pango/PangoLayout.class.st @@ -71,6 +71,18 @@ PangoLayout >> fontDescription: desc [ self ffiCall: #(void pango_layout_set_font_description (self, const PangoFontDescription *desc)) ] +{ #category : #accessing } +PangoLayout >> free [ + + ^ self class g_object_unref: handle +] + +{ #category : #accessing } +PangoLayout >> indent [ + + self ffiCall: #(int pango_layout_get_indent (self)) +] + { #category : #accessing } PangoLayout >> getAttributes [ "https://docs.gtk.org/Pango/method.Layout.get_attributes.html" @@ -165,11 +177,22 @@ PangoLayout >> size [ ^ (widthBuffer signedLongAt: 1) @ (heightBuffer signedLongAt: 1) ] +{ #category : #accessing } +PangoLayout >> spacing [ + + self ffiCall: #(int pango_layout_get_spacing (self)) +] + { #category : #accessing } PangoLayout >> text: text [ self ffiCall: #(void pango_layout_set_text (self, const char *text, -1)) ] +{ #category : #accessing } +PangoLayout >> text: text length: len [ + self ffiCall: #(void pango_layout_set_text (self, const char *text, int len)) +] + { #category : #accessing } PangoLayout >> width [ diff --git a/src/Pango/PangoStretch.class.st b/src/Pango/PangoStretch.class.st new file mode 100644 index 00000000..670316c4 --- /dev/null +++ b/src/Pango/PangoStretch.class.st @@ -0,0 +1,33 @@ +Class { + #name : #PangoStretch, + #superclass : #GEnumeration, + #classVars : [ + 'PANGO_STRETCH_CONDENSED', + 'PANGO_STRETCH_EXPANDED', + 'PANGO_STRETCH_EXTRA_CONDENSED', + 'PANGO_STRETCH_EXTRA_EXPANDED', + 'PANGO_STRETCH_NORMAL', + 'PANGO_STRETCH_SEMI_CONDENSED', + 'PANGO_STRETCH_SEMI_EXPANDED', + 'PANGO_STRETCH_ULTRA_CONDENSED', + 'PANGO_STRETCH_ULTRA_EXPANDED' + ], + #category : #'Pango-Base' +} + +{ #category : #'enum declaration' } +PangoStretch class >> enumDecl [ + + "self initialize" + + ^ #( + PANGO_STRETCH_ULTRA_CONDENSED 0 + PANGO_STRETCH_EXTRA_CONDENSED 1 + PANGO_STRETCH_CONDENSED 2 + PANGO_STRETCH_SEMI_CONDENSED 3 + PANGO_STRETCH_NORMAL 4 + PANGO_STRETCH_SEMI_EXPANDED 5 + PANGO_STRETCH_EXPANDED 6 + PANGO_STRETCH_EXTRA_EXPANDED 7 + PANGO_STRETCH_ULTRA_EXPANDED 8) +]