1 /* 2 * textbox.h 3 * 4 * 5 * Author: 6 * Richard Hult <rhult@hem.passagen.se> 7 * Ricardo Markiewicz <rmarkie@fi.uba.ar> 8 * Andres de Barbara <adebarbara@fi.uba.ar> 9 * Marc Lorber <lorber.marc@wanadoo.fr> 10 * 11 * Web page: https://ahoi.io/project/oregano 12 * 13 * Copyright (C) 1999-2001 Richard Hult 14 * Copyright (C) 2003,2004 Ricardo Markiewicz 15 * Copyright (C) 2009-2012 Marc Lorber 16 * 17 * This program is free software; you can redistribute it and/or 18 * modify it under the terms of the GNU General Public License as 19 * published by the Free Software Foundation; either version 2 of the 20 * License, or (at your option) any later version. 21 * 22 * This program is distributed in the hope that it will be useful, 23 * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 25 * General Public License for more details. 26 * 27 * You should have received a copy of the GNU General Public 28 * License along with this program; if not, write to the 29 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 30 * Boston, MA 02110-1301, USA. 31 */ 32 33 #ifndef __TEXTBOX_H 34 #define __TEXTBOX_H 35 36 #include <gtk/gtk.h> 37 38 #include "clipboard.h" 39 #include "item-data.h" 40 41 #define TYPE_TEXTBOX (textbox_get_type ()) 42 #define TEXTBOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEXTBOX, Textbox)) 43 #define TEXTBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TEXTBOX, TextboxClass)) 44 #define IS_TEXTBOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEXTBOX)) 45 #define IS_TEXTBOX_CLASS(klass) (G_TYPE_CHECK_GET_CLASS ((klass), TYPE_TEXTBOX)) 46 47 typedef struct _Textbox Textbox; 48 typedef struct _TextboxClass TextboxClass; 49 typedef struct _TextboxPriv TextboxPriv; 50 51 struct _Textbox 52 { 53 ItemData parent; 54 TextboxPriv *priv; 55 gulong text_changed_handler_id; 56 gulong font_changed_handler_id; 57 }; 58 59 struct _TextboxClass 60 { 61 ItemDataClass parent_class; 62 Textbox *(*dup)(Textbox *textbox); 63 }; 64 65 GType textbox_get_type (void); 66 Textbox *textbox_new (char *font); 67 void textbox_set_text (Textbox *textbox, const char *text); 68 char *textbox_get_text (Textbox *textbox); 69 void textbox_set_font (Textbox *textbox, char *font); 70 char *textbox_get_font (Textbox *textbox); 71 void textbox_update_bbox (Textbox *textbox); 72 73 #endif 74