Commit 8d99efac authored by Christian Persch's avatar Christian Persch Committed by Christian Persch

Bump version after branching.

2007-12-03  Christian Persch  <chpe@gnome.org>

	* configure.ac: Bump version after branching.

	* Makefile.am:
	* gucharmap.pc.in:
	* gucharmap/Makefile.am:
	* gucharmap/gucharmap-block-chapters.c: (selection_changed),
	(gucharmap_block_chapters_settings_init),
	(gucharmap_block_chapters_init):
	* gucharmap/gucharmap-chapters.c: (gucharmap_chapter_get_string),
	(gucharmap_chapter_set_string):
	* gucharmap/gucharmap-chapters.h:
	* gucharmap/gucharmap-charmap.c: (gucharmap_active_char_save),
	(active_char_set), (gucharmap_charmap_new):
	* gucharmap/gucharmap-script-chapters.c: (selection_changed),
	(gucharmap_script_chapters_settings_init),
	(gucharmap_script_chapters_init):
	* gucharmap/gucharmap-table.c: (draw_chartable_from_scratch):
	* gucharmap/gucharmap-window.c: (snap_cols_pow2), (make_menu),
	(fontsel_changed), (gucharmap_window_state_changed),
	(gucharmap_window_size_changed), (gucharmap_window_init):
	* gucharmap/main.c: (main): Remember the settings. Bug #140414,
	patch by Jason Allen and Jared Moore.

