File: gmc-chargrid.h

package info (click to toggle)
mc 4.1.35-1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 6,924 kB
  • ctags: 9,665
  • sloc: ansic: 84,273; tcl: 1,779; makefile: 1,266; sh: 864; perl: 262; awk: 148; sed: 93; csh: 1
file content (72 lines) | stat: -rw-r--r-- 1,990 bytes parent folder | download | duplicates (2)
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
/* GmcCharGrid Widget - Simple character grid for the gmc viewer
 *
 * Copyright (C) 1997 The Free Software Foundation
 *
 * Author: Federico Mena <federico@nuclecu.unam.mx>
 */

#ifndef GMC_CHARGRID_H
#define GMC_CHARGRID_H


#include <gdk/gdk.h>
#include <gtk/gtkwidget.h>
#include <libgnome/gnome-defs.h>


BEGIN_GNOME_DECLS


#define GMC_CHAR_GRID(obj)         GTK_CHECK_CAST (obj, gmc_char_grid_get_type (), GmcCharGrid)
#define GMC_CHAR_GRID_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gmc_char_grid_get_type (), GmcCharGridClass)
#define GMC_IS_CHAR_GRID(obj)      GTK_CHECK_TYPE (obj, gmc_char_grid_get_type ())


typedef struct _GmcCharGrid      GmcCharGrid;
typedef struct _GmcCharGridClass GmcCharGridClass;

struct _GmcCharGrid {
	GtkWidget widget;

	int width;
	int height;

	void *chars;
	void *attrs;

	int frozen : 1;

	GdkFont *font;
	GdkGC   *gc;

	int char_width;
	int char_height;
	int char_y;
};

struct _GmcCharGridClass {
	GtkWidgetClass parent_class;

	void (* size_changed) (GmcCharGrid *cgrid, guint width, guint height);
};


guint      gmc_char_grid_get_type   (void);
GtkWidget *gmc_char_grid_new        (void);

void       gmc_char_grid_clear      (GmcCharGrid *cgrid, int x, int y, int width, int height, GdkColor *bg);
void       gmc_char_grid_put_char   (GmcCharGrid *cgrid, int x, int y, GdkColor *fg, GdkColor *bg, char ch);
void       gmc_char_grid_put_string (GmcCharGrid *cgrid, int x, int y, GdkColor *fg, GdkColor *bg, char *str);
void       gmc_char_grid_put_text   (GmcCharGrid *cgrid, int x, int y, GdkColor *fg, GdkColor *bg, char *text, int length);

void       gmc_char_grid_set_font   (GmcCharGrid *cgrid, const char *font_name);
void       gmc_char_grid_set_size   (GmcCharGrid *cgrid, guint width, guint height);
void       gmc_char_grid_get_size   (GmcCharGrid *cgrid, guint *width, guint *height);

void       gmc_char_grid_freeze     (GmcCharGrid *cgrid);
void       gmc_char_grid_thaw       (GmcCharGrid *cgrid);


END_GNOME_DECLS

#endif