1
0
Fork 0

Add text-visibility accessors for ClutterText

A ClutterText can be put in "password mode" by setting the
text as "invisible": every character inside the Text actor's
contents will be replaced when building the Pango layout with
a specific Unicode character.

The Unicode character is set to '*' by default, but the user
can be changed using the provided API.
This commit is contained in:
Emmanuele Bassi 2008-12-11 11:40:55 +00:00 committed by Emmanuele Bassi
parent 64af7bafe3
commit d5df1bebcf
2 changed files with 494 additions and 179 deletions

File diff suppressed because it is too large Load diff

View file

@ -3,9 +3,10 @@
* *
* An OpenGL based 'interactive canvas' library. * An OpenGL based 'interactive canvas' library.
* *
* Copyright (C) 2006-2008 OpenedHand * Copyright (C) 2008 Intel Corporation.
* *
* Authored By Øyvind Kolås <pippin@o-hand.com> * Authored By: Øyvind Kolås <pippin@o-hand.com>
* Emmanuele Bassi <ebassi@linux.intel.com>
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -28,8 +29,8 @@
#ifndef __CLUTTER_TEXT_H__ #ifndef __CLUTTER_TEXT_H__
#define __CLUTTER_TEXT_H__ #define __CLUTTER_TEXT_H__
#include <clutter/clutter-label.h> #include <clutter/clutter-actor.h>
#include <clutter/clutter-types.h> #include <pango/pango.h>
G_BEGIN_DECLS G_BEGIN_DECLS
@ -54,13 +55,17 @@ struct _ClutterText
struct _ClutterTextClass struct _ClutterTextClass
{ {
/*< private >*/
ClutterActorClass parent_class; ClutterActorClass parent_class;
/*< public >*/
void (* text_changed) (ClutterText *self); void (* text_changed) (ClutterText *self);
void (* activate) (ClutterText *self); void (* activate) (ClutterText *self);
void (* cursor_event) (ClutterText *self, void (* cursor_event) (ClutterText *self,
ClutterGeometry *geometry); ClutterGeometry *geometry);
/*< private >*/
/* padding for future expansion */
void (* _clutter_reserved1) (void); void (* _clutter_reserved1) (void);
void (* _clutter_reserved2) (void); void (* _clutter_reserved2) (void);
void (* _clutter_reserved3) (void); void (* _clutter_reserved3) (void);
@ -151,14 +156,14 @@ void clutter_text_set_selection_bound (ClutterText *self
gint selection_bound); gint selection_bound);
gint clutter_text_get_selection_bound (ClutterText *self); gint clutter_text_get_selection_bound (ClutterText *self);
gchar * clutter_text_get_selection (ClutterText *self); gchar * clutter_text_get_selection (ClutterText *self);
void clutter_text_set_visibility (ClutterText *self, void clutter_text_set_text_visible (ClutterText *self,
gboolean visible); gboolean visible);
gboolean clutter_text_get_visibility (ClutterText *self); gboolean clutter_text_get_text_visible (ClutterText *self);
void clutter_text_set_invisible_char (ClutterText *self, void clutter_text_set_invisible_char (ClutterText *self,
gunichar wc); gunichar wc);
gunichar clutter_text_get_invisible_char (ClutterText *self); gunichar clutter_text_get_invisible_char (ClutterText *self);
void clutter_text_set_max_length (ClutterText *self, void clutter_text_set_max_length (ClutterText *self,
gint max); gint max);
gint clutter_text_get_max_length (ClutterText *self); gint clutter_text_get_max_length (ClutterText *self);
/* add a custom action that can be used in keybindings */ /* add a custom action that can be used in keybindings */