svn path=/trunk/; revision=1376
parent 746561bd
2007-12-03 Christian Persch <chpe@gnome.org>
* configure.ac: Bump version after branching.
* Makefile.am:
* gucharmap.pc.in:
* gucharmap/Makefile.am:
* gucharmap/gucharmap-block-chapters.c: (selection_changed),
(gucharmap_block_chapters_settings_init),
(gucharmap_block_chapters_init):
* gucharmap/gucharmap-chapters.c: (gucharmap_chapter_get_string),
(gucharmap_chapter_set_string):
* gucharmap/gucharmap-chapters.h:
* gucharmap/gucharmap-charmap.c: (gucharmap_active_char_save),
(active_char_set), (gucharmap_charmap_new):
* gucharmap/gucharmap-script-chapters.c: (selection_changed),
(gucharmap_script_chapters_settings_init),
(gucharmap_script_chapters_init):
* gucharmap/gucharmap-table.c: (draw_chartable_from_scratch):
* gucharmap/gucharmap-window.c: (snap_cols_pow2), (make_menu),
(fontsel_changed), (gucharmap_window_state_changed),
(gucharmap_window_size_changed), (gucharmap_window_init):
* gucharmap/main.c: (main): Remember the settings. Bug #140414,
patch by Jason Allen and Jared Moore.
2007-10-24 Changwoo Ryu <cwryu@debian.org>
* configure.ac: Korean manual translation migrated to
......
......@@ -32,11 +32,16 @@ desktop_in_files = gucharmap.desktop.in
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
@INTLTOOL_DESKTOP_RULE@
schemadir = $(GCONF_SCHEMA_FILE_DIR)
schema_in_files = gucharmap.schemas.in
schema_DATA = $(schema_in_files:.schemas.in=.schemas)
@INTLTOOL_SCHEMAS_RULE@
EXTRA_DIST = gtkrc.win32 gucharmap.nsi.in gucharmap.pc.in \
intltool-extract.in intltool-merge.in intltool-update.in \
gnome-doc-utils.make \
gucharmap.desktop.in gucharmap.spec.in $(desktop_DATA) \
COPYING.UNICODE
$(schema_in_files) COPYING.UNICODE
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = gucharmap.pc
......@@ -47,4 +52,14 @@ DISTCLEANFILES = \
gnome-doc-utils.make \
intltool-update \
intltool-extract \
intltool-merge
intltool-merge \
$(schema_DATA)
if GCONF_SCHEMAS_INSTALL
install-data-local:
if test -z "$(DESTDIR)" ; then \
GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(top_builddir)/$(schema_DATA); \
fi
else
install-data-local:
endif
......@@ -19,7 +19,7 @@ dnl
AC_PREREQ([2.56])
AC_INIT([GNOME Character Map],[1.10.1],[http://bugzilla.gnome.org/enter_bug.cgi?product=gucharmap],[gucharmap])
AC_INIT([GNOME Character Map],[2.21.1],[http://bugzilla.gnome.org/enter_bug.cgi?product=gucharmap],[gucharmap])
AC_CONFIG_SRCDIR([gucharmap/gucharmap.h])
AC_CONFIG_HEADERS([config.h])
......@@ -74,13 +74,27 @@ AC_ARG_ENABLE(gnome,
AC_HELP_STRING([--disable-gnome],
[don't build with GNOME support]))
if test "x$enable_gnome" != "xno"; then
PKG_CHECK_MODULES(GNOME, libgnomeui-2.0 >= 2.13.2 libgnome-2.0 >= 2.13.7,
have_gnome=yes, have_gnome=no)
PKG_CHECK_MODULES(GNOME, libgnomeui-2.0 >= 2.13.2 libgnome-2.0 >= 2.13.7,
have_gnome=yes, have_gnome=no)
else
AC_MSG_NOTICE([GNOME support disabled with --disable-gnome])
have_gnome=no
fi
AC_ARG_ENABLE(gconf,
AC_HELP_STRING([--disable-gconf],
[don't build with gconf support]))
if test "x$enable_gconf" != "xno"; then
PKG_CHECK_MODULES(GCONF, gconf-2.0,
have_gconf=yes, have_gconf=no)
else
AC_MSG_NOTICE([GCONF support disabled with --disable-gconf])
have_gconf=no
fi
AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
AM_GCONF_SOURCE_2
GNOMEPKGS=""
if test "x$have_gnome" = "xyes"
then
......@@ -88,6 +102,13 @@ then
fi
AC_SUBST(GNOMEPKGS)
GCONFPKGS=""
if test "x$have_gconf" = "yes"
then
GCONFPKGS="gconf-2.0"
fi
AC_SUBST(GCONFPKGS)
# checks for funcs
AC_CHECK_FUNCS([bind_textdomain_codeset])
......@@ -104,6 +125,10 @@ if test "x$have_gnome" = "xyes" ; then
AC_DEFINE([HAVE_GNOME],[1],[Define if have gnome])
fi
if test "x$have_gconf" = "xyes" ; then
AC_DEFINE([HAVE_GCONF], [1], [Define if have gconf])
fi
GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
AC_SUBST(GLIB_GENMARSHAL)
......
......@@ -6,6 +6,6 @@ includedir=@includedir@
Name: gucharmap
Description: GTK+ Unicode Character Map
Version: @VERSION@
Requires: gtk+-2.0 glib-2.0 @GNOMEPKGS@
Requires: gtk+-2.0 glib-2.0 @GNOMEPKGS@ @GCONFPKGS@
Libs: -L${libdir} -lgucharmap
Cflags: -I${includedir}
......@@ -47,7 +47,8 @@ libgucharmap_la_SOURCES = gucharmap-marshal.c gucharmap-marshal.h \
gucharmap-script-chapters.c gucharmap-script-chapters.h \
unicode-blocks.h unicode-categories.h unicode-names.h \
unicode-nameslist.h unicode-scripts.h unicode-unihan.h \
gucharmap-search-dialog.h gucharmap-search-dialog.c
gucharmap-search-dialog.h gucharmap-search-dialog.c \
gucharmap-settings.h gucharmap-settings.c
# this is different from the project version
libgucharmap_la_LDFLAGS = -version-info $(LIBGUCHARMAP_LT_VERSION) -export-symbols-regex "^gucharmap_*"
......@@ -64,7 +65,8 @@ libgucharmapinclude_HEADERS = gucharmap.h \
gucharmap-block-chapters.h \
gucharmap-chapters.h \
gucharmap-script-chapters.h \
gucharmap-search-dialog.h
gucharmap-search-dialog.h \
gucharmap-settings.h
bin_PROGRAMS = gucharmap
gucharmap_SOURCES = main.c
......
......@@ -20,6 +20,7 @@
#include "config.h"
#include "gucharmap-block-chapters.h"
#include "gucharmap-intl.h"
#include "gucharmap-settings.h"
#include "unicode-blocks.h"
enum
......@@ -35,11 +36,36 @@ selection_changed (GtkTreeSelection *selection,
{
GtkTreeModel *model;
GtkTreeIter iter;
gchar *chapter = NULL;
/* this should always return true */
if (gtk_tree_selection_get_selected (selection, &model, &iter))
/* XXX: parent should have api to do this I guess */
g_signal_emit_by_name (GUCHARMAP_CHAPTERS (chapters), "changed", 0);
chapter = gucharmap_chapter_get_string (GUCHARMAP_CHAPTERS (chapters));
if (chapter)
{
gucharmap_settings_set_chapter (chapter);
g_free (chapter);
}
}
static void
gucharmap_block_chapters_settings_init (GucharmapChapters *chapters)
{
GtkTreeSelection *sel;
gchar *chapter = NULL;
sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (chapters->tree_view));
chapter = gucharmap_settings_get_chapter ();
if (chapter) {
gucharmap_chapter_set_string (chapters, chapter);
g_free (chapter);
}
gucharmap_settings_set_chapters_mode (CHAPTERS_BLOCK);
}
static void
......@@ -88,6 +114,8 @@ gucharmap_block_chapters_init (GucharmapBlockChapters *chapters)
g_signal_connect (G_OBJECT (selection), "changed", G_CALLBACK (selection_changed), chapters);
gucharmap_block_chapters_settings_init (parent);
gtk_container_add (GTK_CONTAINER (chapters), parent->tree_view);
gtk_widget_show (parent->tree_view);
}
......
......@@ -20,6 +20,7 @@
#include "config.h"
#include "gucharmap-chapters.h"
#include "gucharmap-marshal.h"
#include <string.h>
enum
{
......@@ -176,3 +177,64 @@ gucharmap_chapters_previous (GucharmapChapters *chapters)
gtk_tree_path_free (path);
}
}
/**
* gucharmap_chapter_get_string:
* @chapters: a #GucharmapChapters
*
* Returns a newly allocated string containing
* the name of the currently selected chapter
**/
gchar*
gucharmap_chapter_get_string (GucharmapChapters *chapters)
{
GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (chapters->tree_view));
GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (chapters->tree_view));
GtkTreeIter iter;
gchar *name = NULL;
if (gtk_tree_selection_get_selected (selection, NULL, &iter))
gtk_tree_model_get(model, &iter, 0, &name, -1);
return name;
}
/**
* gucharmap_chapter_get_string:
* @chapters: a #GucharmapChapters
* @name: Unicode block name
*
* Sets the selection to the row specified by @name
* Return value: %TRUE on success, %FALSE on failure
**/
gboolean
gucharmap_chapter_set_string (GucharmapChapters *chapters,
const char *name)
{
GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (chapters->tree_view));
GtkTreeIter iter;
gboolean match;
gchar *str;
if (name == NULL)
return FALSE;
if (gtk_tree_model_get_iter_first (model, &iter)) {
do {
gtk_tree_model_get(model, &iter, 0, &str, -1);
match = strcmp (name, str);
g_free(str);
if (0 == match) {
GtkTreePath *path = gtk_tree_model_get_path (chapters->tree_model, &iter);
gtk_tree_view_set_cursor (GTK_TREE_VIEW (chapters->tree_view),
path, NULL, FALSE);
gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (chapters->tree_view),
path, NULL, FALSE, 0, 0);
gtk_tree_path_free (path);
return TRUE;
}
} while (gtk_tree_model_iter_next (model, &iter));
}
return FALSE;
}
......@@ -40,6 +40,13 @@ G_BEGIN_DECLS
typedef struct _GucharmapChapters GucharmapChapters;
typedef struct _GucharmapChaptersClass GucharmapChaptersClass;
typedef enum
{
CHAPTERS_SCRIPT,
CHAPTERS_BLOCK
}
ChaptersMode;
struct _GucharmapChapters
{
GtkScrolledWindow parent;
......@@ -69,6 +76,9 @@ gboolean gucharmap_chapters_go_to_character
void gucharmap_chapters_next (GucharmapChapters *chapters);
void gucharmap_chapters_previous (GucharmapChapters *chapters);
gchar * gucharmap_chapter_get_string (GucharmapChapters *chapters);
gboolean gucharmap_chapter_set_string (GucharmapChapters *chapters,
const gchar *name);
G_END_DECLS
#endif /* #ifndef GUCHARMAP_CHAPTERS_H */
......@@ -29,6 +29,7 @@
#include "gucharmap-script-chapters.h"
#include "gucharmap-intl.h"
#include "gucharmap-marshal.h"
#include "gucharmap-settings.h"
#include "chartable_accessible.h"
gboolean _gucharmap_unicode_has_nameslist_entry (gunichar uc);
......@@ -481,6 +482,13 @@ set_details (GucharmapCharmap *charmap,
#endif /* #if ENABLE_UNIHAN */
}
static gboolean
gucharmap_active_char_save (gpointer last_char)
{
gucharmap_settings_set_last_char (GPOINTER_TO_UINT (last_char));
return FALSE;
}
static void
active_char_set (GtkWidget *widget,
gunichar wc,
......@@ -493,6 +501,8 @@ active_char_set (GtkWidget *widget,
set_details (charmap, wc);
g_idle_add (gucharmap_active_char_save, GUINT_TO_POINTER(wc));
gs = g_string_new (NULL);
g_string_append_printf (gs, "U+%4.4X %s", wc,
gucharmap_get_unicode_name (wc));
......@@ -802,6 +812,7 @@ gucharmap_charmap_new (GucharmapChapters *chapters)
{
GucharmapCharmap *charmap = g_object_new (gucharmap_charmap_get_type (), NULL);
GtkWidget *pane2;
gunichar last_char;
charmap->hand_cursor = gdk_cursor_new (GDK_HAND2);
charmap->regular_cursor = gdk_cursor_new (GDK_XTERM);
......@@ -816,6 +827,11 @@ gucharmap_charmap_new (GucharmapChapters *chapters)
set_details (charmap, gucharmap_table_get_active_character (charmap->chartable));
last_char = gucharmap_settings_get_last_char ();
/* not validating characters allows restoration of unassigned characters */
if (last_char < UNICHAR_MAX && last_char > 0)
gucharmap_charmap_go_to_character (charmap, last_char);
return GTK_WIDGET (charmap);
}
......
......@@ -26,6 +26,7 @@
#include "gucharmap-script-chapters.h"
#include "gucharmap-script-codepoint-list.h"
#include "gucharmap-chapters.h"
#include "gucharmap-settings.h"
enum
{
......@@ -40,11 +41,34 @@ selection_changed (GtkTreeSelection *selection,
{
GtkTreeModel *model;
GtkTreeIter iter;
gchar *chapter = NULL;
/* this should always return true */
if (gtk_tree_selection_get_selected (selection, &model, &iter))
/* XXX: parent should have api to do this I guess */
g_signal_emit_by_name (GUCHARMAP_CHAPTERS (chapters), "changed", 0);
if ((chapter = gucharmap_chapter_get_string (GUCHARMAP_CHAPTERS (chapters))))
{
gucharmap_settings_set_chapter (chapter);
g_free (chapter);
}
}
static void
gucharmap_script_chapters_settings_init (GucharmapChapters *chapters)
{
GtkTreeSelection *sel;
gchar *chapter = NULL;
sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (chapters->tree_view));
chapter = gucharmap_settings_get_chapter ();
if (chapter)
gucharmap_chapter_set_string (chapters, chapter);
g_free (chapter);
gucharmap_settings_set_chapters_mode (CHAPTERS_SCRIPT);
}
static gunichar
......@@ -153,6 +177,8 @@ gucharmap_script_chapters_init (GucharmapScriptChapters *chapters)
queue_select_default_script (chapters);
gucharmap_script_chapters_settings_init (parent);
gtk_container_add (GTK_CONTAINER (chapters), parent->tree_view);
gtk_widget_show (parent->tree_view);
}
......
......@@ -747,6 +747,11 @@ draw_chartable_from_scratch (GucharmapTable *chartable)
{
gint row, col;
/* drawing area may not be exposed yet when restoring last char setting
*/
if (!GTK_WIDGET_REALIZED (chartable))
return;
if (chartable->pixmap == NULL)
chartable->pixmap = gdk_pixmap_new (
chartable->drawing_area->window,
......
......@@ -33,6 +33,7 @@
#include "gucharmap-block-chapters.h"
#include "gucharmap-intl.h"
#include "gucharmap-search-dialog.h"
#include "gucharmap-settings.h"
#ifndef ICON_PATH
# define ICON_PATH ""
......@@ -41,13 +42,6 @@
#define GUCHARMAP_WINDOW_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), gucharmap_window_get_type (), GucharmapWindowPrivate))
typedef enum
{
CHAPTERS_SCRIPT,
CHAPTERS_BLOCK
}
ChaptersMode;
typedef struct _GucharmapWindowPrivate GucharmapWindowPrivate;
struct _GucharmapWindowPrivate
......@@ -72,6 +66,9 @@ struct _GucharmapWindowPrivate
gboolean file_menu_visible;
ChaptersMode chapters_mode;
gboolean is_maximized;
gboolean is_fullscreen;
};
GdkCursor * _gucharmap_window_progress_cursor (void);
......@@ -290,17 +287,18 @@ font_default (GtkAction *action,
}
static void
snap_cols_pow2 (GtkAction *action,
snap_cols_pow2 (GtkAction *action,
GucharmapWindow *guw)
{
gucharmap_table_set_snap_pow2 (guw->charmap->chartable,
gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)));
gboolean is_active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
gucharmap_table_set_snap_pow2 (guw->charmap->chartable, is_active);
gucharmap_settings_set_snap_pow2 (is_active);
}
#ifdef HAVE_GNOME
static void
help_contents (GtkAction *action,
gpointer data)
gpointer data)
{
GError *error = NULL;
......@@ -612,12 +610,14 @@ make_menu (GucharmapWindow *guw)
gtk_action_group_add_radio_actions (priv->action_group,
radio_menu_entries,
G_N_ELEMENTS (radio_menu_entries),
VIEW_BY_SCRIPT,
gucharmap_settings_get_chapters_mode(),
G_CALLBACK (view_by),
guw);
gtk_action_group_add_action (priv->action_group,
GTK_ACTION (toggle_menu));
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (toggle_menu),
gucharmap_settings_get_snap_pow2 ());
switch (priv->chapters_mode)
{
case CHAPTERS_SCRIPT:
......@@ -665,6 +665,7 @@ fontsel_changed (GucharmapMiniFontSelection *fontsel,
gchar *font_name = gucharmap_mini_font_selection_get_font_name (fontsel);
gucharmap_table_set_font (guw->charmap->chartable, font_name);
gucharmap_settings_set_font (font_name);
g_free (font_name);
}
......@@ -760,6 +761,35 @@ status_realize (GtkWidget *status,
gtk_widget_set_size_request (priv->status, -1, priv->status->allocation.height + 9);
}
static void
gucharmap_window_state_changed (GtkWidget *widget,
GdkEventWindowState *event,
GucharmapWindow *guw)
{
gboolean maximized, fullscreen;
if (event->changed_mask & GDK_WINDOW_STATE_MAXIMIZED) {
maximized = (event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED) != 0;
GUCHARMAP_WINDOW_GET_PRIVATE (guw)->is_maximized = maximized;
gucharmap_settings_set_window_maximized (maximized);
}
if (event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN) {
fullscreen = (event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN) != 0;
GUCHARMAP_WINDOW_GET_PRIVATE (guw)->is_fullscreen = fullscreen;
}
}
static void
gucharmap_window_size_changed (GtkWidget *widget,
GtkAllocation *event,
GucharmapWindow *guw)
{
GucharmapWindowPrivate *priv = GUCHARMAP_WINDOW_GET_PRIVATE (guw);
if (!priv->is_maximized && !priv->is_fullscreen) {
gucharmap_settings_set_window_width (event->width);
gucharmap_settings_set_window_height (event->height);
}
}
static void
pack_stuff_in_window (GucharmapWindow *guw)
{
......@@ -839,13 +869,16 @@ gucharmap_window_init (GucharmapWindow *guw)
priv->font_selection_visible = FALSE;
priv->text_to_copy_visible = FALSE;
priv->file_menu_visible = FALSE;
priv->chapters_mode = CHAPTERS_SCRIPT;
priv->chapters_mode = gucharmap_settings_get_chapters_mode ();
priv->search_dialog = NULL;
gtk_window_set_icon_name (GTK_WINDOW (guw), "gucharmap");
pack_stuff_in_window (guw);
g_signal_connect (guw, "window-state-event", G_CALLBACK (gucharmap_window_state_changed), guw);
g_signal_connect (guw, "size-allocate", G_CALLBACK (gucharmap_window_size_changed), guw);
}
static void
......
......@@ -27,6 +27,7 @@
#endif
#include "gucharmap-window.h"
#include "gucharmap-mini-fontsel.h"
#include "gucharmap-settings.h"
static gchar *new_font = NULL;
......@@ -44,6 +45,8 @@ main (gint argc, gchar **argv)
GdkScreen *screen;
gint monitor;
GdkRectangle rect;
gint w, h;
gboolean max;
#ifdef HAVE_GNOME
GnomeProgram *program;
GOptionContext *context;
......@@ -74,6 +77,7 @@ main (gint argc, gchar **argv)
}
#endif
gucharmap_settings_initialize ();
g_set_application_name (_("Gucharmap"));
gtk_window_set_default_icon_name ("gucharmap");
......@@ -93,9 +97,36 @@ main (gint argc, gchar **argv)
GucharmapMiniFontSelection *fontsel = gucharmap_window_get_mini_font_selection (GUCHARMAP_WINDOW (window));
gint default_size = PANGO_PIXELS (2.0 * pango_font_description_get_size (window->style->font_desc));
gucharmap_mini_font_selection_set_default_font_size (fontsel, default_size);
gucharmap_mini_font_selection_reset_font_size (fontsel);
new_font = gucharmap_settings_get_font ();
if (new_font)
{
PangoFontDescription *fd = pango_font_description_from_string (new_font);
/* revert to default font size */
if (0 == pango_font_description_get_size (fd))
gucharmap_mini_font_selection_reset_font_size (fontsel);
else
gucharmap_mini_font_selection_set_font_name (fontsel, new_font);
pango_font_description_free (fd);
g_free (new_font);
}
else
gucharmap_mini_font_selection_reset_font_size (fontsel);
}
max = gucharmap_settings_get_window_maximized ();
if (max) {
gtk_window_maximize (GTK_WINDOW (window));
} else {
w = gucharmap_settings_get_window_width ();
h = gucharmap_settings_get_window_height ();
if (w > 0 && h > 0)
gtk_window_resize (GTK_WINDOW (window), w, h);
}
g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (gtk_main_quit), NULL);
gucharmap_table_grab_focus (GUCHARMAP_WINDOW (window)->charmap->chartable);
......@@ -104,6 +135,7 @@ main (gint argc, gchar **argv)
gtk_main ();
gucharmap_settings_shutdown ();
#ifdef HAVE_GNOME
g_object_unref (program);
#endif
......
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