📄 gsegyview.c
字号:
/* * GSEGYView - the viewer itself, main file * * Copyright (C) 2006 Vladimir Bashkardin * * 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 Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more av. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * * Author: Vladimir Bashkardin <vovizmus@users.sourceforge.net> */#include <gtk/gtk.h>#include <gtk/gtkgl.h>#include <ui/gsegyfileaux.h>#include "gsegyviewmainwindow.h"static void main_window_close_func (GSEGYViewMainWindow* main_window, gpointer data) { g_object_unref (G_OBJECT (main_window)); gtk_main_quit ();}typedef struct _GSEGYViewMainWindowFilename GSEGYViewMainWindowFilename;struct _GSEGYViewMainWindowFilename { GSEGYViewMainWindow *main_window; const gchar *filename;};static gboolean main_window_set_filename_idle (GSEGYViewMainWindowFilename* main_window_filename) { gdk_threads_enter (); g_segy_view_main_window_set_filename (main_window_filename->main_window, main_window_filename->filename); gdk_threads_leave (); return FALSE;}int main (int argc, char *argv[]) { GSEGYViewMainWindowFilename main_window_filename; GSEGYViewMainWindow *main_object; GtkWidget *main_window; gsegy_view_init_dirs (argc, argv);#ifndef DISABLE_NLS bindtextdomain (PACKAGE_NAME, (gchar*)gsegy_view_get_locale_dir); bind_textdomain_codeset (PACKAGE_NAME, "UTF-8"); textdomain (PACKAGE_NAME);#endif g_thread_init (NULL); gdk_threads_init (); gdk_threads_enter (); gtk_set_locale (); gtk_init (&argc, &argv); gdk_gl_init (&argc, &argv);#ifdef WIN32 gchar *wimprc = g_strconcat (gsegy_view_get_data_dir (), "\\etc\\gtk-2.0\\gtkrc.wimp", NULL); gtk_rc_parse (wimprc); g_free (wimprc);#endif main_object = g_segy_view_main_window_new (); g_signal_connect (G_OBJECT (main_object), "window_close", (GCallback)main_window_close_func, NULL); main_window = g_segy_view_main_window_get_main_widget (main_object); gtk_widget_show_all (main_window); if (argc > 1 && argv[1]) { main_window_filename.main_window = main_object; if (g_str_has_prefix (argv[1], "file://")) main_window_filename.filename = &argv[1][7]; else main_window_filename.filename = argv[1]; g_idle_add ((GSourceFunc)main_window_set_filename_idle, (gpointer)&main_window_filename); } gtk_main (); gdk_threads_leave (); return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -