Commit 790ca4cf authored by Noah Levitt's avatar Noah Levitt

Some code formatting cleanup.

parent ae88d915
......@@ -29,12 +29,18 @@
#include "charcell_accessible.h"
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);
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;
......
......@@ -27,19 +27,11 @@
G_BEGIN_DECLS
#define CHARCELL_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
charcell_accessible_get_type (), \
CharcellAccessible))
#define CHARCELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
charcell_accessible_get_type (), \
CharcellAccessibleClass))
#define IS_CHARCELL_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
charcell_accessible_get_type ()))
#define IS_CHARCELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),\
charcell_accessible_get_type ()))
#define CHARCELL_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
charcell_accessible_get_type, \
CharcellAccessibleClass))
#define CHARCELL_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), charcell_accessible_get_type (), CharcellAccessible))
#define CHARCELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), charcell_accessible_get_type (), CharcellAccessibleClass))
#define IS_CHARCELL_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), charcell_accessible_get_type ()))
#define IS_CHARCELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), charcell_accessible_get_type ()))
#define CHARCELL_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), charcell_accessible_get_type, CharcellAccessibleClass))
typedef struct _CharcellAccessible CharcellAccessible;
......
......@@ -30,9 +30,12 @@
#include "charcell_accessible.h"
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_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
......
......@@ -27,19 +27,11 @@
G_BEGIN_DECLS
#define CHARTABLE_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
chartable_accessible_get_type (), \
ChartableAccessible))
#define CHARTABLE_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
chartable_accessible_get_type (), \
ChartableAccessibleClass))
#define IS_CHARTABLE_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
chartable_accessible_get_type ()))
#define IS_CHARTABLE_ACCESSIBLE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), chartable_accessible_get_type ()))
#define CHARTABLE_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),\
chartable_accessible_get_type (),\
ChartableAccessibleClass))
#define CHARTABLE_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), chartable_accessible_get_type (), ChartableAccessible))
#define CHARTABLE_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), chartable_accessible_get_type (), ChartableAccessibleClass))
#define IS_CHARTABLE_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), chartable_accessible_get_type ()))
#define IS_CHARTABLE_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), chartable_accessible_get_type ()))
#define CHARTABLE_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), chartable_accessible_get_type (), ChartableAccessibleClass))
typedef struct _ChartableAccessible ChartableAccessible;
......
This diff is collapsed.
......@@ -27,57 +27,58 @@
G_BEGIN_DECLS
#define GUCHARMAP_CHARMAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), gucharmap_charmap_get_type (), \
GucharmapCharmap))
#define GUCHARMAP_CHARMAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
gucharmap_charmap_get_type (), \
GucharmapCharmap))
#define GUCHARMAP_CHARMAP_CLASS(clazz) (G_TYPE_CHECK_CLASS_CAST ((clazz), \
gucharmap_charmap_get_type (),\
GucharmapCharmapClass))
gucharmap_charmap_get_type (),\
GucharmapCharmapClass))
#define IS_GUCHARMAP_CHARMAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
gucharmap_charmap_get_type ()))
gucharmap_charmap_get_type ()))
typedef struct _GucharmapCharmap GucharmapCharmap;
typedef struct _GucharmapCharmapClass GucharmapCharmapClass;
typedef enum
{
GUCHARMAP_CHARMAP_NOT_FOUND,
GUCHARMAP_CHARMAP_FOUND,
GUCHARMAP_CHARMAP_WRAPPED,
GUCHARMAP_CHARMAP_NOTHING_TO_SEARCH_FOR
GUCHARMAP_NOT_FOUND,
GUCHARMAP_FOUND,
GUCHARMAP_WRAPPED,
GUCHARMAP_NOTHING_TO_SEARCH_FOR
}
GucharmapCharmapSearchResult;
GucharmapSearchResult;
/* the order of the captions */
typedef enum
{
GUCHARMAP_CHARMAP_CAPTION_CHARACTER = 0,
GUCHARMAP_CHARMAP_CAPTION_CATEGORY,
GUCHARMAP_CHARMAP_CAPTION_DECOMPOSITION,
GUCHARMAP_CHARMAP_CAPTION_UTF8,
GUCHARMAP_CHARMAP_CAPTION_OTHER_REPS,
GUCHARMAP_CAPTION_CHARACTER = 0,
GUCHARMAP_CAPTION_CATEGORY,
GUCHARMAP_CAPTION_DECOMPOSITION,
GUCHARMAP_CAPTION_UTF8,
GUCHARMAP_CAPTION_OTHER_REPS,
/* nameslist stuff */
GUCHARMAP_CHARMAP_CAPTION_EQUALS,
GUCHARMAP_CHARMAP_CAPTION_STARS,
GUCHARMAP_CHARMAP_CAPTION_EXES,
GUCHARMAP_CHARMAP_CAPTION_POUNDS,
GUCHARMAP_CHARMAP_CAPTION_COLONS,
GUCHARMAP_CAPTION_EQUALS,
GUCHARMAP_CAPTION_STARS,
GUCHARMAP_CAPTION_EXES,
GUCHARMAP_CAPTION_POUNDS,
GUCHARMAP_CAPTION_COLONS,
/* unihan subset */
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
GUCHARMAP_CAPTION_KDEFINITION,
GUCHARMAP_CAPTION_KMANDARIN,
GUCHARMAP_CAPTION_KJAPANESEON,
GUCHARMAP_CAPTION_KJAPANESEKUN,
GUCHARMAP_CAPTION_KCANTONESE,
GUCHARMAP_CAPTION_KTANG,
GUCHARMAP_CAPTION_KKOREAN,
GUCHARMAP_CAPTION_COUNT
}
GucharmapCharmapCaption;
GucharmapCaption;
typedef struct
{
......@@ -105,7 +106,7 @@ struct _GucharmapCharmap
gint block_index_size;
/* the caption */
GtkTreeRowReference *caption_rows[GUCHARMAP_CHARMAP_CAPTION_COUNT];
GtkTreeRowReference *caption_rows[GUCHARMAP_CAPTION_COUNT];
GtkTreeStore *caption_model;
};
......@@ -120,16 +121,21 @@ struct _GucharmapCharmapClass
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_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 gucharmap_charmap_hide_caption (GucharmapCharmap *charmap, GucharmapCharmapCaption caption_id);
void gucharmap_charmap_show_caption (GucharmapCharmap *charmap, GucharmapCharmapCaption caption_id);
void gucharmap_charmap_go_to_character (GucharmapCharmap *charmap,
gunichar uc);
GucharmapSearchResult gucharmap_charmap_search (GucharmapCharmap *charmap,
const gchar *search_text,
gint direction);
void gucharmap_charmap_hide_caption (GucharmapCharmap *charmap,
GucharmapCaption caption_id);
void gucharmap_charmap_show_caption (GucharmapCharmap *charmap,
GucharmapCaption caption_id);
void gucharmap_charmap_zoom_enable (GucharmapCharmap *charmap);
void gucharmap_charmap_zoom_disable (GucharmapCharmap *charmap);
GucharmapTable * gucharmap_charmap_get_chartable (GucharmapCharmap *charmap);
......
......@@ -404,7 +404,7 @@ gucharmap_mini_font_selection_get_type ()
/* XXX: should do error checking */
gboolean
gucharmap_mini_font_selection_set_font_name (GucharmapMiniFontSelection *fontsel,
const gchar *fontname)
const gchar *fontname)
{
pango_font_description_free (fontsel->font_desc);
......@@ -447,9 +447,11 @@ gucharmap_mini_font_selection_get_font_size (GucharmapMiniFontSelection *fontsel
/* size in points */
void
gucharmap_mini_font_selection_set_font_size (GucharmapMiniFontSelection *fontsel, gint size)
gucharmap_mini_font_selection_set_font_size (GucharmapMiniFontSelection *fontsel,
gint size)
{
gtk_adjustment_set_value (GTK_ADJUSTMENT (fontsel->size_adj), size);
set_size (fontsel, size);
}
......@@ -28,12 +28,9 @@ G_BEGIN_DECLS
#define GUCHARMAP_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
gucharmap_table_get_type (), GucharmapTable))
#define GUCHARMAP_TABLE_CLASS(clazz) (G_TYPE_CHECK_CLASS_CAST ((clazz), \
gucharmap_table_get_type (),\
GucharmapTableClass))
#define GUCHARMAP_TABLE_CLASS(clazz) (G_TYPE_CHECK_CLASS_CAST ((clazz), gucharmap_table_get_type (), GucharmapTableClass))
#define IS_GUCHARMAP_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
gucharmap_table_get_type ()))
#define IS_GUCHARMAP_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), gucharmap_table_get_type ()))
typedef struct _GucharmapTable GucharmapTable;
......
......@@ -279,7 +279,8 @@ hangul_decomposition (gunichar s, gsize *result_len)
* @result_len is set to the resulting length of the string.
*/
gunichar *
gucharmap_unicode_canonical_decomposition (gunichar ch, gsize *result_len)
gucharmap_unicode_canonical_decomposition (gunichar ch,
gsize *result_len)
{
if (ch >= 0xac00 && ch <= 0xd7af) /* Hangul syllable */
return hangul_decomposition (ch, result_len);
......
......@@ -58,12 +58,13 @@ G_CONST_RETURN gchar * gucharmap_get_unicode_kJapaneseKun (gunichar uc);
G_CONST_RETURN gchar * gucharmap_get_unicode_kJapaneseOn (gunichar uc);
G_CONST_RETURN gchar * gucharmap_get_hangul_syllable_name (gunichar s);
/* A wrapper for g_ unicode_canonical_decomposition that also does hangul
/* A wrapper for g_unicode_canonical_decomposition that also does hangul
* decomposition.
* See http://bugzilla.gnome.org/show_bug.cgi?id=100456
* Will no longer be necessary once my patch is accepted.
*/
gunichar * gucharmap_unicode_canonical_decomposition (gunichar ch, gsize *result_len);
gunichar * gucharmap_unicode_canonical_decomposition (gunichar ch,
gsize *result_len);
/* starts search at start */
gunichar gucharmap_find_substring_match (gunichar start,
......
This diff is collapsed.
......@@ -47,7 +47,7 @@ struct _GucharmapWindow
{
GtkWindow parent;
GucharmapCharmap *charmap; /* XXX: could use GtkWidget instead of GucharmapCharmap */
GucharmapCharmap *charmap;
GtkWidget *status;
GtkAccelGroup *accel_group;
......@@ -63,8 +63,8 @@ struct _GucharmapWindow
gchar *last_search;
/* caption_show[GUCHARMAP_CHARMAP_CAPTION_CHARACTER] is ignored; it is always shown */
gboolean caption_show[GUCHARMAP_CHARMAP_CAPTION_COUNT];
/* caption_show[GUCHARMAP_CAPTION_CHARACTER] is ignored; it is always shown */
gboolean caption_show[GUCHARMAP_CAPTION_COUNT];
gboolean font_selection_visible;
gboolean text_to_copy_visible;
......
......@@ -98,18 +98,14 @@ main (gint argc, gchar **argv)
/* make the starting font 50% bigger than the default font */
if (new_font == NULL) /* new_font could be set by command line option */
{
orig_font = gucharmap_mini_font_selection_get_font_name (
GUCHARMAP_MINI_FONT_SELECTION (GUCHARMAP_WINDOW (window)->fontsel));
orig_font = gucharmap_mini_font_selection_get_font_name (GUCHARMAP_MINI_FONT_SELECTION (GUCHARMAP_WINDOW (window)->fontsel));
font_desc = pango_font_description_from_string (orig_font);
pango_font_description_set_size (
font_desc,
pango_font_description_get_size (font_desc) * 3/2 / PANGO_SCALE * PANGO_SCALE);
pango_font_description_set_size (font_desc, pango_font_description_get_size (font_desc) * 3/2 / PANGO_SCALE * PANGO_SCALE);
new_font = pango_font_description_to_string (font_desc);
}
/* this sends the changed signal: */
gucharmap_mini_font_selection_set_font_name (
GUCHARMAP_MINI_FONT_SELECTION (GUCHARMAP_WINDOW (window)->fontsel), new_font);
gucharmap_mini_font_selection_set_font_name (GUCHARMAP_MINI_FONT_SELECTION (GUCHARMAP_WINDOW (window)->fontsel), new_font);
g_signal_connect (G_OBJECT (window), "destroy",
G_CALLBACK (gtk_main_quit), NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment