1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
|
#############################################################################
## Name: XS/TextAttr.xsp
## Purpose: XS for Wx::TextAttr
## Author: Mattia Barbon
## Modified by:
## Created: 24/11/2007
## RCS-ID: $Id: TextAttr.xsp 2523 2009-02-04 23:50:57Z mbarbon $
## Copyright: (c) 2000-2003, 2005-2009 Mattia Barbon
## Licence: This program is free software; you can redistribute it and/or
## modify it under the same terms as Perl itself
#############################################################################
%module{Wx};
#include <wx/textctrl.h>
%typemap{wxTextAttr*}{simple};
%typemap{const wxTextAttr&}{reference};
%typemap{wxTextAttrAlignment}{simple};
%typemap{wxFontEncoding}{simple};
%typemap{wxFontStyle}{simple};
%typemap{wxFontWeight}{simple};
%name{Wx::TextAttr} class wxTextAttr
{
%{
wxTextAttr*
wxTextAttr::new( colText = wxNullColour, colBack = wxNullColour, font = (wxFont*)&wxNullFont )
wxColour colText
wxColour colBack
wxFont* font
CODE:
if( items == 1 )
RETVAL = new wxTextAttr();
else
RETVAL = new wxTextAttr( colText, colBack, *font );
OUTPUT:
RETVAL
%}
## // thread OK
%{
void
wxTextAttr::DESTROY()
CODE:
wxPli_thread_sv_unregister( aTHX_ "Wx::TextAttr", THIS, ST(0) );
delete THIS;
static void
wxTextAttr::CLONE()
CODE:
wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
%}
#if WXPERL_W_VERSION_GE( 2, 9, 0 )
bool Apply(const wxTextAttr& style, wxTextAttr* compareWith = NULL );
#endif
#if WXPERL_W_VERSION_GE( 2, 7, 0 )
void Merge( const wxTextAttr& overlay );
#endif
void SetTextColour( const wxColour& colText );
void SetBackgroundColour( const wxColour& colBack );
void SetFont( const wxFont& font, long flags = wxTEXT_ATTR_FONT );
void SetAlignment( wxTextAttrAlignment alignment );
void SetTabs( const wxArrayInt& tabs );
void SetLeftIndent( int indent, int subIndent = 0 );
void SetRightIndent( int indent );
void SetFlags( long flags );
bool HasTextColour() const;
bool HasBackgroundColour() const;
bool HasFont() const;
bool HasAlignment() const;
bool HasTabs() const;
bool HasLeftIndent() const;
bool HasRightIndent() const;
bool HasFlag( long flag ) const;
const wxColour& GetTextColour() const;
const wxColour& GetBackgroundColour() const;
const wxFont& GetFont() const;
wxTextAttrAlignment GetAlignment() const;
long GetLeftIndent() const;
long GetLeftSubIndent() const;
long GetRightIndent() const;
long GetFlags() const;
bool IsDefault() const;
%{
void
wxTextAttr::GetTabs()
PPCODE:
const wxArrayInt& tabs = THIS->GetTabs();
PUTBACK;
wxPli_intarray_push( aTHX_ tabs );
SPAGAIN;
%}
#if WXPERL_W_VERSION_GE( 2, 9, 0 )
wxFontEncoding GetFontEncoding() const;
bool HasFontEncoding() const;
void SetFontEncoding( wxFontEncoding encoding );
## wxTextAttrEx
int GetOutlineLevel() const;
bool HasOutlineLevel() const;
void SetOutlineLevel( int level );
int GetTextEffects() const;
bool HasTextEffects() const;
void SetTextEffects( int effects );
int GetTextEffectFlags() const;
bool HasTextEffect( int effect ) const;
void SetTextEffectFlags( int effects );
#endif
## in 2.9, from wxTextAttrEx and wxRichTextAttr
#if WXPERL_W_VERSION_GE( 2, 9, 0 )
## wxTextAttrEx
void SetCharacterStyleName( const wxString& name );
void SetParagraphStyleName( const wxString& name );
void SetListStyleName( const wxString& name );
void SetParagraphSpacingAfter( int spacing );
void SetParagraphSpacingBefore( int spacing );
void SetLineSpacing( int spacing );
void SetBulletStyle( int style );
void SetBulletNumber( int n );
void SetBulletText( const wxString& text );
void SetBulletName( const wxString& name );
void SetBulletFont( const wxString& bulletFont );
void SetURL( const wxString& url );
void SetPageBreak( bool pageBreak = true );
const wxString& GetCharacterStyleName() const;
const wxString& GetParagraphStyleName() const;
const wxString& GetListStyleName() const;
int GetParagraphSpacingAfter() const;
int GetParagraphSpacingBefore() const;
int GetLineSpacing() const;
int GetBulletStyle() const;
int GetBulletNumber() const;
const wxString& GetBulletText() const;
const wxString& GetBulletName() const;
const wxString& GetBulletFont() const;
const wxString& GetURL() const;
bool HasParagraphSpacingAfter() const;
bool HasParagraphSpacingBefore() const;
bool HasLineSpacing() const;
bool HasCharacterStyleName() const;
bool HasParagraphStyleName() const;
bool HasListStyleName() const;
bool HasBulletStyle() const;
bool HasBulletNumber() const;
bool HasBulletText() const;
bool HasBulletName() const;
bool HasURL() const;
bool HasPageBreak() const;
bool IsCharacterStyle() const;
bool IsParagraphStyle() const;
## wxRichTextAttr
#if WXPERL_W_VERSION_LT( 2, 9, 0 )
wxFont CreateFont() const;
#endif
bool GetFontAttributes( const wxFont& font );
void SetFontSize( int pointSize );
void SetFontStyle( wxFontStyle fontStyle );
void SetFontWeight( wxFontWeight fontWeight );
void SetFontFaceName( const wxString& faceName );
void SetFontUnderlined( bool underlined );
int GetFontSize() const;
wxFontStyle GetFontStyle() const;
wxFontWeight GetFontWeight() const;
bool GetFontUnderlined() const;
const wxString& GetFontFaceName() const;
bool HasFontWeight() const;
bool HasFontSize() const;
bool HasFontItalic() const;
bool HasFontUnderlined() const;
bool HasFontFaceName() const;
#endif
};
|