File: support.c

package info (click to toggle)
gbatnav 1.0.4cvs20051004-8
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 4,780 kB
  • sloc: ansic: 14,122; sh: 11,667; makefile: 643; yacc: 288; xml: 42; sed: 16
file content (108 lines) | stat: -rw-r--r-- 3,042 bytes parent folder | download | duplicates (4)
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
/*	$Id: support.c,v 1.1 2001/04/06 15:15:22 riq Exp $	*/
/* Tenes Empanadas Graciela
 *
 * Copyright (C) 2000 Ricardo Quesada
 *
 * Author: Ricardo Calixto Quesada <rquesada@core-sdi.com>
 *
 * 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 details.
 *
 * 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.
 */
/**
 * @file support.c
 * Funciones de support
 */

#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include <stdio.h>

#include <goocanvas.h>

#include "support.h"
#include "protocol.h"
#include "cliente.h"
#include "proceso.h"
#include "g_interface.h"
#include "pantalla.h"
#include "gbnclient.h"
#include "sendmsg.h"
#include "configure.h"
#include "bnwrite.h"
#include "version.h"

/* FONTS */
#define HELVETICA_20_BFONT "-adobe-helvetica-bold-r-normal-*-20-*-*-*-*-*-*-*"
#define HELVETICA_14_BFONT "-adobe-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*"
#define HELVETICA_12_BFONT "-adobe-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*"
#define HELVETICA_12_FONT  "-adobe-helvetica-medium-r-normal-*-12-*-*-*-*-*-*-*"
#define HELVETICA_10_FONT  "-adobe-helvetica-medium-r-normal-*-10-*-*-*-*-*-*-*"

#define TEG_DIALOG_X	300
#define TEG_DIALOG_Y	200
#define TEG_DIALOG_Y_NEW 45

/**
 * @fn GtkWidget* teg_dialog_new( char* title, char* bigtitle )
 * Crea un gnome_dialog_new un poco diferente
 */
GtkWidget* teg_dialog_new( char* title, char* bigtitle )
{
	GtkWidget* dialog;
	GtkWidget* canvas;
	GooCanvasItem *item;

	dialog = gtk_dialog_new();
	gtk_window_set_title(GTK_WINDOW(dialog), title);
	gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(window));

	canvas = goo_canvas_new();
	g_object_set (canvas, "anchor", GOO_CANVAS_ANCHOR_CENTER, NULL);
	gtk_widget_set_size_request (canvas, TEG_DIALOG_X, TEG_DIALOG_Y_NEW);
	goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0,
	                       TEG_DIALOG_X, TEG_DIALOG_Y_NEW);

	item = goo_canvas_get_root_item(GOO_CANVAS(canvas));
	goo_canvas_rect_new(
		item,
		0.0,
		0.0,
		(double) TEG_DIALOG_X,
		45.0,
		"fill-color", "black",
		"stroke-color", "black",
		NULL);

	goo_canvas_text_new(
		item,
		bigtitle,
		(double) (TEG_DIALOG_X/2),
		(double) 10,
		-1,
		GOO_CANVAS_ANCHOR_NORTH,
		"font", HELVETICA_20_BFONT,
		"fill-color", "white",
		NULL);


	gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area
	                           (GTK_DIALOG(dialog))), GTK_WIDGET(canvas),
	                   FALSE, FALSE, 0);

	gtk_widget_show (canvas);

	return dialog;
}