gnome-commander r1763 - in trunk: . src/intviewer
- From: epiotr svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-commander r1763 - in trunk: . src/intviewer
- Date: Thu, 8 May 2008 17:45:18 +0100 (BST)
Author: epiotr
Date: Thu May 8 16:45:18 2008
New Revision: 1763
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=1763&view=rev
Log:
Code cleanup
Modified:
trunk/ChangeLog
trunk/src/intviewer/bm_chartype.cc
trunk/src/intviewer/fileops.cc
trunk/src/intviewer/image-render.cc
trunk/src/intviewer/inputmodes.cc
trunk/src/intviewer/scroll-box.cc
trunk/src/intviewer/search-dlg.cc
trunk/src/intviewer/search-dlg.h
trunk/src/intviewer/search-progress-dlg.cc
trunk/src/intviewer/searcher.cc
trunk/src/intviewer/searcher.h
trunk/src/intviewer/text-render.cc
trunk/src/intviewer/viewer-utils.cc
trunk/src/intviewer/viewer-widget.cc
trunk/src/intviewer/viewer-window.cc
Modified: trunk/src/intviewer/bm_chartype.cc
==============================================================================
--- trunk/src/intviewer/bm_chartype.cc (original)
+++ trunk/src/intviewer/bm_chartype.cc Thu May 8 16:45:18 2008
@@ -46,7 +46,7 @@
static void bch_set_value(GHashTable *bch, int key, int value)
{
- g_hash_table_insert(bch, (gpointer)key, (gpointer)value);
+ g_hash_table_insert(bch, (gpointer) key, (gpointer) value);
}
Modified: trunk/src/intviewer/fileops.cc
==============================================================================
--- trunk/src/intviewer/fileops.cc (original)
+++ trunk/src/intviewer/fileops.cc Thu May 8 16:45:18 2008
@@ -179,7 +179,7 @@
g_return_val_if_fail (_file!=NULL, -1);
g_return_val_if_fail (_file[0]!=0, -1);
- ops->filename = g_strdup(_file);
+ ops->filename = g_strdup (_file);
int fd;
Modified: trunk/src/intviewer/image-render.cc
==============================================================================
--- trunk/src/intviewer/image-render.cc (original)
+++ trunk/src/intviewer/image-render.cc Thu May 8 16:45:18 2008
@@ -257,7 +257,7 @@
w->priv->orig_pixbuf = NULL;
w->priv->disp_pixbuf = NULL;
- GTK_WIDGET_SET_FLAGS(GTK_WIDGET(w), GTK_CAN_FOCUS);
+ GTK_WIDGET_SET_FLAGS(GTK_WIDGET (w), GTK_CAN_FOCUS);
}
@@ -376,11 +376,11 @@
static void image_render_redraw (ImageRender *w)
{
- if (!GTK_WIDGET_REALIZED(GTK_WIDGET(w)))
+ if (!GTK_WIDGET_REALIZED(GTK_WIDGET (w)))
return;
image_render_notify_status_changed (w);
- gdk_window_invalidate_rect (GTK_WIDGET(w)->window, NULL, FALSE);
+ gdk_window_invalidate_rect (GTK_WIDGET (w)->window, NULL, FALSE);
}
@@ -726,7 +726,7 @@
g_atomic_int_inc (&obj->priv->orig_pixbuf_loaded);
- g_object_unref (G_OBJECT(obj));
+ g_object_unref (G_OBJECT (obj));
return NULL;
}
@@ -763,10 +763,10 @@
g_return_if_fail (obj->priv->filename!=NULL);
g_return_if_fail (obj->priv->scaled_pixbuf_loaded==FALSE);
- g_return_if_fail (GTK_WIDGET_REALIZED(GTK_WIDGET(obj)));
+ g_return_if_fail (GTK_WIDGET_REALIZED(GTK_WIDGET (obj)));
- int width = GTK_WIDGET(obj)->allocation.width;
- int height = GTK_WIDGET(obj)->allocation.height;
+ int width = GTK_WIDGET (obj)->allocation.width;
+ int height = GTK_WIDGET (obj)->allocation.height;
GError *err = NULL;
@@ -798,7 +798,7 @@
// Start background loading
g_object_ref (G_OBJECT (obj));
- obj->priv->pixbuf_loading_thread = g_thread_create(image_render_pixbuf_loading_thread, (gpointer)obj, FALSE, NULL);
+ obj->priv->pixbuf_loading_thread = g_thread_create(image_render_pixbuf_loading_thread, (gpointer) obj, FALSE, NULL);
}
@@ -811,7 +811,7 @@
g_return_if_fail (obj->priv->filename==NULL);
- obj->priv->filename = g_strdup(filename);
+ obj->priv->filename = g_strdup (filename);
obj->priv->scaled_pixbuf_loaded = FALSE;
obj->priv->orig_pixbuf_loaded = 0;
}
@@ -826,7 +826,7 @@
if (g_atomic_int_get (&obj->priv->orig_pixbuf_loaded)==0)
return;
- if (!GTK_WIDGET_REALIZED (GTK_WIDGET(obj)))
+ if (!GTK_WIDGET_REALIZED (GTK_WIDGET (obj)))
return;
if (obj->priv->disp_pixbuf)
@@ -838,8 +838,8 @@
if (obj->priv->best_fit)
{
- if (gdk_pixbuf_get_height(obj->priv->orig_pixbuf) < GTK_WIDGET(obj)->allocation.height &&
- gdk_pixbuf_get_width(obj->priv->orig_pixbuf) < GTK_WIDGET(obj)->allocation.width)
+ if (gdk_pixbuf_get_height(obj->priv->orig_pixbuf) < GTK_WIDGET (obj)->allocation.height &&
+ gdk_pixbuf_get_width(obj->priv->orig_pixbuf) < GTK_WIDGET (obj)->allocation.width)
{
// no need to scale down
@@ -848,15 +848,15 @@
return;
}
- int height = GTK_WIDGET(obj)->allocation.height;
- int width = (((double) GTK_WIDGET(obj)->allocation.height) /
+ int height = GTK_WIDGET (obj)->allocation.height;
+ int width = (((double) GTK_WIDGET (obj)->allocation.height) /
gdk_pixbuf_get_height(obj->priv->orig_pixbuf))*
gdk_pixbuf_get_width(obj->priv->orig_pixbuf);
- if (width >= GTK_WIDGET(obj)->allocation.width)
+ if (width >= GTK_WIDGET (obj)->allocation.width)
{
- width = GTK_WIDGET(obj)->allocation.width;
- height = (((double)GTK_WIDGET(obj)->allocation.width) /
+ width = GTK_WIDGET (obj)->allocation.width;
+ height = (((double)GTK_WIDGET (obj)->allocation.width) /
gdk_pixbuf_get_width(obj->priv->orig_pixbuf))*
gdk_pixbuf_get_height(obj->priv->orig_pixbuf);
}
@@ -892,8 +892,8 @@
return;
if (obj->priv->best_fit ||
- (gdk_pixbuf_get_width(obj->priv->disp_pixbuf) < GTK_WIDGET(obj)->allocation.width &&
- gdk_pixbuf_get_height(obj->priv->disp_pixbuf) < GTK_WIDGET(obj)->allocation.height))
+ (gdk_pixbuf_get_width(obj->priv->disp_pixbuf) < GTK_WIDGET (obj)->allocation.width &&
+ gdk_pixbuf_get_height(obj->priv->disp_pixbuf) < GTK_WIDGET (obj)->allocation.height))
{
if (obj->priv->h_adjustment)
{
@@ -916,14 +916,14 @@
{
obj->priv->h_adjustment->lower = 0;
obj->priv->h_adjustment->upper = gdk_pixbuf_get_width(obj->priv->disp_pixbuf);
- obj->priv->h_adjustment->page_size = GTK_WIDGET(obj)->allocation.width;
+ obj->priv->h_adjustment->page_size = GTK_WIDGET (obj)->allocation.width;
gtk_adjustment_changed(obj->priv->h_adjustment);
}
if (obj->priv->v_adjustment)
{
obj->priv->v_adjustment->lower = 0;
obj->priv->v_adjustment->upper = gdk_pixbuf_get_height(obj->priv->disp_pixbuf);
- obj->priv->v_adjustment->page_size = GTK_WIDGET(obj)->allocation.height;
+ obj->priv->v_adjustment->page_size = GTK_WIDGET (obj)->allocation.height;
gtk_adjustment_changed(obj->priv->v_adjustment);
}
}
Modified: trunk/src/intviewer/inputmodes.cc
==============================================================================
--- trunk/src/intviewer/inputmodes.cc (original)
+++ trunk/src/intviewer/inputmodes.cc Thu May 8 16:45:18 2008
@@ -204,7 +204,7 @@
imd->get_next_offset = inputmode_ascii_get_next_offset;
imd->get_prev_offset = inputmode_ascii_get_previous_offset;
g_free(imd->input_mode_name);
- imd->input_mode_name = g_strdup("ASCII");
+ imd->input_mode_name = g_strdup ("ASCII");
if (g_ascii_strcasecmp(encoding, "ASCII")==0)
return;
@@ -221,7 +221,7 @@
unicode2utf8(unicode, (unsigned char*)&imd->ascii_charset_translation[i]);
}
g_free(imd->input_mode_name);
- imd->input_mode_name = g_strdup("CP437");
+ imd->input_mode_name = g_strdup ("CP437");
return;
}
@@ -258,7 +258,7 @@
}
g_iconv_close(icnv);
g_free(imd->input_mode_name);
- imd->input_mode_name = g_strdup(encoding);
+ imd->input_mode_name = g_strdup (encoding);
}
@@ -349,7 +349,7 @@
imd->get_prev_offset = inputmode_utf8_get_previous_offset;
imd->get_next_offset = inputmode_utf8_get_next_offset;
g_free(imd->input_mode_name);
- imd->input_mode_name = g_strdup("UTF8");
+ imd->input_mode_name = g_strdup ("UTF8");
}
#define UTF8_SINGLE_CHAR(c) (((c)&0x80)==0)
Modified: trunk/src/intviewer/scroll-box.cc
==============================================================================
--- trunk/src/intviewer/scroll-box.cc (original)
+++ trunk/src/intviewer/scroll-box.cc Thu May 8 16:45:18 2008
@@ -117,8 +117,8 @@
(GtkAttachOptions) (GTK_FILL), 0, 0);
w->priv->client = NULL;
- g_signal_connect(G_OBJECT(w), "button-press-event", G_CALLBACK(scroll_box_button_press), (gpointer)w);
- g_signal_connect(G_OBJECT(w), "destroy-event", G_CALLBACK(scroll_box_destroy), (gpointer)w);
+ g_signal_connect(G_OBJECT (w), "button-press-event", G_CALLBACK(scroll_box_button_press), (gpointer) w);
+ g_signal_connect(G_OBJECT (w), "destroy-event", G_CALLBACK(scroll_box_destroy), (gpointer) w);
}
@@ -132,7 +132,7 @@
if (w->priv)
{
if (w->priv->client)
- g_object_unref(G_OBJECT(w->priv->client));
+ g_object_unref(G_OBJECT (w->priv->client));
w->priv->client=NULL;
g_free(w->priv);
@@ -174,11 +174,11 @@
if (obj->priv->client)
{
if (obj->priv->client)
- g_object_unref(G_OBJECT(obj->priv->client));
+ g_object_unref(G_OBJECT (obj->priv->client));
obj->priv->client=NULL;
}
- g_object_ref(G_OBJECT(client));
+ g_object_ref(G_OBJECT (client));
gtk_widget_show(client);
obj->priv->client = client;
gtk_table_attach (GTK_TABLE (obj), client , 0, 1, 0, 1,
Modified: trunk/src/intviewer/search-dlg.cc
==============================================================================
--- trunk/src/intviewer/search-dlg.cc (original)
+++ trunk/src/intviewer/search-dlg.cc Thu May 8 16:45:18 2008
@@ -66,16 +66,16 @@
g_return_if_fail (sdlg!=NULL);
g_return_if_fail (sdlg->priv!=NULL);
- sdlg->priv->text_pattern_history = gviewer_load_string_history(GVIEWER_DEFAULT_PATH_PREFIX "text_pattern%d", -1);
+ sdlg->priv->text_pattern_history = gviewer_load_string_history (GVIEWER_DEFAULT_PATH_PREFIX "text_pattern%d", -1);
#if HEX_HISTORY
- sdlg->priv->hex_pattern_history = gviewer_load_string_history(GVIEWER_DEFAULT_PATH_PREFIX "hex_pattern%d", -1);
+ sdlg->priv->hex_pattern_history = gviewer_load_string_history (GVIEWER_DEFAULT_PATH_PREFIX "hex_pattern%d", -1);
#endif
- sdlg->priv->last_entry_text = gviewer_get_string(GVIEWER_DEFAULT_PATH_PREFIX "last_text", "");
+ sdlg->priv->last_entry_text = gviewer_get_string (GVIEWER_DEFAULT_PATH_PREFIX "last_text", "");
sdlg->priv->searchmode = SEARCH_MODE_TEXT;
- int i = gviewer_get_int(GVIEWER_DEFAULT_PATH_PREFIX "last_mode", (int) SEARCH_MODE_TEXT);
+ int i = gviewer_get_int (GVIEWER_DEFAULT_PATH_PREFIX "last_mode", (int) SEARCH_MODE_TEXT);
if (i==(int) SEARCH_MODE_HEX)
sdlg->priv->searchmode = SEARCH_MODE_HEX;
@@ -83,27 +83,27 @@
}
-static void save_search_dlg_state(GViewerSearchDlg *sdlg)
+static void save_search_dlg_state (GViewerSearchDlg *sdlg)
{
g_return_if_fail (sdlg!=NULL);
g_return_if_fail (sdlg->priv!=NULL);
- gnome_config_set_int(GVIEWER_DEFAULT_PATH_PREFIX "last_mode", (int)sdlg->priv->searchmode);
- gnome_config_set_bool(GVIEWER_DEFAULT_PATH_PREFIX "case_sens", sdlg->priv->case_sensitive);
+ gnome_config_set_int (GVIEWER_DEFAULT_PATH_PREFIX "last_mode", (int) sdlg->priv->searchmode);
+ gnome_config_set_bool (GVIEWER_DEFAULT_PATH_PREFIX "case_sens", sdlg->priv->case_sensitive);
- gviewer_write_string_history(GVIEWER_DEFAULT_PATH_PREFIX "text_pattern%d", sdlg->priv->text_pattern_history);
+ gviewer_write_string_history (GVIEWER_DEFAULT_PATH_PREFIX "text_pattern%d", sdlg->priv->text_pattern_history);
#if HEX_HISTORY
- gviewer_write_string_history(GVIEWER_DEFAULT_PATH_PREFIX "hex_pattern%d", sdlg->priv->hex_pattern_history);
+ gviewer_write_string_history (GVIEWER_DEFAULT_PATH_PREFIX "hex_pattern%d", sdlg->priv->hex_pattern_history);
#endif
- gnome_config_set_string(GVIEWER_DEFAULT_PATH_PREFIX "last_text", sdlg->priv->last_entry_text);
+ gnome_config_set_string (GVIEWER_DEFAULT_PATH_PREFIX "last_text", sdlg->priv->last_entry_text);
- gnome_config_sync();
+ gnome_config_sync ();
}
-guint8 *gviewer_search_dlg_get_search_hex_buffer(GViewerSearchDlg *sdlg, /*out*/ guint *buflen)
+guint8 *gviewer_search_dlg_get_search_hex_buffer (GViewerSearchDlg *sdlg, /*out*/ guint *buflen)
{
g_return_val_if_fail (sdlg!=NULL, NULL);
g_return_val_if_fail (sdlg->priv!=NULL, NULL);
@@ -111,8 +111,8 @@
g_return_val_if_fail (sdlg->priv->search_hex_buffer!=NULL, NULL);
g_return_val_if_fail (sdlg->priv->search_hex_buflen>0, NULL);
- guint8 *result = g_new0(guint8, sdlg->priv->search_hex_buflen);
- memcpy(result, sdlg->priv->search_hex_buffer, sdlg->priv->search_hex_buflen);
+ guint8 *result = g_new0 (guint8, sdlg->priv->search_hex_buflen);
+ memcpy (result, sdlg->priv->search_hex_buffer, sdlg->priv->search_hex_buflen);
*buflen = sdlg->priv->search_hex_buflen;
@@ -120,17 +120,17 @@
}
-gchar *gviewer_search_dlg_get_search_text_string(GViewerSearchDlg *sdlg)
+gchar *gviewer_search_dlg_get_search_text_string (GViewerSearchDlg *sdlg)
{
g_return_val_if_fail (sdlg!=NULL, NULL);
g_return_val_if_fail (sdlg->priv!=NULL, NULL);
g_return_val_if_fail (sdlg->priv->search_text_string!=NULL, NULL);
- return g_strdup(sdlg->priv->search_text_string);
+ return g_strdup (sdlg->priv->search_text_string);
}
-SEARCHMODE gviewer_search_dlg_get_search_mode(GViewerSearchDlg *sdlg)
+SEARCHMODE gviewer_search_dlg_get_search_mode (GViewerSearchDlg *sdlg)
{
g_return_val_if_fail (sdlg!=NULL, SEARCH_MODE_TEXT);
g_return_val_if_fail (sdlg->priv!=NULL, SEARCH_MODE_TEXT);
@@ -139,7 +139,7 @@
}
-gboolean gviewer_search_dlg_get_case_sensitive(GViewerSearchDlg *sdlg)
+gboolean gviewer_search_dlg_get_case_sensitive (GViewerSearchDlg *sdlg)
{
g_return_val_if_fail (sdlg!=NULL, TRUE);
g_return_val_if_fail (sdlg->priv!=NULL, TRUE);
@@ -148,7 +148,7 @@
}
-static void set_text_history(GViewerSearchDlg *sdlg)
+static void set_text_history (GViewerSearchDlg *sdlg)
{
for (GList *strings = sdlg->priv->text_pattern_history; strings; strings = strings->next)
if (strings->data!=NULL)
@@ -156,23 +156,23 @@
}
-static void set_text_mode(GViewerSearchDlg *sdlg)
+static void set_text_mode (GViewerSearchDlg *sdlg)
{
gtk_widget_grab_focus(sdlg->priv->entry);
sdlg->priv->searchmode = SEARCH_MODE_TEXT;
gtk_widget_set_sensitive(sdlg->priv->case_sensitive_checkbox, TRUE);
- GtkEntry *w = GTK_ENTRY(gtk_bin_get_child(GTK_BIN(sdlg->priv->entry)));
- entry_changed(w, (gpointer)sdlg);
+ GtkEntry *w = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (sdlg->priv->entry)));
+ entry_changed (w, (gpointer) sdlg);
}
-static void set_hex_mode(GViewerSearchDlg *sdlg)
+static void set_hex_mode (GViewerSearchDlg *sdlg)
{
#if HEX_HISTORY
for (GList *strings = sdlg->priv->hex_pattern_history; strings; strings = strings->next)
if (strings->data!=NULL)
- gtk_combo_box_prepend_text(GTK_COMBO_BOX(sdlg->priv->entry), (gchar *) strings->data);
+ gtk_combo_box_prepend_text (GTK_COMBO_BOX (sdlg->priv->entry), (gchar *) strings->data);
#endif
gtk_widget_grab_focus(sdlg->priv->entry);
@@ -182,12 +182,12 @@
gtk_widget_set_sensitive(sdlg->priv->case_sensitive_checkbox, FALSE);
// Check if the text in the Entry-Box is valud hex, otherwise disable the "Find" button
- GtkEntry *w = GTK_ENTRY(gtk_bin_get_child(GTK_BIN(sdlg->priv->entry)));
- entry_changed(w, (gpointer)sdlg);
+ GtkEntry *w = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (sdlg->priv->entry)));
+ entry_changed (w, (gpointer) sdlg);
}
-static void search_mode_text(GtkToggleButton *btn, GViewerSearchDlg *sdlg)
+static void search_mode_text (GtkToggleButton *btn, GViewerSearchDlg *sdlg)
{
g_return_if_fail (btn!=NULL);
g_return_if_fail (sdlg!=NULL);
@@ -199,7 +199,7 @@
}
-static void search_mode_hex(GtkToggleButton *btn, GViewerSearchDlg *sdlg)
+static void search_mode_hex (GtkToggleButton *btn, GViewerSearchDlg *sdlg)
{
g_return_if_fail (btn!=NULL);
g_return_if_fail (sdlg!=NULL);
@@ -209,7 +209,7 @@
}
-static void search_dlg_action_response(GtkDialog *dlg, gint arg1, GViewerSearchDlg *sdlg)
+static void search_dlg_action_response (GtkDialog *dlg, gint arg1, GViewerSearchDlg *sdlg)
{
g_return_if_fail (sdlg!=NULL);
g_return_if_fail (sdlg->priv!=NULL);
@@ -257,12 +257,12 @@
}
// Store the text
- g_free(sdlg->priv->last_entry_text);
- sdlg->priv->last_entry_text = g_strdup(pattern);
+ g_free (sdlg->priv->last_entry_text);
+ sdlg->priv->last_entry_text = g_strdup (pattern);
}
-static void class_init(GViewerSearchDlgClass *klass)
+static void class_init (GViewerSearchDlgClass *klass)
{
GtkObjectClass *object_class = (GtkObjectClass *) klass;
@@ -271,7 +271,7 @@
}
-void entry_changed(GtkEntry *entry, gpointer user_data)
+void entry_changed (GtkEntry *entry, gpointer user_data)
{
g_return_if_fail (IS_GVIEWER_SEARCH_DLG(user_data));
@@ -305,24 +305,24 @@
sdlg->priv = g_new0(GViewerSearchDlgPrivate, 1);
- GtkDialog *dlg = GTK_DIALOG(sdlg);
+ GtkDialog *dlg = GTK_DIALOG (sdlg);
load_search_dlg_state(sdlg);
- gtk_window_set_title(GTK_WINDOW(dlg), _("Find"));
- gtk_window_set_modal(GTK_WINDOW(dlg), TRUE);
+ gtk_window_set_title(GTK_WINDOW (dlg), _("Find"));
+ gtk_window_set_modal(GTK_WINDOW (dlg), TRUE);
gtk_dialog_add_button(dlg, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
gtk_dialog_add_button(dlg, GTK_STOCK_FIND, GTK_RESPONSE_OK);
gtk_dialog_set_default_response(dlg, GTK_RESPONSE_OK);
- g_signal_connect_swapped(GTK_WIDGET(dlg), "response", G_CALLBACK(search_dlg_action_response), sdlg);
+ g_signal_connect_swapped(GTK_WIDGET (dlg), "response", G_CALLBACK (search_dlg_action_response), sdlg);
// 2x4 Table
- table = GTK_TABLE(gtk_table_new(2, 2, FALSE));
+ table = GTK_TABLE (gtk_table_new (2, 2, FALSE));
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
- gtk_box_pack_start (GTK_BOX(dlg->vbox), GTK_WIDGET(table), FALSE, TRUE, 0);
- sdlg->priv->table = GTK_WIDGET(table);
+ gtk_box_pack_start (GTK_BOX (dlg->vbox), GTK_WIDGET (table), FALSE, TRUE, 0);
+ sdlg->priv->table = GTK_WIDGET (table);
// Label
sdlg->priv->label = gtk_label_new(NULL);
@@ -331,9 +331,9 @@
// Entry Box
sdlg->priv->entry = gtk_combo_box_entry_new_text();
- entry = gtk_bin_get_child(GTK_BIN(sdlg->priv->entry));
+ entry = gtk_bin_get_child (GTK_BIN (sdlg->priv->entry));
g_object_set(entry, "activates-default", TRUE, NULL);
- g_signal_connect(entry, "changed", G_CALLBACK(entry_changed), sdlg);
+ g_signal_connect (entry, "changed", G_CALLBACK (entry_changed), sdlg);
gtk_table_attach(table, sdlg->priv->entry, 1, 3, 0, 1, GTK_FILL, GTK_FILL, 0, 0);
set_text_history(sdlg);
@@ -342,8 +342,8 @@
sdlg->priv->text_mode = gtk_radio_button_new_with_mnemonic(NULL, _("_Text"));
sdlg->priv->hex_mode = gtk_radio_button_new_with_mnemonic_from_widget(GTK_RADIO_BUTTON(sdlg->priv->text_mode), _("_Hexadecimal"));
- g_signal_connect(sdlg->priv->text_mode, "toggled", G_CALLBACK(search_mode_text), sdlg);
- g_signal_connect(sdlg->priv->hex_mode, "toggled", G_CALLBACK(search_mode_hex), sdlg);
+ g_signal_connect(sdlg->priv->text_mode, "toggled", G_CALLBACK (search_mode_text), sdlg);
+ g_signal_connect(sdlg->priv->hex_mode, "toggled", G_CALLBACK (search_mode_hex), sdlg);
gtk_table_attach(table, sdlg->priv->text_mode, 1, 2, 1, 2, GTK_FILL, GTK_FILL, 0, 0);
gtk_table_attach(table, sdlg->priv->hex_mode, 1, 2, 2, 3, GTK_FILL, GTK_FILL, 0, 0);
@@ -353,18 +353,18 @@
gtk_table_attach(table, sdlg->priv->case_sensitive_checkbox, 2, 3, 1, 2, GtkAttachOptions(GTK_EXPAND|GTK_FILL), GTK_FILL, 0, 0);
gtk_widget_show_all(sdlg->priv->table);
- gtk_widget_show(GTK_WIDGET(dlg));
+ gtk_widget_show(GTK_WIDGET (dlg));
// Restore the previously saved state (loaded with "load_search_dlg_state")
if (sdlg->priv->searchmode==SEARCH_MODE_HEX)
{
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(sdlg->priv->hex_mode), TRUE);
- set_hex_mode(sdlg);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sdlg->priv->hex_mode), TRUE);
+ set_hex_mode (sdlg);
}
else
{
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(sdlg->priv->text_mode), TRUE);
- set_text_mode(sdlg);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sdlg->priv->text_mode), TRUE);
+ set_text_mode (sdlg);
}
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(sdlg->priv->case_sensitive_checkbox), sdlg->priv->case_sensitive);
@@ -444,18 +444,18 @@
}
-void gviewer_show_search_dlg(GtkWindow *parent)
+void gviewer_show_search_dlg (GtkWindow *parent)
{
- GtkWidget *w = gviewer_search_dlg_new(parent);
- GViewerSearchDlg *dlg = GVIEWER_SEARCH_DLG(w);
+ GtkWidget *w = gviewer_search_dlg_new (parent);
+ GViewerSearchDlg *dlg = GVIEWER_SEARCH_DLG (w);
- gtk_dialog_run(GTK_DIALOG(dlg));
+ gtk_dialog_run (GTK_DIALOG (dlg));
- g_warning("Search mode = %d", (int) gviewer_search_dlg_get_search_mode(dlg));
+ g_warning ("Search mode = %d", (int) gviewer_search_dlg_get_search_mode (dlg));
gchar *text = gviewer_search_dlg_get_search_text_string (dlg);
- g_warning("Search text string = \"%s\"", text);
- g_free(text);
+ g_warning ("Search text string = \"%s\"", text);
+ g_free (text);
- gtk_widget_destroy(GTK_WIDGET(dlg));
+ gtk_widget_destroy (GTK_WIDGET (dlg));
}
Modified: trunk/src/intviewer/search-dlg.h
==============================================================================
--- trunk/src/intviewer/search-dlg.h (original)
+++ trunk/src/intviewer/search-dlg.h Thu May 8 16:45:18 2008
@@ -24,7 +24,7 @@
#ifndef __LIBGVIEWER_SEARCH_DLG_H__
#define __LIBGVIEWER_SEARCH_DLG_H__
-#define GVIEWER_SEARCH_DLG(obj) GTK_CHECK_CAST (obj, gviewer_search_dlg_get_type(), GViewerSearchDlg)
+#define GVIEWER_SEARCH_DLG(obj) GTK_CHECK_CAST (obj, gviewer_search_dlg_get_type(), GViewerSearchDlg)
#define GVIEWER_SEARCH_DLG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gviewer_search_dlg_get_type(), GViewerSearchDlgClass)
#define IS_GVIEWER_SEARCH_DLG(obj) GTK_CHECK_TYPE (obj, gviewer_search_dlg_get_type())
@@ -53,16 +53,16 @@
GtkWidget *gviewer_search_dlg_new (GtkWindow *parent);
-SEARCHMODE gviewer_search_dlg_get_search_mode(GViewerSearchDlg *sdlg);
+SEARCHMODE gviewer_search_dlg_get_search_mode (GViewerSearchDlg *sdlg);
/* returns string is strdup-ed, caller must "g_free" it */
-gchar *gviewer_search_dlg_get_search_text_string(GViewerSearchDlg *sdlg);
+gchar *gviewer_search_dlg_get_search_text_string (GViewerSearchDlg *sdlg);
/* returned buffer is "g_new0-ed", caller must "g_free" it */
-guint8 *gviewer_search_dlg_get_search_hex_buffer(GViewerSearchDlg *sdlg, /*out*/ guint *buflen);
+guint8 *gviewer_search_dlg_get_search_hex_buffer (GViewerSearchDlg *sdlg, /*out*/ guint *buflen);
-gboolean gviewer_search_dlg_get_case_sensitive(GViewerSearchDlg *sdlg);
+gboolean gviewer_search_dlg_get_case_sensitive (GViewerSearchDlg *sdlg);
-void gviewer_show_search_dlg(GtkWindow *parent);
+void gviewer_show_search_dlg (GtkWindow *parent);
#endif /* __LIBGVIEWER_SEARCH_DLG_H__ */
Modified: trunk/src/intviewer/search-progress-dlg.cc
==============================================================================
--- trunk/src/intviewer/search-progress-dlg.cc (original)
+++ trunk/src/intviewer/search-progress-dlg.cc Thu May 8 16:45:18 2008
@@ -71,11 +71,11 @@
GtkDialog *dlg = GTK_DIALOG(sdlg);
sdlg->priv->progress = 0;
- gtk_window_set_title(GTK_WINDOW(dlg), _("Searching..."));
- gtk_window_set_modal(GTK_WINDOW(dlg), TRUE);
+ gtk_window_set_title(GTK_WINDOW (dlg), _("Searching..."));
+ gtk_window_set_modal(GTK_WINDOW (dlg), TRUE);
gtk_dialog_add_button(dlg, GTK_STOCK_STOP, 12);
- g_signal_connect_swapped(GTK_WIDGET(dlg), "response", G_CALLBACK(search_progress_dlg_action_response), sdlg);
+ g_signal_connect_swapped(GTK_WIDGET (dlg), "response", G_CALLBACK (search_progress_dlg_action_response), sdlg);
// Text Label
sdlg->priv->label = gtk_label_new("");
@@ -91,7 +91,7 @@
gtk_widget_show_all(dlg->vbox);
- gtk_widget_show(GTK_WIDGET(dlg));
+ gtk_widget_show (GTK_WIDGET (dlg));
}
@@ -190,7 +190,7 @@
dlg->priv->progress_value = progress;
dlg->priv->completed_indicator = complete;
- gint timeout_source_id = g_timeout_add(300, search_progress_dlg_timeout, (gpointer)dlg);
+ gint timeout_source_id = g_timeout_add (300, search_progress_dlg_timeout, (gpointer) dlg);
dprogress = g_atomic_int_get(dlg->priv->progress_value);
g_snprintf(text, sizeof(text), "%3.1f%%", dprogress/10.0);
@@ -205,5 +205,5 @@
g_free(str);
- gtk_widget_destroy(GTK_WIDGET(dlg));
+ gtk_widget_destroy (GTK_WIDGET (dlg));
}
Modified: trunk/src/intviewer/searcher.cc
==============================================================================
--- trunk/src/intviewer/searcher.cc (original)
+++ trunk/src/intviewer/searcher.cc Thu May 8 16:45:18 2008
@@ -605,6 +605,6 @@
src->priv->search_forward = forward;
- src->priv->search_thread = g_thread_create(search_func, (gpointer)src, TRUE, NULL);
+ src->priv->search_thread = g_thread_create (search_func, (gpointer) src, TRUE, NULL);
g_return_if_fail (src->priv->search_thread!=NULL);
}
Modified: trunk/src/intviewer/searcher.h
==============================================================================
--- trunk/src/intviewer/searcher.h (original)
+++ trunk/src/intviewer/searcher.h Thu May 8 16:45:18 2008
@@ -99,7 +99,7 @@
To read the value, use "g_atomic_int_get"
(read glib's "atomic operations").
*/
-gint * g_viewer_searcher_get_progress_indicator(GViewerSearcher *src);
+gint *g_viewer_searcher_get_progress_indicator (GViewerSearcher *src);
/* Abort Indicator.
While the search thread is active, set this value to non-zero
Modified: trunk/src/intviewer/text-render.cc
==============================================================================
--- trunk/src/intviewer/text-render.cc (original)
+++ trunk/src/intviewer/text-render.cc Thu May 8 16:45:18 2008
@@ -312,19 +312,19 @@
w->priv->current_offset = 0;
- w->priv->encoding = g_strdup("ASCII");
+ w->priv->encoding = g_strdup ("ASCII");
w->priv->utf8alloc = 0;
w->priv->tab_size = 8;
w->priv->font_size = 14;
- w->priv->fixed_font_name = g_strdup("Monospace");
+ w->priv->fixed_font_name = g_strdup ("Monospace");
- g_signal_connect(G_OBJECT(w), "key_press_event", G_CALLBACK(text_render_key_pressed), NULL);
+ g_signal_connect(G_OBJECT (w), "key_press_event", G_CALLBACK (text_render_key_pressed), NULL);
- w->priv->layout = gtk_widget_create_pango_layout(GTK_WIDGET(w), NULL);
+ w->priv->layout = gtk_widget_create_pango_layout(GTK_WIDGET (w), NULL);
- GTK_WIDGET_SET_FLAGS(GTK_WIDGET(w), GTK_CAN_FOCUS);
+ GTK_WIDGET_SET_FLAGS(GTK_WIDGET (w), GTK_CAN_FOCUS);
}
@@ -390,7 +390,7 @@
static void text_render_position_changed(TextRender *w)
{
- if (!GTK_WIDGET_REALIZED(GTK_WIDGET(w)))
+ if (!GTK_WIDGET_REALIZED(GTK_WIDGET (w)))
return;
text_render_notify_status_changed(w);
@@ -412,10 +412,10 @@
static void text_render_redraw(TextRender *w)
{
- if (!GTK_WIDGET_REALIZED(GTK_WIDGET(w)))
+ if (!GTK_WIDGET_REALIZED(GTK_WIDGET (w)))
return;
- gdk_window_invalidate_rect(GTK_WIDGET(w)->window, NULL, FALSE);
+ gdk_window_invalidate_rect(GTK_WIDGET (w)->window, NULL, FALSE);
}
@@ -516,7 +516,7 @@
gtk_style_set_background (widget->style, widget->window, GTK_STATE_ACTIVE);
- obj->priv->gc = gdk_gc_new(GTK_WIDGET(obj)->window);
+ obj->priv->gc = gdk_gc_new(GTK_WIDGET (obj)->window);
gdk_gc_set_exposures(obj->priv->gc, TRUE);
text_render_setup_font(obj, obj->priv->fixed_font_name, obj->priv->font_size);
@@ -1040,8 +1040,8 @@
g_return_if_fail (IS_TEXT_RENDER(obj));
g_return_if_fail (range!=NULL);
- g_signal_connect (G_OBJECT(range), "change-value",
- G_CALLBACK(text_render_vscroll_change_value), (gpointer)obj);
+ g_signal_connect (G_OBJECT (range), "change-value",
+ G_CALLBACK (text_render_vscroll_change_value), (gpointer)obj);
}
@@ -1113,7 +1113,7 @@
if (!obj->priv->im)
return 0;
- PangoLayout *layout = gtk_widget_create_pango_layout (GTK_WIDGET(obj), "");
+ PangoLayout *layout = gtk_widget_create_pango_layout (GTK_WIDGET (obj), "");
pango_layout_set_font_description (layout, obj->priv->font_desc);
for (i=0; i<256; i++)
@@ -1158,9 +1158,9 @@
w->priv->disp_font_metrics = load_font (fontlabel);
w->priv->font_desc = pango_font_description_from_string (fontlabel);
- gtk_widget_modify_font (GTK_WIDGET(w), w->priv->font_desc);
+ gtk_widget_modify_font (GTK_WIDGET (w), w->priv->font_desc);
- w->priv->char_width = get_max_char_width(GTK_WIDGET(w),
+ w->priv->char_width = get_max_char_width(GTK_WIDGET (w),
w->priv->font_desc,
w->priv->disp_font_metrics);
@@ -1488,7 +1488,7 @@
}
g_free(w->priv->encoding);
- w->priv->encoding = g_strdup(encoding);
+ w->priv->encoding = g_strdup (encoding);
gv_set_input_mode(w->priv->im, encoding);
text_render_filter_undisplayable_chars(w);
text_render_redraw(w);
@@ -1754,7 +1754,7 @@
marker_closer(w, marker_shown);
pango_layout_set_markup (w->priv->layout, (gchar *) w->priv->utf8buf, w->priv->utf8buf_length);
- gdk_draw_layout(GTK_WIDGET(w)->window, w->priv->gc, -(w->priv->char_width*column), y, w->priv->layout);
+ gdk_draw_layout(GTK_WIDGET (w)->window, w->priv->gc, -(w->priv->char_width*column), y, w->priv->layout);
return 0;
}
@@ -1818,7 +1818,7 @@
marker_closer(w, marker_shown);
pango_layout_set_markup (w->priv->layout, (gchar *) w->priv->utf8buf, w->priv->utf8buf_length);
- gdk_draw_layout(GTK_WIDGET(w)->window, w->priv->gc, -(w->priv->char_width*column), y, w->priv->layout);
+ gdk_draw_layout(GTK_WIDGET (w)->window, w->priv->gc, -(w->priv->char_width*column), y, w->priv->layout);
return 0;
}
@@ -2005,7 +2005,7 @@
marker_closer(w, marker_shown);
pango_layout_set_markup (w->priv->layout, (gchar *) w->priv->utf8buf, w->priv->utf8buf_length);
- gdk_draw_layout(GTK_WIDGET(w)->window, w->priv->gc, 0, y, w->priv->layout);
+ gdk_draw_layout(GTK_WIDGET (w)->window, w->priv->gc, 0, y, w->priv->layout);
return 0;
}
Modified: trunk/src/intviewer/viewer-utils.cc
==============================================================================
--- trunk/src/intviewer/viewer-utils.cc (original)
+++ trunk/src/intviewer/viewer-utils.cc Thu May 8 16:45:18 2008
@@ -115,7 +115,7 @@
}
-int unicode2utf8(unsigned int unicode, unsigned char*out)
+int unicode2utf8 (unsigned int unicode, unsigned char*out)
{
int bytes_needed = 0;
if (unicode<0x80)
@@ -151,7 +151,7 @@
}
-char_type *convert_utf8_to_chartype_array(const gchar *utf8text, /*out*/ int *array_length)
+char_type *convert_utf8_to_chartype_array (const gchar *utf8text, /*out*/ int *array_length)
{
g_return_val_if_fail (utf8text!=NULL, NULL);
g_return_val_if_fail (array_length!=NULL, NULL);
@@ -188,7 +188,7 @@
}
-guint8 *mem_reverse(const guint8 *buffer, guint buflen)
+guint8 *mem_reverse (const guint8 *buffer, guint buflen)
{
g_return_val_if_fail (buffer!=NULL, NULL);
g_return_val_if_fail (buflen>0, NULL);
@@ -204,7 +204,7 @@
}
-guint8 *text2hex(const gchar *text, /*out*/ guint *buflen)
+guint8 *text2hex (const gchar *text, /*out*/ guint *buflen)
{
g_return_val_if_fail (text!=NULL, NULL);
g_return_val_if_fail (buflen!=NULL, NULL);
@@ -220,7 +220,7 @@
if (text[idx]==' ')
idx++;
else
- if (g_ascii_isxdigit(text[idx]))
+ if (g_ascii_isxdigit (text[idx]))
{
idx++;
len++;
@@ -237,7 +237,7 @@
high_nib = TRUE;
value = 0;
for (gint idx=0; text[idx]; ++idx)
- if (g_ascii_isxdigit(text[idx]))
+ if (g_ascii_isxdigit (text[idx]))
{
if (high_nib)
value = g_ascii_xdigit_value(text[idx]) * 16;
Modified: trunk/src/intviewer/viewer-widget.cc
==============================================================================
--- trunk/src/intviewer/viewer-widget.cc (original)
+++ trunk/src/intviewer/viewer-widget.cc Thu May 8 16:45:18 2008
@@ -163,33 +163,33 @@
text_render_set_v_adjustment(w->priv->textr, scroll_box_get_v_adjustment(SCROLL_BOX(w->priv->tscrollbox)));
text_render_set_h_adjustment(w->priv->textr, scroll_box_get_h_adjustment(SCROLL_BOX(w->priv->tscrollbox)));
text_render_attach_external_v_range(w->priv->textr, scroll_box_get_v_range(SCROLL_BOX(w->priv->tscrollbox)));
- scroll_box_set_client(SCROLL_BOX(w->priv->tscrollbox), GTK_WIDGET(w->priv->textr));
- gtk_widget_show(GTK_WIDGET(w->priv->textr));
+ scroll_box_set_client (SCROLL_BOX(w->priv->tscrollbox), GTK_WIDGET (w->priv->textr));
+ gtk_widget_show (GTK_WIDGET (w->priv->textr));
gtk_widget_show(w->priv->tscrollbox);
- g_object_ref(G_OBJECT(w->priv->tscrollbox));
+ g_object_ref (G_OBJECT (w->priv->tscrollbox));
w->priv->imgr = (ImageRender *) image_render_new();
gviewer_set_best_fit(w, DEFAULT_BEST_FIT);
gviewer_set_scale_factor(w, DEFAULT_SCALE_FACTOR);
w->priv->iscrollbox = scroll_box_new();
- image_render_set_v_adjustment(w->priv->imgr, scroll_box_get_v_adjustment(SCROLL_BOX(w->priv->iscrollbox)));
- image_render_set_h_adjustment(w->priv->imgr, scroll_box_get_h_adjustment(SCROLL_BOX(w->priv->iscrollbox)));
- image_render_set_best_fit(w->priv->imgr, TRUE);
- image_render_set_scale_factor(w->priv->imgr, 1);
- scroll_box_set_client(SCROLL_BOX(w->priv->iscrollbox), GTK_WIDGET(w->priv->imgr));
- gtk_widget_show(GTK_WIDGET(w->priv->imgr));
- gtk_widget_show(w->priv->iscrollbox);
- g_object_ref(G_OBJECT(w->priv->iscrollbox));
+ image_render_set_v_adjustment (w->priv->imgr, scroll_box_get_v_adjustment (SCROLL_BOX (w->priv->iscrollbox)));
+ image_render_set_h_adjustment (w->priv->imgr, scroll_box_get_h_adjustment (SCROLL_BOX (w->priv->iscrollbox)));
+ image_render_set_best_fit (w->priv->imgr, TRUE);
+ image_render_set_scale_factor (w->priv->imgr, 1);
+ scroll_box_set_client (SCROLL_BOX(w->priv->iscrollbox), GTK_WIDGET (w->priv->imgr));
+ gtk_widget_show (GTK_WIDGET (w->priv->imgr));
+ gtk_widget_show (w->priv->iscrollbox);
+ g_object_ref (G_OBJECT (w->priv->iscrollbox));
w->priv->last_client = w->priv->tscrollbox;
- gtk_table_attach (GTK_TABLE(w), GTK_WIDGET(w->priv->tscrollbox), 0, 1, 0, 1,
- (GtkAttachOptions)(GTK_FILL|GTK_EXPAND),
- (GtkAttachOptions)(GTK_FILL|GTK_EXPAND), 0, 0);
+ gtk_table_attach (GTK_TABLE(w), GTK_WIDGET (w->priv->tscrollbox), 0, 1, 0, 1,
+ (GtkAttachOptions)(GTK_FILL|GTK_EXPAND),
+ (GtkAttachOptions)(GTK_FILL|GTK_EXPAND), 0, 0);
- g_signal_connect(G_OBJECT(w), "destroy-event", G_CALLBACK(gviewer_destroy), (gpointer)w);
+ g_signal_connect (G_OBJECT (w), "destroy-event", G_CALLBACK (gviewer_destroy), (gpointer) w);
- g_signal_connect(G_OBJECT(w->priv->textr), "text_status_changed", G_CALLBACK(gviewer_text_status_update), (gpointer)w);
- g_signal_connect(G_OBJECT(w->priv->imgr), "image_status_changed", G_CALLBACK(gviewer_image_status_update), (gpointer)w);
+ g_signal_connect (G_OBJECT (w->priv->textr), "text_status_changed", G_CALLBACK (gviewer_text_status_update), (gpointer) w);
+ g_signal_connect (G_OBJECT (w->priv->imgr), "image_status_changed", G_CALLBACK (gviewer_image_status_update), (gpointer) w);
}
@@ -202,12 +202,12 @@
static gchar temp[MAX_STATUS_LENGTH];
- g_snprintf(temp, MAX_STATUS_LENGTH,
- _("Position: %lu of %lu\tColumn: %d\t%s"),
- (unsigned long)status->current_offset,
- (unsigned long)status->size,
- status->column,
- status->wrap_mode?_("Wrap"):"");
+ g_snprintf(temp, sizeof (temp),
+ _("Position: %lu of %lu\tColumn: %d\t%s"),
+ (unsigned long)status->current_offset,
+ (unsigned long)status->size,
+ status->column,
+ status->wrap_mode?_("Wrap"):"");
gtk_signal_emit (GTK_OBJECT(viewer), gviewer_signals[STATUS_LINE_CHANGED], temp);
}
@@ -254,8 +254,8 @@
if (w->priv)
{
- g_object_unref(G_OBJECT(w->priv->iscrollbox));
- g_object_unref(G_OBJECT(w->priv->tscrollbox));
+ g_object_unref(G_OBJECT (w->priv->iscrollbox));
+ g_object_unref(G_OBJECT (w->priv->tscrollbox));
g_free(w->priv);
w->priv = NULL;
@@ -363,7 +363,7 @@
if (obj->priv->last_client)
gtk_container_remove(GTK_CONTAINER(obj), obj->priv->last_client);
- gtk_widget_grab_focus(GTK_WIDGET(client));
+ gtk_widget_grab_focus(GTK_WIDGET (client));
gtk_table_attach (GTK_TABLE (obj), client , 0, 1, 0, 1,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
@@ -422,7 +422,7 @@
g_free(obj->priv->filename);
obj->priv->filename = NULL;
- obj->priv->filename = g_strdup(filename);
+ obj->priv->filename = g_strdup (filename);
text_render_load_file(obj->priv->textr, obj->priv->filename);
Modified: trunk/src/intviewer/viewer-window.cc
==============================================================================
--- trunk/src/intviewer/viewer-window.cc (original)
+++ trunk/src/intviewer/viewer-window.cc Thu May 8 16:45:18 2008
@@ -196,7 +196,7 @@
gviewer_load_file(obj->priv->viewer, filename);
- gtk_window_set_title(GTK_WINDOW(obj), obj->priv->filename);
+ gtk_window_set_title(GTK_WINDOW (obj), obj->priv->filename);
}
@@ -289,7 +289,7 @@
(GDestroyNotify)gviewer_window_destroy_external_tool);
#endif
- GtkWindow *win = GTK_WINDOW(w);
+ GtkWindow *win = GTK_WINDOW (w);
gtk_window_set_title(win, "GViewer");
g_signal_connect(G_OBJECT (w), "key_press_event", G_CALLBACK (gviewer_window_key_pressed), NULL);
@@ -303,8 +303,8 @@
w->priv->viewer = (GViewer *) gviewer_new();
g_object_ref(G_OBJECT (w->priv->viewer));
- gtk_widget_show(GTK_WIDGET(w->priv->viewer));
- gtk_box_pack_start (GTK_BOX (w->priv->vbox), GTK_WIDGET(w->priv->viewer), TRUE, TRUE, 0);
+ gtk_widget_show(GTK_WIDGET (w->priv->viewer));
+ gtk_box_pack_start (GTK_BOX (w->priv->vbox), GTK_WIDGET (w->priv->viewer), TRUE, TRUE, 0);
w->priv->exif_viewer = (GViewer *) gviewer_new();
g_object_ref(G_OBJECT (w->priv->exif_viewer));
@@ -317,7 +317,7 @@
w->priv->statusbar_ctx_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(w->priv->statusbar), "info");
- gtk_widget_grab_focus(GTK_WIDGET(w->priv->viewer));
+ gtk_widget_grab_focus(GTK_WIDGET (w->priv->viewer));
gtk_container_add(GTK_CONTAINER (w), w->priv->vbox);
@@ -361,37 +361,37 @@
switch (settings->binary_bytes_per_line)
{
case 20:
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(obj->priv->fixed_limit_menu_items[0]), TRUE);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (obj->priv->fixed_limit_menu_items[0]), TRUE);
break;
case 40:
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(obj->priv->fixed_limit_menu_items[1]), TRUE);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (obj->priv->fixed_limit_menu_items[1]), TRUE);
break;
case 80:
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(obj->priv->fixed_limit_menu_items[2]), TRUE);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (obj->priv->fixed_limit_menu_items[2]), TRUE);
break;
}
gviewer_set_wrap_mode(obj->priv->viewer, settings->wrap_mode);
gtk_check_menu_item_set_active(
- GTK_CHECK_MENU_ITEM(obj->priv->wrap_mode_menu_item),
+ GTK_CHECK_MENU_ITEM (obj->priv->wrap_mode_menu_item),
settings->wrap_mode);
gviewer_set_hex_offset_display(obj->priv->viewer, settings->hex_decimal_offset);
gtk_check_menu_item_set_active(
- GTK_CHECK_MENU_ITEM(obj->priv->hex_offset_menu_item),
+ GTK_CHECK_MENU_ITEM (obj->priv->hex_offset_menu_item),
settings->hex_decimal_offset);
gviewer_set_encoding(obj->priv->viewer, settings->charset);
- gtk_window_resize(GTK_WINDOW(obj),
+ gtk_window_resize(GTK_WINDOW (obj),
settings->rect.width, settings->rect.height);
#if 0
// This doesn't work because the window is not shown yet
- if (GTK_WIDGET(obj)->window)
- gdk_window_move(GTK_WIDGET(obj)->window, settings->rect.x, settings->rect.y);
+ if (GTK_WIDGET (obj)->window)
+ gdk_window_move(GTK_WIDGET (obj)->window, settings->rect.x, settings->rect.y);
#endif
- gtk_window_set_position(GTK_WINDOW(obj), GTK_WIN_POS_CENTER);
+ gtk_window_set_position(GTK_WINDOW (obj), GTK_WIN_POS_CENTER);
}
@@ -404,11 +404,11 @@
memset(settings, 0, sizeof(GViewerWindowSettings));
- if (GTK_WIDGET(obj)->window)
+ if (GTK_WIDGET (obj)->window)
{
- settings->rect.width = GTK_WIDGET(obj)->allocation.width;
- settings->rect.height = GTK_WIDGET(obj)->allocation.height;
- gdk_window_get_position(GTK_WIDGET(obj)->window, &settings->rect.x, &settings->rect.y);
+ settings->rect.width = GTK_WIDGET (obj)->allocation.width;
+ settings->rect.height = GTK_WIDGET (obj)->allocation.height;
+ gdk_window_get_position(GTK_WIDGET (obj)->window, &settings->rect.x, &settings->rect.y);
}
else
{
@@ -470,7 +470,7 @@
{
case GDK_w:
case GDK_W:
- gtk_widget_destroy(GTK_WIDGET(w));
+ gtk_widget_destroy(GTK_WIDGET (w));
return TRUE;
}
@@ -948,7 +948,7 @@
submenu = create_sub_menu(_("_Help"), int_viewer_menu);
create_menu_items(submenu, obj->priv->accel_group, obj, help_menu_items);
- gtk_window_add_accel_group (GTK_WINDOW(obj), obj->priv->accel_group);
+ gtk_window_add_accel_group (GTK_WINDOW (obj), obj->priv->accel_group);
return int_viewer_menu;
}
@@ -956,7 +956,7 @@
// Event Handlers
static void menu_file_close (GtkMenuItem *item, GViewerWindow *obj)
{
- gtk_widget_destroy(GTK_WIDGET(obj));
+ gtk_widget_destroy(GTK_WIDGET (obj));
}
@@ -968,7 +968,7 @@
if (gviewer_get_display_mode(obj->priv->viewer) != DISP_MODE_IMAGE)
return;
- if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(item)))
+ if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (item)))
gviewer_window_show_exif_viewer(obj);
else
gviewer_window_hide_exif_viewer(obj);
@@ -985,7 +985,7 @@
g_return_if_fail (tool);
gviewer_window_activate_external_tool(obj, tool);
- gtk_widget_draw(GTK_WIDGET(obj->priv->viewer), NULL);
+ gtk_widget_draw(GTK_WIDGET (obj->priv->viewer), NULL);
}
static void menu_view_internal_viewer(GtkMenuItem *item, GViewerWindow *obj)
@@ -1000,7 +1000,7 @@
g_return_if_fail (obj);
g_return_if_fail (obj->priv->viewer);
- if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(item)))
+ if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (item)))
return;
VIEWERDISPLAYMODE dispmode = (VIEWERDISPLAYMODE) GPOINTER_TO_UINT (g_object_get_data(G_OBJECT (item), G_OBJ_DISPMODE_KEY));
@@ -1010,7 +1010,7 @@
#ifdef EXTERNAL_TOOLS
gviewer_window_activate_internal_viewer(obj);
#endif
- if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(obj->priv->show_exif_menu_item)))
+ if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (obj->priv->show_exif_menu_item)))
gviewer_window_show_exif_viewer(obj);
else
gviewer_window_hide_exif_viewer(obj);
@@ -1019,9 +1019,9 @@
gviewer_window_hide_exif_viewer(obj);
gviewer_set_display_mode(obj->priv->viewer, dispmode);
- gtk_widget_grab_focus(GTK_WIDGET(obj->priv->viewer));
+ gtk_widget_grab_focus(GTK_WIDGET (obj->priv->viewer));
- gtk_widget_draw(GTK_WIDGET(obj->priv->viewer), NULL);
+ gtk_widget_draw(GTK_WIDGET (obj->priv->viewer), NULL);
}
@@ -1030,17 +1030,17 @@
g_return_if_fail (obj);
g_return_if_fail (obj->priv->viewer);
- if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(item)))
+ if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (item)))
return;
gchar *charset = (gchar *) g_object_get_data(G_OBJECT (item), G_OBJ_CHARSET_KEY);
g_return_if_fail (charset!=NULL);
// ASCII is set implicitly when setting a charset
- //gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(w->priv->ascii_menu_item), TRUE);
+ //gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM (w->priv->ascii_menu_item), TRUE);
gviewer_set_encoding(obj->priv->viewer, charset);
- gtk_widget_draw(GTK_WIDGET(obj->priv->viewer), NULL);
+ gtk_widget_draw(GTK_WIDGET (obj->priv->viewer), NULL);
}
@@ -1053,7 +1053,7 @@
gviewer_image_operation(obj->priv->viewer, imageop);
- gtk_widget_draw(GTK_WIDGET(obj->priv->viewer), NULL);
+ gtk_widget_draw(GTK_WIDGET (obj->priv->viewer), NULL);
}
@@ -1086,13 +1086,13 @@
g_return_if_fail (obj);
g_return_if_fail (obj->priv->viewer);
- if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(item)))
+ if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (item)))
return;
int bytes_per_line = GPOINTER_TO_INT (g_object_get_data(G_OBJECT (item), G_OBJ_BYTES_PER_LINE_KEY));
gviewer_set_fixed_limit(obj->priv->viewer, bytes_per_line);
- gtk_widget_draw(GTK_WIDGET(obj->priv->viewer), NULL);
+ gtk_widget_draw(GTK_WIDGET (obj->priv->viewer), NULL);
}
@@ -1111,7 +1111,7 @@
GtkWidget *w;
g_viewer_searcher_start_search(obj->priv->srchr, forward);
- gviewer_show_search_progress_dlg(GTK_WINDOW(obj),
+ gviewer_show_search_progress_dlg(GTK_WINDOW (obj),
obj->priv->search_pattern,
g_viewer_searcher_get_abort_indicator(obj->priv->srchr),
g_viewer_searcher_get_complete_indicator(obj->priv->srchr),
@@ -1121,7 +1121,7 @@
if (g_viewer_searcher_get_end_of_search(obj->priv->srchr))
{
- w = gtk_message_dialog_new(GTK_WINDOW(obj), GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, _("Pattern \"%s\" was not found"), obj->priv->search_pattern);
+ w = gtk_message_dialog_new(GTK_WINDOW (obj), GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, _("Pattern \"%s\" was not found"), obj->priv->search_pattern);
gtk_dialog_run (GTK_DIALOG (w));
gtk_widget_destroy (w);
}
@@ -1141,14 +1141,11 @@
g_return_if_fail (obj);
g_return_if_fail (obj->priv->active_viewer);
- guint8 *buffer;
- guint buflen;
-
// Show the Search Dialog
- GtkWidget *w = gviewer_search_dlg_new(GTK_WINDOW(obj));
- if (gtk_dialog_run(GTK_DIALOG(w))!=GTK_RESPONSE_OK)
+ GtkWidget *w = gviewer_search_dlg_new (GTK_WINDOW (obj));
+ if (gtk_dialog_run (GTK_DIALOG (w))!=GTK_RESPONSE_OK)
{
- gtk_widget_destroy(w);
+ gtk_widget_destroy (w);
return;
}
@@ -1163,13 +1160,13 @@
}
// Get the search information from the search dialog
- GViewerSearchDlg *srch_dlg = GVIEWER_SEARCH_DLG(w);
- obj->priv->search_pattern = gviewer_search_dlg_get_search_text_string(srch_dlg);
+ GViewerSearchDlg *srch_dlg = GVIEWER_SEARCH_DLG (w);
+ obj->priv->search_pattern = gviewer_search_dlg_get_search_text_string (srch_dlg);
// Create & prepare the search object
- obj->priv->srchr = g_viewer_searcher_new();
+ obj->priv->srchr = g_viewer_searcher_new ();
- if (gviewer_search_dlg_get_search_mode(srch_dlg)==SEARCH_MODE_TEXT)
+ if (gviewer_search_dlg_get_search_mode (srch_dlg)==SEARCH_MODE_TEXT)
{
// Text search
g_viewer_searcher_setup_new_text_search(obj->priv->srchr,
@@ -1183,8 +1180,11 @@
else
{
// Hex Search
- buffer = gviewer_search_dlg_get_search_hex_buffer(srch_dlg, &buflen);
+ guint buflen;
+ guint8 *buffer = gviewer_search_dlg_get_search_hex_buffer (srch_dlg, &buflen);
+
g_return_if_fail (buffer!=NULL);
+
obj->priv->search_pattern_len = buflen;
g_viewer_searcher_setup_new_hex_search(obj->priv->srchr,
text_render_get_input_mode_data(gviewer_get_text_render(obj->priv->viewer)),
@@ -1238,15 +1238,15 @@
g_return_if_fail (obj);
g_return_if_fail (obj->priv->viewer);
- gboolean wrap = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(item));
+ gboolean wrap = gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (item));
gviewer_set_wrap_mode(obj->priv->viewer, wrap);
- gtk_widget_draw(GTK_WIDGET(obj->priv->viewer), NULL);
+ gtk_widget_draw (GTK_WIDGET (obj->priv->viewer), NULL);
if (obj->priv->exif_active)
{
gviewer_set_wrap_mode(obj->priv->exif_viewer, wrap);
- gtk_widget_draw(GTK_WIDGET(obj->priv->exif_viewer), NULL);
+ gtk_widget_draw (GTK_WIDGET (obj->priv->exif_viewer), NULL);
}
}
@@ -1256,7 +1256,7 @@
g_return_if_fail (obj);
g_return_if_fail (obj->priv->viewer);
- gboolean hex = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(item));
+ gboolean hex = gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (item));
gviewer_set_hex_offset_display(obj->priv->viewer, hex);
if (obj->priv->exif_active)
@@ -1396,7 +1396,7 @@
#endif
-inline int gviewer_window_run_exif(GViewerWindow *obj)
+inline int gviewer_window_run_exif (GViewerWindow *obj)
{
g_return_val_if_fail (obj!=NULL, -1);
g_return_val_if_fail (obj->priv->filename!=NULL, -1);
@@ -1482,18 +1482,18 @@
return;
if (obj->priv->exit_data_fd==-1)
- obj->priv->exit_data_fd = gviewer_window_run_exif(obj);
+ obj->priv->exit_data_fd = gviewer_window_run_exif (obj);
g_return_if_fail (obj->priv->exit_data_fd!=-1);
gviewer_load_filedesc(obj->priv->exif_viewer, obj->priv->exit_data_fd);
- gtk_widget_show(GTK_WIDGET(obj->priv->exif_viewer));
+ gtk_widget_show(GTK_WIDGET (obj->priv->exif_viewer));
obj->priv->exif_active = TRUE;
- gtk_box_pack_start (GTK_BOX (obj->priv->vbox), GTK_WIDGET(obj->priv->exif_viewer), TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (obj->priv->vbox), GTK_WIDGET (obj->priv->exif_viewer), TRUE, TRUE, 0);
obj->priv->active_viewer = obj->priv->exif_viewer;
- gtk_widget_grab_focus(GTK_WIDGET(obj->priv->exif_viewer));
+ gtk_widget_grab_focus (GTK_WIDGET (obj->priv->exif_viewer));
}
@@ -1506,8 +1506,8 @@
return;
obj->priv->exif_active = FALSE;
- gtk_container_remove(GTK_CONTAINER (obj->priv->vbox), GTK_WIDGET(obj->priv->exif_viewer));
- gtk_widget_grab_focus(GTK_WIDGET(obj->priv->viewer));
+ gtk_container_remove(GTK_CONTAINER (obj->priv->vbox), GTK_WIDGET (obj->priv->exif_viewer));
+ gtk_widget_grab_focus(GTK_WIDGET (obj->priv->viewer));
obj->priv->active_viewer = obj->priv->viewer;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]