📄 main.c
字号:
/* * Initial main.c file generated by Glade. Edit as required. * Glade will not overwrite this file. */#ifdef HAVE_CONFIG_H# include <config.h>#endif#include <stdio.h>#include <stdlib.h>#include <string.h>#include <errno.h>#include <gnome.h>#include <glib.h>#include <unistd.h>#include <panel-applet.h>#include "interface.h"#include "support.h"#include "common.h"GThread *ui_thread;GThread *tcp_thread;gpointer ipmsg_ui_thread(gpointer data){ GtkWidget *initialContainer;#if defined(G2IPMSG_SYSTRAY) && GTK_CHECK_VERSION(2,10,0) if (hostinfo_refer_enable_systray()) { /* Note: See:start_message_watcher in recvmsg.c * Strictly speaking, status icon is not Gtk Widget, * start_message_watcher can distinguish them, * so assgin the icon to initialContainer */ initialContainer = create_ipmsg_status_icon(); g_assert(initialContainer); sleep(1); ipmsg_update_ui(); /* 組込み待ちループ */ sleep(1); } if ( (!hostinfo_refer_enable_systray()) || (!gtk_status_icon_is_embedded(GTK_STATUS_ICON(initialContainer))) ) { g_object_unref(initialContainer);#endif do{ GtkWidget *startBtn; initialContainer = create_initialWindow (); startBtn=lookup_widget(initialContainer,"startBtn"); gtk_widget_set_events (startBtn,GDK_BUTTON_PRESS_MASK); gtk_widget_show (initialContainer); }while(0);#if defined(G2IPMSG_SYSTRAY) && GTK_CHECK_VERSION(2,10,0) }#endif start_message_watcher(initialContainer); init_ipmsg(); gtk_main (); cleanup_ipmsg(); return (gpointer)0;}static intg2ipmsg_main (int argc, char *argv[]){#ifdef ENABLE_NLS bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR); bind_textdomain_codeset (PACKAGE, "UTF-8"); textdomain (PACKAGE);#endif if (create_lock_file()) exit(1); /* Can not lock */ gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE, argc, argv, GNOME_PARAM_APP_DATADIR, PACKAGE_DATA_DIR, NULL); hostinfo_init_hostinfo(); ui_thread=g_thread_create(ipmsg_ui_thread, NULL, TRUE, NULL); tcp_thread=g_thread_create(ipmsg_tcp_server_thread, (gpointer)hostinfo_get_ipmsg_system_addr_family(), FALSE, NULL); g_thread_join (ui_thread); // g_thread_join (tcp_thread); release_lock_file(); return 0;}int main(int argc, char *argv[]){ return g2ipmsg_main(argc,argv);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -