1 /*
2  * Copyright (c) 2008-2010 Lu, Chao-Ming (Tetralet).  All rights reserved.
3  *
4  * This file is part of LilyTerm.
5  *
6  * LilyTerm is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * LilyTerm is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with LilyTerm.  If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #include <gtk/gtk.h>
21 #include <vte/vte.h>
22 // for L10n
23 #include <locale.h>
24 #include <glib/gi18n.h>
25 // for exit()
26 #include <stdlib.h>
27 // for strcmp()
28 #include <string.h>
29 // for chdir()
30 #include <unistd.h>
31 // for opendir() readdir() closedir()
32 #include <dirent.h>
33 // for getpwuid()
34 #include <pwd.h>
35 // for g_chdir()
36 #include <glib/gstdio.h>
37 
38 #include "lilyterm.h"
39 
40 #ifdef USE_XPARSEGEOMETRY
41 	// for XParseGeometry()
42 	#include <X11/Xlib.h>
43 #endif
44 
45 gboolean window_option(struct Window *win_data, gchar *encoding, int argc, char *argv[]);
46 char **set_process_data (pid_t entry_pid, gint *ppid, StrAddr **cmd);
47 gboolean window_key_press(GtkWidget *widget, GdkEventKey *event, struct Window *win_data);
48 void window_style_set(GtkWidget *window, GtkStyle *previous_style, struct Window *win_data);
49 void window_size_request(GtkWidget *window, GtkRequisition *requisition, struct Window *win_data);
50 void window_size_allocate(GtkWidget *window, GtkAllocation *allocation, struct Window *win_data);
51 gboolean window_get_focus(GtkWidget *window, GdkEventFocus *event, struct Window *win_data);
52 gboolean window_lost_focus(GtkWidget *window, GdkEventFocus *event, struct Window *win_data);
53 #ifdef ENABLE_PAGE_ADDED
54 void notebook_page_added(GtkNotebook *notebook, GtkWidget *child, guint page_num, struct Window *win_data);
55 #endif
56 // void notebook_page_removed (GtkNotebook *notebook, GtkWidget *child, guint page_num, struct Window *win_data);
57 void reorder_page_after_added_removed_page(struct Window *win_data, guint page_num);
58 void destroy_window(struct Window *win_data);
59 GtkNotebook *create_window(GtkNotebook *notebook, GtkWidget *page, gint x, gint y,
60 			    struct Window *win_data);
61 gboolean window_state_event(GtkWidget *widget, GdkEventWindowState *event, struct Window *win_data);
62 #ifdef FATAL
63 void dump_data(struct Window *win_data, struct Page *page_data);
64 #endif
65 void win_data_dup(struct Window *win_data_orig, struct Window *win_data);
66 gboolean fullscreen_show_hide_scroll_bar (struct Window *win_data);
67