Commit ae88d915 authored by Noah Levitt's avatar Noah Levitt

Reorganized so that everything public has the gucharmap_ prefix.

parent 36f5be5c
2003-05-03 Noah Levitt
2003-05-04 Noah Levitt
* gucharmap/Makefile.am:
* gucharmap/charcell_accessible.c:
......@@ -17,6 +17,7 @@
* gucharmap/gucharmap-unicode-info.h:
* gucharmap/gucharmap-window.c:
* gucharmap/gucharmap-window.h:
* gucharmap/gucharmap.h:
* gucharmap/imgucharmap.c:
* gucharmap/main.c:
* gucharmap/mini_fontsel.c:
......
......@@ -29,14 +29,14 @@ lib_LTLIBRARIES = libgucharmap.la
libgucharmap_la_SOURCES = gucharmap_marshal.c gucharmap_marshal.h \
charmap.c charmap.h \
unicode_info.c unicode_info.h \
gucharmap_intl.c gucharmap_intl.h \
chartable_accessible.c chartable_accessible.h \
charcell_accessible.c charcell_accessible.h \
chartable.c chartable.h \
mini_fontsel.c mini_fontsel.h \
gucharmap_window.c gucharmap_window.h
gucharmap-charmap.c gucharmap-charmap.h \
gucharmap-mini-fontsel.c gucharmap-mini-fontsel.h \
gucharmap-table.c gucharmap-table.h \
gucharmap-unicode-info.c gucharmap-unicode-info.h \
gucharmap-window.c gucharmap-window.h
# this is different from the project version
......@@ -45,8 +45,12 @@ libgucharmap_la_LDFLAGS = -version-info 2:0:0
libgucharmapincludedir = $(includedir)/gucharmap
libgucharmapinclude_HEADERS = charmap.h chartable.h unicode_info.h \
mini_fontsel.h gucharmap_window.h
libgucharmapinclude_HEADERS = gucharmap.h \
gucharmap-charmap.h \
gucharmap-table.h \
gucharmap-window.h \
gucharmap-mini-fontsel.h \
gucharmap-unicode-info.h
bin_PROGRAMS = gucharmap
......
......@@ -25,16 +25,16 @@
#include <stdlib.h>
#include <gtk/gtk.h>
#include <charcell_accessible.h>
#include <chartable.h>
#include <gucharmap/gucharmap.h>
#include "charcell_accessible.h"
extern gint chartable_x_offset (Chartable *chartable, gint col);
extern gint chartable_y_offset (Chartable *chartable, gint row);
extern gint chartable_unichar_column (Chartable *chartable, gunichar uc);
extern gint chartable_row_height (Chartable *chartable, gint row);
extern gint chartable_column_width (Chartable *chartable, gint col);
extern void chartable_redraw (Chartable *chartable, gboolean move_zoom);
extern gint gucharmap_table_x_offset (GucharmapTable *chartable, gint col);
extern gint gucharmap_table_y_offset (GucharmapTable *chartable, gint row);
extern gint gucharmap_table_unichar_column (GucharmapTable *chartable, gunichar uc);
extern gint gucharmap_table_row_height (GucharmapTable *chartable, gint row);
extern gint gucharmap_table_column_width (GucharmapTable *chartable, gint col);
extern void gucharmap_table_redraw (GucharmapTable *chartable, gboolean move_zoom);
static gpointer parent_class = NULL;
......@@ -119,7 +119,7 @@ charcell_accessible_get_extents (AtkComponent *component,
{
CharcellAccessible *cell;
AtkObject *cell_parent;
Chartable *chartable;
GucharmapTable *chartable;
gint real_x, real_y, real_width, real_height;
gint row, column;
......@@ -132,18 +132,18 @@ charcell_accessible_get_extents (AtkComponent *component,
/*
* Is the cell visible on the screen
*/
chartable = CHARTABLE (cell->widget);
chartable = GUCHARMAP_TABLE (cell->widget);
if (cell->index >= chartable->page_first_char && cell->index < chartable->page_first_char + chartable->rows * chartable->cols)
{
atk_component_get_extents (ATK_COMPONENT (cell_parent),
&real_x, &real_y, &real_width, &real_height,
coord_type);
row = (cell->index - chartable->page_first_char)/ chartable->cols;
column = chartable_unichar_column (chartable, cell->index);
*x = real_x + chartable_x_offset (chartable, column);
*y = real_y + chartable_y_offset (chartable, row);
*width = chartable_column_width (chartable, column);
*height = chartable_row_height (chartable, row);
column = gucharmap_table_unichar_column (chartable, cell->index);
*x = real_x + gucharmap_table_x_offset (chartable, column);
*y = real_y + gucharmap_table_y_offset (chartable, row);
*width = gucharmap_table_column_width (chartable, column);
*height = gucharmap_table_row_height (chartable, row);
}
else
{
......@@ -157,15 +157,15 @@ static gboolean
charcell_accessible_grab_focus (AtkComponent *component)
{
CharcellAccessible *cell;
Chartable *chartable;
GucharmapTable *chartable;
g_return_val_if_fail (IS_CHARCELL_ACCESSIBLE (component), FALSE);
cell = CHARCELL_ACCESSIBLE (component);
chartable = CHARTABLE (cell->widget);
chartable_set_active_character (chartable, cell->index);
chartable_redraw (chartable, TRUE);
chartable = GUCHARMAP_TABLE (cell->widget);
gucharmap_table_set_active_character (chartable, cell->index);
gucharmap_table_redraw (chartable, TRUE);
return TRUE;
}
......@@ -191,13 +191,13 @@ static gboolean
idle_do_action (gpointer data)
{
CharcellAccessible *cell;
Chartable *chartable;
GucharmapTable *chartable;
cell = CHARCELL_ACCESSIBLE (data);
chartable = CHARTABLE (cell->widget);
chartable_set_active_character (chartable, cell->index);
chartable_redraw (chartable, TRUE);
chartable = GUCHARMAP_TABLE (cell->widget);
gucharmap_table_set_active_character (chartable, cell->index);
gucharmap_table_redraw (chartable, TRUE);
g_signal_emit_by_name (chartable, "activate", cell->index);
return FALSE;
}
......
......@@ -25,15 +25,14 @@
#include <string.h>
#include <gtk/gtk.h>
#include <chartable_accessible.h>
#include <charcell_accessible.h>
#include <chartable.h>
#include <unicode_info.h>
#include <gucharmap/gucharmap.h>
#include "chartable_accessible.h"
#include "charcell_accessible.h"
extern gint chartable_x_offset (Chartable *chartable, gint col);
extern gint chartable_y_offset (Chartable *chartable, gint row);
extern gint chartable_unichar_column (Chartable *chartable, gunichar uc);
extern gint gucharmap_table_x_offset (GucharmapTable *chartable, gint col);
extern gint gucharmap_table_y_offset (GucharmapTable *chartable, gint row);
extern gint gucharmap_table_unichar_column (GucharmapTable *chartable, gunichar uc);
typedef struct
......@@ -83,29 +82,20 @@ find_cell (ChartableAccessible *table,
}
static Chartable*
static GucharmapTable*
get_chartable (GtkWidget *table)
{
GtkWidget *widget;
g_return_val_if_fail (GTK_IS_DRAWING_AREA (table), NULL);
widget = table->parent;
#if 0
/* XXX: I think this stuff is only application to Charmap */
g_return_val_if_fail (GTK_IS_HBOX (widget), NULL);
widget = widget->parent;
g_return_val_if_fail (GTK_IS_VBOX (widget), NULL);
widget = widget->parent;
g_return_val_if_fail (GTK_IS_HPANED (widget), NULL);
widget = widget->parent;
#endif
g_return_val_if_fail (IS_CHARTABLE (widget), NULL);
return CHARTABLE (widget);
g_return_val_if_fail (IS_GUCHARMAP_TABLE (widget), NULL);
return GUCHARMAP_TABLE (widget);
}
static void
set_cell_visibility (Chartable *chartable,
set_cell_visibility (GucharmapTable *chartable,
CharcellAccessible *cell,
gboolean emit_signal)
{
......@@ -211,7 +201,7 @@ static AtkObject*
chartable_accessible_ref_child (AtkObject *obj, gint i)
{
GtkWidget *widget;
Chartable *chartable;
GucharmapTable *chartable;
AtkObject *child;
ChartableAccessible *table;
gchar* name;
......@@ -242,7 +232,7 @@ chartable_accessible_ref_child (AtkObject *obj, gint i)
charcell_accessible_init (CHARCELL_ACCESSIBLE (child),
GTK_WIDGET (chartable), obj, i);
/* Set the name of the cell */
name = g_strdup_printf("U+%4.4X %s", i, get_unicode_name (i));
name = g_strdup_printf("U+%4.4X %s", i, gucharmap_get_unicode_name (i));
atk_object_set_name (child, name);
g_free (name);
set_cell_visibility (chartable, CHARCELL_ACCESSIBLE (child), FALSE);
......@@ -258,7 +248,7 @@ chartable_accessible_ref_at (AtkTable *table,
gint column)
{
GtkWidget *widget;
Chartable *chartable;
GucharmapTable *chartable;
AtkObject *child;
gint index;
......@@ -286,7 +276,7 @@ chartable_accessible_ref_accessible_at_point (AtkComponent *component,
AtkCoordType coord_type)
{
GtkWidget *widget;
Chartable *chartable;
GucharmapTable *chartable;
gint x_pos, y_pos;
gint row, col;
......@@ -309,7 +299,7 @@ chartable_accessible_ref_accessible_at_point (AtkComponent *component,
for (col = 0; col < chartable->cols; col++)
{
if (x_pos < chartable_x_offset (chartable, col))
if (x_pos < gucharmap_table_x_offset (chartable, col))
{
col--;
break;
......@@ -320,7 +310,7 @@ chartable_accessible_ref_accessible_at_point (AtkComponent *component,
for (row = 0; row < chartable->rows; row++)
{
if (y_pos < chartable_y_offset (chartable, row))
if (y_pos < gucharmap_table_y_offset (chartable, row))
{
row--;
break;
......@@ -364,7 +354,7 @@ static gint
chartable_accessible_get_n_children (AtkObject *obj)
{
GtkWidget *widget;
Chartable *chartable;
GucharmapTable *chartable;
widget = GTK_ACCESSIBLE (obj)->widget;
if (widget == NULL)
......@@ -419,7 +409,7 @@ traverse_cells (AtkObject *obj)
GtkWidget *widget;
GList *l;
GList *cell_list;
Chartable *chartable;
GucharmapTable *chartable;
CharcellAccessibleInfo *info;
g_return_if_fail (IS_CHARTABLE_ACCESSIBLE (obj));
......@@ -461,21 +451,21 @@ size_allocated (GtkWidget *widget,
static AtkObject*
find_object (Chartable *chartable,
find_object (GucharmapTable *chartable,
gunichar uc,
AtkObject *obj)
{
gint row, column;
row = uc / chartable->cols;
column = chartable_unichar_column (chartable, uc);
column = gucharmap_table_unichar_column (chartable, uc);
return atk_table_ref_at (ATK_TABLE (obj), row, column);
}
static void
active_char_set (Chartable *chartable,
active_char_set (GucharmapTable *chartable,
guint ui,
gpointer data)
{
......@@ -505,7 +495,7 @@ chartable_accessible_initialize (AtkObject *obj,
GtkWidget *widget;
AtkObject *focus_obj;
ChartableAccessible *table;
Chartable *chartable;
GucharmapTable *chartable;
ATK_OBJECT_CLASS (parent_class)->initialize (obj, data);
......@@ -545,7 +535,7 @@ static gint
chartable_accessible_get_n_columns (AtkTable *table)
{
GtkWidget *widget;
Chartable *chartable;
GucharmapTable *chartable;
widget = GTK_ACCESSIBLE (table)->widget;
if (widget == NULL)
......@@ -580,7 +570,7 @@ static gint
chartable_accessible_get_n_rows (AtkTable *table)
{
GtkWidget *widget;
Chartable *chartable;
GucharmapTable *chartable;
gint n_rows;
widget = GTK_ACCESSIBLE (table)->widget;
......@@ -620,7 +610,7 @@ chartable_accessible_get_index_at (AtkTable *table,
gint column)
{
GtkWidget *widget;
Chartable *chartable;
GucharmapTable *chartable;
widget = GTK_ACCESSIBLE (table)->widget;
if (widget == NULL)
......@@ -640,7 +630,7 @@ chartable_accessible_get_column_at_index (AtkTable *table,
gint index)
{
GtkWidget *widget;
Chartable *chartable;
GucharmapTable *chartable;
widget = GTK_ACCESSIBLE (table)->widget;
if (widget == NULL)
......@@ -660,7 +650,7 @@ chartable_accessible_get_row_at_index (AtkTable *table,
gint index)
{
GtkWidget *widget;
Chartable *chartable;
GucharmapTable *chartable;
widget = GTK_ACCESSIBLE (table)->widget;
if (widget == NULL)
......
......@@ -17,67 +17,67 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef CHARMAP_H
#define CHARMAP_H
#ifndef GUCHARMAP_CHARMAP_H
#define GUCHARMAP_CHARMAP_H
#include <gtk/gtk.h>
#include <gucharmap/chartable.h>
#include <gucharmap/gucharmap-table.h>
G_BEGIN_DECLS
#define CHARMAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), charmap_get_type (), \
Charmap))
#define GUCHARMAP_CHARMAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), gucharmap_charmap_get_type (), \
GucharmapCharmap))
#define CHARMAP_CLASS(clazz) (G_TYPE_CHECK_CLASS_CAST ((clazz), \
charmap_get_type (),\
CharmapClass))
#define GUCHARMAP_CHARMAP_CLASS(clazz) (G_TYPE_CHECK_CLASS_CAST ((clazz), \
gucharmap_charmap_get_type (),\
GucharmapCharmapClass))
#define IS_CHARMAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
charmap_get_type ()))
#define IS_GUCHARMAP_CHARMAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
gucharmap_charmap_get_type ()))
typedef struct _Charmap Charmap;
typedef struct _CharmapClass CharmapClass;
typedef struct _GucharmapCharmap GucharmapCharmap;
typedef struct _GucharmapCharmapClass GucharmapCharmapClass;
typedef enum
{
CHARMAP_NOT_FOUND,
CHARMAP_FOUND,
CHARMAP_WRAPPED,
CHARMAP_NOTHING_TO_SEARCH_FOR
GUCHARMAP_CHARMAP_NOT_FOUND,
GUCHARMAP_CHARMAP_FOUND,
GUCHARMAP_CHARMAP_WRAPPED,
GUCHARMAP_CHARMAP_NOTHING_TO_SEARCH_FOR
}
CharmapSearchResult;
GucharmapCharmapSearchResult;
/* the order of the captions */
typedef enum
{
CHARMAP_CAPTION_CHARACTER = 0,
CHARMAP_CAPTION_CATEGORY,
CHARMAP_CAPTION_DECOMPOSITION,
CHARMAP_CAPTION_UTF8,
CHARMAP_CAPTION_OTHER_REPS,
GUCHARMAP_CHARMAP_CAPTION_CHARACTER = 0,
GUCHARMAP_CHARMAP_CAPTION_CATEGORY,
GUCHARMAP_CHARMAP_CAPTION_DECOMPOSITION,
GUCHARMAP_CHARMAP_CAPTION_UTF8,
GUCHARMAP_CHARMAP_CAPTION_OTHER_REPS,
/* nameslist stuff */
CHARMAP_CAPTION_EQUALS,
CHARMAP_CAPTION_STARS,
CHARMAP_CAPTION_EXES,
CHARMAP_CAPTION_POUNDS,
CHARMAP_CAPTION_COLONS,
GUCHARMAP_CHARMAP_CAPTION_EQUALS,
GUCHARMAP_CHARMAP_CAPTION_STARS,
GUCHARMAP_CHARMAP_CAPTION_EXES,
GUCHARMAP_CHARMAP_CAPTION_POUNDS,
GUCHARMAP_CHARMAP_CAPTION_COLONS,
/* unihan subset */
CHARMAP_CAPTION_KDEFINITION,
CHARMAP_CAPTION_KMANDARIN,
CHARMAP_CAPTION_KJAPANESEON,
CHARMAP_CAPTION_KJAPANESEKUN,
CHARMAP_CAPTION_KCANTONESE,
CHARMAP_CAPTION_KTANG,
CHARMAP_CAPTION_KKOREAN,
CHARMAP_CAPTION_COUNT
GUCHARMAP_CHARMAP_CAPTION_KDEFINITION,
GUCHARMAP_CHARMAP_CAPTION_KMANDARIN,
GUCHARMAP_CHARMAP_CAPTION_KJAPANESEON,
GUCHARMAP_CHARMAP_CAPTION_KJAPANESEKUN,
GUCHARMAP_CHARMAP_CAPTION_KCANTONESE,
GUCHARMAP_CHARMAP_CAPTION_KTANG,
GUCHARMAP_CHARMAP_CAPTION_KKOREAN,
GUCHARMAP_CHARMAP_CAPTION_COUNT
}
CharmapCaption;
GucharmapCharmapCaption;
typedef struct
{
......@@ -86,11 +86,11 @@ typedef struct
}
BlockIndex;
struct _Charmap
struct _GucharmapCharmap
{
GtkVBox parent;
Chartable *chartable;
GucharmapTable *chartable;
/* rows and columns on a page */
gint rows, cols;
......@@ -105,36 +105,36 @@ struct _Charmap
gint block_index_size;
/* the caption */
GtkTreeRowReference *caption_rows[CHARMAP_CAPTION_COUNT];
GtkTreeRowReference *caption_rows[GUCHARMAP_CHARMAP_CAPTION_COUNT];
GtkTreeStore *caption_model;
};
struct _CharmapClass
struct _GucharmapCharmapClass
{
GtkVBoxClass parent_class;
void (* status_message) (Charmap *charmap, const gchar *message);
void (* status_message) (GucharmapCharmap *charmap, const gchar *message);
};
GType charmap_get_type (void);
GtkWidget * charmap_new (void);
void charmap_set_font (Charmap *charmap, const gchar *font_name);
void charmap_identify_clipboard (Charmap *charmap, GtkClipboard *clipboard);
void charmap_expand_block_selector (Charmap *charmap);
void charmap_collapse_block_selector (Charmap *charmap);
void charmap_go_to_character (Charmap *charmap, gunichar uc);
CharmapSearchResult charmap_search (Charmap *charmap,
GType gucharmap_charmap_get_type (void);
GtkWidget * gucharmap_charmap_new (void);
void gucharmap_charmap_set_font (GucharmapCharmap *charmap, const gchar *font_name);
void gucharmap_charmap_identify_clipboard (GucharmapCharmap *charmap, GtkClipboard *clipboard);
void gucharmap_charmap_expand_block_selector (GucharmapCharmap *charmap);
void gucharmap_charmap_collapse_block_selector (GucharmapCharmap *charmap);
void gucharmap_charmap_go_to_character (GucharmapCharmap *charmap, gunichar uc);
GucharmapCharmapSearchResult gucharmap_charmap_search (GucharmapCharmap *charmap,
const gchar *search_text,
gint direction);
void charmap_hide_caption (Charmap *charmap, CharmapCaption caption_id);
void charmap_show_caption (Charmap *charmap, CharmapCaption caption_id);
void charmap_zoom_enable (Charmap *charmap);
void charmap_zoom_disable (Charmap *charmap);
Chartable * charmap_get_chartable (Charmap *charmap);
void gucharmap_charmap_hide_caption (GucharmapCharmap *charmap, GucharmapCharmapCaption caption_id);
void gucharmap_charmap_show_caption (GucharmapCharmap *charmap, GucharmapCharmapCaption caption_id);
void gucharmap_charmap_zoom_enable (GucharmapCharmap *charmap);
void gucharmap_charmap_zoom_disable (GucharmapCharmap *charmap);
GucharmapTable * gucharmap_charmap_get_chartable (GucharmapCharmap *charmap);
G_END_DECLS
#endif /* #ifndef CHARMAP_H */
#endif /* #ifndef GUCHARMAP_CHARMAP_H */
/* $Id$ */
/*
* Copyright (c) 2003 Noah Levitt <nlevitt@users.sourceforge.net>
* Copyright (c) 2003 Noah Levitt
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
......@@ -17,10 +17,14 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include "mini_fontsel.h"
#include <gucharmap/gucharmap-mini-fontsel.h>
#include "gucharmap_intl.h"
#include "gucharmap_marshal.h"
......@@ -37,7 +41,7 @@ enum
NUM_SIGNALS
};
static guint mini_font_selection_signals [NUM_SIGNALS] = { 0 };
static guint gucharmap_mini_font_selection_signals[NUM_SIGNALS] = { 0 };
/* looks up PangoFontFamily by family name, since no such function is in
......@@ -57,7 +61,7 @@ cmp_families (const void *a, const void *b)
/* also initializes the hash table pango_font_families */
static void
show_available_fonts (MiniFontSelection *fontsel)
show_available_fonts (GucharmapMiniFontSelection *fontsel)
{
PangoFontFamily **families;
GList *family_names = NULL;
......@@ -141,10 +145,10 @@ faces_sort_func (const void *a, const void *b)
/* This fills the font style list with all the possible style combinations
for the current font family.
Also creates fontsel->available_faces. */
* for the current font family.
* Also creates fontsel->available_faces. */
static void
show_available_styles (MiniFontSelection *fontsel)
show_available_styles (GucharmapMiniFontSelection *fontsel)
{
PangoFontFace **faces;
PangoFontFamily *family;
......@@ -181,18 +185,20 @@ show_available_styles (MiniFontSelection *fontsel)
static void
set_family (MiniFontSelection *fontsel, const gchar *new_family)
set_family (GucharmapMiniFontSelection *fontsel,
const gchar *new_family)
{
pango_font_description_set_family (fontsel->font_desc, new_family);
show_available_styles (fontsel);
g_signal_emit (fontsel, mini_font_selection_signals[CHANGED], 0);
g_signal_emit (fontsel, gucharmap_mini_font_selection_signals[CHANGED], 0);
}
static void
family_changed (GtkWidget *widget, MiniFontSelection *fontsel)
family_changed (GtkWidget *widget,
GucharmapMiniFontSelection *fontsel)
{
const gchar *new_family;
......@@ -207,7 +213,8 @@ family_changed (GtkWidget *widget, MiniFontSelection *fontsel)
static void
set_style (MiniFontSelection *fontsel, const gchar *new_style)
set_style (GucharmapMiniFontSelection *fontsel,
const gchar *new_style)
{
PangoFontFace *face;
gint size;
......@@ -221,12 +228,13 @@ set_style (MiniFontSelection *fontsel, const gchar *new_style)
fontsel->font_desc = pango_font_face_describe (face);
pango_font_description_set_size (fontsel->font_desc, size);
g_signal_emit (fontsel, mini_font_selection_signals[CHANGED], 0);
g_signal_emit (fontsel, gucharmap_mini_font_selection_signals[CHANGED], 0);
}
static void
style_changed (GtkWidget *widget, MiniFontSelection *fontsel)
style_changed (GtkWidget *widget,
GucharmapMiniFontSelection *fontsel)
{
const gchar *new_style;
......@@ -242,17 +250,19 @@ style_changed (GtkWidget *widget, MiniFontSelection *fontsel)
/* size is in points */
static void
set_size (MiniFontSelection *fontsel, gint size)
set_size (GucharmapMiniFontSelection *fontsel,
gint size)
{
pango_font_description_set_size (
fontsel->font_desc,
PANGO_SCALE * CLAMP (size, MIN_FONT_SIZE, MAX_FONT_SIZE));
g_signal_emit (fontsel, mini_font_selection_signals[CHANGED], 0);
g_signal_emit (fontsel, gucharmap_mini_font_selection_signals[CHANGED], 0);
}
static void
size_changed (GtkAdjustment *adjustment, MiniFontSelection *fontsel)
size_changed (GtkAdjustment *adjustment,
GucharmapMiniFontSelection *fontsel)
{
if ((gint) gtk_adjustment_get_value (adjustment)
!= pango_font_description_get_size (fontsel->font_desc))
......@@ -264,7 +274,7 @@ static void
realize (GtkWidget *widget)
{
AtkObject *accessib;
MiniFontSelection *fontsel = MINI_FONT_SELECTION (widget);
GucharmapMiniFontSelection *fontsel = GUCHARMAP_MINI_FONT_SELECTION (widget);
accessib = gtk_widget_get_accessible (GTK_WIDGET (fontsel));
atk_object_set_name (accessib, _("Font"));
......@@ -318,21 +328,21 @@ realize (GtkWidget *widget)
void
mini_font_selection_class_init (MiniFontSelectionClass *clazz)
gucharmap_mini_font_selection_class_init (GucharmapMiniFontSelectionClass *clazz)
{
clazz->changed = NULL;
mini_font_selection_signals[CHANGED] =
g_signal_new ("changed", mini_font_selection_get_type (),
gucharmap_mini_font_selection_signals[CHANGED] =
g_signal_new ("changed", gucharmap_mini_font_selection_get_type (),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (MiniFontSelectionClass, changed),
G_STRUCT_OFFSET (GucharmapMiniFontSelectionClass, changed),
NULL, NULL, gucharmap_marshal_VOID__VOID,
G_TYPE_NONE, 0);
}
void
mini_font_selection_init (MiniFontSelection *fontsel)
gucharmap_mini_font_selection_init (GucharmapMiniFontSelection *fontsel)
{
fontsel->available_faces = NULL;
fontsel->realized = FALSE;
......@@ -356,44 +366,44 @@ mini_font_selection_init (MiniFontSelection *fontsel)
GtkWidget *
mini_font_selection_new ()
gucharmap_mini_font_selection_new ()
{
return GTK_WIDGET (g_object_new (mini_font_selection_get_type (), NULL));
return GTK_WIDGET (g_object_new (gucharmap_mini_font_selection_get_type (), NULL));
}
GType
mini_font_selection_get_type ()
gucharmap_mini_font_selection_get_type ()
{
static GType mini_font_selection_type = 0;
static GType gucharmap_mini_font_selection_type = 0;
if (mini_font_selection_type == 0)
if (gucharmap_mini_font_selection_type == 0)
{
static const GTypeInfo mini_font_selection_info =
static const GTypeInfo gucharmap_mini_font_selection_info =
{
sizeof (MiniFontSelectionClass),
sizeof (GucharmapMiniFontSelectionClass),
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) mini_font_selection_class_init,
(GClassInitFunc) gucharmap_mini_font_selection_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (MiniFontSelection),
sizeof (GucharmapMiniFontSelection),
0, /* n_preallocs */
(GInstanceInitFunc) mini_font_selection_init
(GInstanceInitFunc) gucharmap_mini_font_selection_init
};
mini_font_selection_type = g_type_register_static (
GTK_TYPE_HBOX, "MiniFontSelection",
&mini_font_selection_info, 0);
gucharmap_mini_font_selection_type = g_type_register_static (
GTK_TYPE_HBOX, "GucharmapMiniFontSelection",
&gucharmap_mini_font_selection_info, 0);
}
return mini_font_selection_type;
return gucharmap_mini_font_selection_type;
}
/* XXX: should do error checking */
gboolean
mini_font_selection_set_font_name (MiniFontSelection *fontsel,
gucharmap_mini_font_selection_set_font_name (GucharmapMiniFontSelection *fontsel,
const gchar *fontname)
{
pango_font_description_free (fontsel->font_desc);
......@@ -413,7 +423,7 @@ mini_font_selection_set_font_name (MiniFontSelection *fontsel,
GTK_ADJUSTMENT (fontsel->size_adj),
pango_font_description_get_size (fontsel->font_desc) / PANGO_SCALE);
g_signal_emit (fontsel, mini_font_selection_signals[CHANGED], 0);
g_signal_emit (fontsel, gucharmap_mini_font_selection_signals[CHANGED], 0);