Gnm.Style¶
Fields¶
None
Methods¶
Details¶
- class Gnm.Style¶
- classmethod border_fetch(line_type, color, orientation)¶
- Parameters:
line_type (
Gnm.StyleBorderType
) – dash styleorientation (
Gnm.StyleBorderOrientation
) – Not currently used.
- Returns:
- Return type:
- classmethod border_get_orientation(type)¶
- Parameters:
type (
Gnm.StyleBorderLocation
) –- Return type:
- classmethod border_get_width(line_type)¶
- Parameters:
line_type (
Gnm.StyleBorderType
) –- Return type:
- classmethod border_none()¶
- Returns:
A
Gnm.Border
with no borders.- Return type:
- classmethod border_none_set_color(color)¶
-
This function updates the color of
Gnm.Style.border_none
when the wanted grid color is known.Gnm.Style.border_none
tells how to render the grid. Because the grid color may be different for different sheets, the functions which render the grid call this function first. The rule for selecting the grid color, which is the same as in Excel, is: - if the auto pattern color is default (which is black), the grid color is gray, as returned byGnm.Style.color_grid
(). - otherwise, the auto pattern color is used for the grid.
- classmethod border_ref(border)¶
- Parameters:
border (
Gnm.Border
orNone
) –Gnm.Border
- Returns:
a reference to border
- Return type:
Gnm.Border
orNone
- classmethod border_set_dash(i, context)¶
- Parameters:
i (
Gnm.StyleBorderType
) –context (
cairo.Context
) –
- classmethod border_unref(border)¶
- Parameters:
border (
Gnm.Border
orNone
) –Gnm.Border
- classmethod border_visible_in_blank(border)¶
- Parameters:
border (
Gnm.Border
) –- Return type:
- classmethod borders_row_draw(prev_vert, sr, cr, x, y1, y2, colwidths, draw_vertical, dir)¶
- Parameters:
prev_vert (
Gnm.Border
) –sr (
Gnm.StyleRow
) –cr (
cairo.Context
) –x (
int
) –y1 (
int
) –y2 (
int
) –colwidths (
int
) –draw_vertical (
bool
) –dir (
int
) –
TODO : This is not the final resting place for this. It will move into the gui layer eventually.
- classmethod borders_row_print_gtk(prev_vert, sr, context, x, y1, y2, sheet, draw_vertical, dir)¶
- Parameters:
prev_vert (
Gnm.Border
) –sr (
Gnm.StyleRow
) –context (
cairo.Context
) –x (
float
) –y1 (
float
) –y2 (
float
) –sheet (
Gnm.Sheet
) –draw_vertical (
bool
) –dir (
int
) –
- classmethod color_auto_pattern()¶
- Return type:
Normally black, but follows grid color if so told.
- classmethod color_grid(context)¶
- Parameters:
context (
Gtk.StyleContext
) –- Return type:
- classmethod context_get_color(context, state, color)¶
- Parameters:
context (
Gtk.StyleContext
) –state (
Gtk.StateFlags
) –color (
Gdk.RGBA
) –
- classmethod list_free(l)¶
- Parameters:
l ([
object
]) – the list to free
Free up the resources in the style list. This includes unreferencing the styles.
- classmethod list_get_style(l, col, row)¶
- Parameters:
- Returns:
The style found.
- Return type:
Attempts to find the style associated with the pos offset within the 0,0 based style list.
- classmethod new_default()¶
- Returns:
a new style initialized to the default state.
- Return type:
- abandon_link()¶
- border_draw_diag(cr, x1, y1, x2, y2)¶
- Parameters:
cr (
cairo.Context
) –x1 (
int
) –y1 (
int
) –x2 (
int
) –y2 (
int
) –
- border_print_diag_gtk(context, x1, y1, x2, y2)¶
- Parameters:
context (
cairo.Context
) –x1 (
float
) –y1 (
float
) –x2 (
float
) –y2 (
float
) –
- default_halign(c)¶
- Parameters:
c (
Gnm.Cell
) –- Return type:
Select the appropriate horizontal alignment depending on the style and cell
GOffice.value
.
- dump()¶
This function dumps the given style’s contents to stderr. This is meant for debug purposes only and doesn’t do a very good job for, for example, conditional style settings.
- equal_elem(b, e)¶
- Parameters:
b (
Gnm.Style
) – second stylee (
Gnm.StyleElement
) – style element
- Returns:
True
, if the two styles have the same contents for the given element, either because neither have it set, or because both have it set and to the sameGOffice.value
.- Return type:
- equal_header(b, top)¶
- Parameters:
- Return type:
Check to see if self is different enough from b to make us think that self is from a header.
- find_conflicts(overlay, conflicts)¶
-
Copy any items from overlay that do not conflict with the values in self. If an element had a previous conflict (flagged via conflicts) it is ignored.
Returns conflicts with any new conflicts added.
- find_differences(b, relax_sheet)¶
- Parameters:
- Return type:
Determine how two fully-qualified styles differ.
Returns differences as a bitset of
Gnm.StyleElement
.
- generate_attrs_full()¶
- Returns:
a
Pango.AttrList
with attributes matching self, even attributes where the default would have served.- Return type:
- get_align_h()¶
- Returns:
- Return type:
- get_align_v()¶
- Returns:
- Return type:
- get_border(elem)¶
- Parameters:
elem (
Gnm.StyleElement
) – Border element- Returns:
The
Gnm.Border
for a single border element.- Return type:
Gnm.Border
orNone
- get_cond_style(ix)¶
- get_conditions()¶
- Returns:
the currently set conditional style.
- Return type:
- get_effective_wrap_text()¶
- get_font(context)¶
- Parameters:
context (
Pango.Context
) –Pango.Context
- Returns:
Gnm.Font
implied by self.- Return type:
- get_font_script()¶
- Returns:
GOffice.FontScript
specifying super or subscript- Return type:
- get_font_uline()¶
- Returns:
Gnm.Underline
specifying type of underlining- Return type:
- get_format()¶
- Returns:
- Return type:
- get_input_msg()¶
- Returns:
the currently set input message.
- Return type:
Gnm.InputMsg
orNone
- get_pango_attrs(context, zoom)¶
- Parameters:
context (
Pango.Context
) –zoom (
float
) –
- Return type:
- get_pango_height(context, zoom)¶
- Parameters:
context (
Pango.Context
) –zoom (
float
) –
- Return type:
- get_text_dir()¶
- Returns:
- Return type:
- get_validation()¶
- Return type:
- get_wrap_text()¶
- Returns:
True
for wrapping,False
for not. See alsoGnm.Style.get_effective_wrap_text
.- Return type:
- is_element_set(elem)¶
- Parameters:
elem (
Gnm.StyleElement
) –- Return type:
- link()¶
- link_sheet(sheet)¶
- Parameters:
sheet (
Gnm.Sheet
) – the new sheet- Returns:
new style which may or may not be identical to the incoming.
ABSORBS a reference to the style and sets the link
GOffice.count
to 1.Where auto pattern color occurs in the style (it may for pattern and borders), it is replaced with the sheet’s auto pattern color. We make sure that we do not modify the style which was passed in to us, but also that we don’t copy more than once. The final argument to the link_xxxxx_color functions tell whether or not to copy.
- Return type:
- merge(overlay)¶
-
Applies all active elements of overlay onto self.
- merge_element(src, elem)¶
- Parameters:
src (
Gnm.Style
) – Source styleelem (
Gnm.StyleElement
) – Element to replace
This function replaces element elem in style self with element elem in style src. (If element elem was already set in style self then the element will first be unset)
- new_merged(overlay)¶
- Parameters:
- Returns:
A ref to a new
Gnm.Style
.- Return type:
A new
Gnm.Style
that contains any elements of overlay that are set, and uses self for anything that is not set in overlay.
- required_spanflags()¶
- Return type:
What changes are required after applying the supplied style.
- set_align_h(a)¶
- Parameters:
a (
Gnm.HAlign
) – AGnm.HAlign
- set_align_v(a)¶
- Parameters:
a (
Gnm.VAlign
) – AGnm.VAlign
- set_back_color(col)¶
-
Assigns col as the background of self.
NOTE: the background colour is only visible if
Gnm.Style
::pattern
> 0
- set_border(elem, border)¶
- Parameters:
elem (
Gnm.StyleElement
) – Border elementborder (
Gnm.Border
orNone
) – newGnm.Border
for self.
- set_conditions(sc)¶
- Parameters:
sc (
Gnm.StyleConditions
orNone
) –Gnm.StyleConditions
This sets conditional style for self.
- set_font_script(script)¶
- Parameters:
script (
GOffice.FontScript
) –GOffice.FontScript
specifying super or subscript
- set_font_uline(ul)¶
- Parameters:
ul (
Gnm.Underline
) –Gnm.Underline
specifying type of underlining
- set_format(fmt)¶
- Parameters:
fmt (
GOffice.Format
) –GOffice.Format
- set_from_pango_attribute(attr)¶
- Parameters:
attr (
Pango.Attribute
) –
- set_input_msg(msg)¶
- Parameters:
msg (
Gnm.InputMsg
orNone
) –Gnm.InputMsg
This sets an input message for self.
- set_text_dir(text_dir)¶
- Parameters:
text_dir (
Gnm.TextDir
) – AGnm.TextDir
- set_validation(v)¶
- Parameters:
v (
Gnm.Validation
orNone
) –Gnm.Validation
- unlink()¶
- unset_element(elem)¶
- Parameters:
elem (
Gnm.StyleElement
) –