Added style methods back

master
Yevgen Muntyan 2006-12-30 23:57:12 -06:00
parent 91b78b5c85
commit 35d2372f8d
3 changed files with 37 additions and 65 deletions

View File

@ -50,10 +50,14 @@ struct _MooTextStyle
};
GType moo_text_style_get_type (void) G_GNUC_CONST;
void moo_text_style_free (MooTextStyle *style);
void _moo_text_style_apply_to_tag (const MooTextStyle *style,
GtkTextTag *tag);
GType moo_text_style_get_type (void) G_GNUC_CONST;
MooTextStyle *moo_text_style_new (MooTextStyleMask mask);
MooTextStyle *moo_text_style_copy (const MooTextStyle *style);
void moo_text_style_free (MooTextStyle *style);
void _moo_text_style_apply_to_tag (const MooTextStyle *style,
GtkTextTag *tag);
G_END_DECLS

View File

@ -50,6 +50,17 @@ moo_text_style_get_type (void)
return type;
}
MooTextStyle *
moo_text_style_new (MooTextStyleMask mask)
{
return (MooTextStyle*) gtk_source_style_new (mask);
}
MooTextStyle *
moo_text_style_copy (const MooTextStyle *style)
{
return style ? (MooTextStyle*) gtk_source_style_copy ((GtkSourceStyle*) style) : NULL;
}
void
moo_text_style_free (MooTextStyle *style)

View File

@ -124,24 +124,20 @@
;; )
;; (define-boxed TextStyle
;; (in-module "Moo")
;; (c-name "MooTextStyle")
;; (gtype-id "MOO_TYPE_TEXT_STYLE")
;; (copy-func "moo_text_style_copy")
;; (release-func "moo_text_style_free")
;; (fields
;; '("char*" "default_style")
;; '("GdkColor" "foreground")
;; '("GdkColor" "background")
;; '("gboolean" "bold")
;; '("gboolean" "italic")
;; '("gboolean" "underline")
;; '("gboolean" "strikethrough")
;; '("gboolean" "modified")
;; '("MooTextStyleMask" "mask")
;; )
;; )
(define-boxed TextStyle
(in-module "Moo")
(c-name "MooTextStyle")
(gtype-id "MOO_TYPE_TEXT_STYLE")
(fields
'("MooTextStyleMask" "mask")
'("GdkColor" "foreground")
'("GdkColor" "background")
'("gboolean" "bold")
'("gboolean" "italic")
'("gboolean" "underline")
'("gboolean" "strikethrough")
)
)
(include "mooplugin.defs")
@ -863,24 +859,6 @@
(return-type "gboolean")
)
(define-method set_bracket_match_style
(of-object "MooTextBuffer")
(c-name "moo_text_buffer_set_bracket_match_style")
(return-type "none")
(parameters
'("const-MooTextStyle*" "style")
)
)
(define-method set_bracket_mismatch_style
(of-object "MooTextBuffer")
(c-name "moo_text_buffer_set_bracket_mismatch_style")
(return-type "none")
(parameters
'("const-MooTextStyle*" "style")
)
)
(define-method set_brackets
(of-object "MooTextBuffer")
(c-name "moo_text_buffer_set_brackets")
@ -998,37 +976,16 @@
(is-constructor-of "MooTextStyle")
(return-type "MooTextStyle*")
(parameters
'("const-char*" "default_style" (null-ok) (default "NULL"))
'("const-GdkColor*" "foreground")
'("const-GdkColor*" "background")
'("gboolean" "bold")
'("gboolean" "italic")
'("gboolean" "underline")
'("gboolean" "strikethrough")
'("MooTextStyleMask" "mask")
'("gboolean" "modified")
'("MooTextStyleMask" "mask" (null-ok) (default "0"))
)
)
(define-method copy_content
(define-method moo_text_style_copy
(c-name "moo_text_style_copy")
(of-object "MooTextStyle")
(c-name "moo_text_style_copy_content")
(return-type "none")
(parameters
'("const-MooTextStyle*" "src")
)
(return-type "MooTextStyle*")
)
(define-method compose
(of-object "MooTextStyle")
(c-name "moo_text_style_compose")
(return-type "none")
(parameters
'("const-MooTextStyle*" "src")
)
)
;; From mootextstylescheme.h