summaryrefslogtreecommitdiff
path: root/gtk/gtk_gui.c
blob: b0109ed5accdfd02f82ecff0790126e499602cb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/*
 * This file is part of NetSurf, http://netsurf.sourceforge.net/
 * Licensed under the GNU General Public License,
 *                http://www.opensource.org/licenses/gpl-license
 * Copyright 2004 James Bursa <bursa@users.sourceforge.net>
 */

#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#include "netsurf/content/content.h"
#include "netsurf/desktop/browser.h"
#include "netsurf/desktop/netsurf.h"
#include "netsurf/render/box.h"
#include "netsurf/render/form.h"
#include "netsurf/utils/messages.h"
#include "netsurf/utils/utils.h"


static bool gui_start = true;
bool gui_in_multitask = false;


void gui_init(int argc, char** argv)
{
	gtk_init(&argc, &argv);
	messages_load("messages");
}


void gui_poll(bool active)
{
	if (gui_start) {
		browser_window_create("", 0);
		gui_start = false;
	}

	/*netsurf_quit =*/ gtk_main_iteration_do(!active);
}


void gui_multitask(void)
{
	gui_in_multitask = true;
	while (gtk_events_pending())
		/*netsurf_quit =*/ gtk_main_iteration();
	gui_in_multitask = false;
}


void gui_quit(void)
{
}




gui_window *gui_create_download_window(struct content *content)
{
	return 0;
}


void gui_download_window_update_status(gui_window *g)
{
}


void gui_download_window_done(gui_window *g)
{
}


void gui_download_window_error(gui_window *g, const char *error)
{
}


void gui_gadget_combo(struct browser_window* bw, struct form_control* g,
		unsigned long mx, unsigned long my)
{
}


void gui_launch_url(const char *url)
{
}


void warn_user(const char *warning, const char *detail)
{
}





void html_add_instance(struct content *c, struct browser_window *bw,
		struct content *page, struct box *box,
		struct object_params *params, void **state) {}
void html_reshape_instance(struct content *c, struct browser_window *bw,
		struct content *page, struct box *box,
		struct object_params *params, void **state) {}
void html_remove_instance(struct content *c, struct browser_window *bw,
		struct content *page, struct box *box,
		struct object_params *params, void **state) {}


void die(const char * const error)
{
	fprintf(stderr, error);
	exit(EXIT_FAILURE);
}


struct history *history_create(void) { return 0; }
void history_add(struct history *history, struct content *content) {}
void history_update(struct history *history, struct content *content) {}
void history_destroy(struct history *history) {}
void history_back(struct browser_window *bw, struct history *history) {}
void history_forward(struct browser_window *bw, struct history *history) {}

struct content *about_create(const char *url,
		void (*callback)(content_msg msg, struct content *c, void *p1,
			void *p2, const char *error),
		void *p1, void *p2, unsigned long width, unsigned long height)
{ return 0; }

void gui_401login_open(struct browser_window *bw, struct content *c,
                       char *realm) {}