1/* $NetBSD: gtkviscreen.h,v 1.2 2013/11/22 15:52:05 christos Exp $ *>/ 2#ifndef __GTK_VI_SCREEN_H__ 3#define __GTK_VI_SCREEN_H__ 4 5#include <sys/types.h> 6#include "config.h" 7#include "port.h" 8#include "../common/multibyte.h" 9 10#ifdef HAVE_PANGO 11#include <pango/pango.h> 12#include <pango/pangox.h> 13#else 14#define xthickness klass->xthickness 15#define ythickness klass->ythickness 16#define GTK_CLASS_TYPE(class) class->type 17#endif 18 19#define GTK_TYPE_VI_SCREEN (gtk_vi_screen_get_type ()) 20#define GTK_VI_SCREEN(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_VI_SCREEN, GtkViScreen)) 21#define GTK_VI_SCREEN_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_VI_SCREEN, GtkViScreenClass)) 22#define GTK_IS_VI_SCREEN(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_VI_SCREEN)) 23#define GTK_IS_VI_SCREEN_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_VI_SCREEN)) 24 25typedef struct _GtkViScreen GtkViScreen; 26typedef struct _GtkViScreenClass GtkViScreenClass; 27 28struct _GtkViScreen 29{ 30 GtkWidget widget; 31 32 GdkWindow *text_area; 33 34 GtkAdjustment *vadj; 35 36 GdkGC *gc; 37 GdkGC *reverse_gc; 38 39 CHAR_T *chars; 40 guchar *endcol; 41 guchar *reverse; 42 guchar color; 43 44 gint cols, rows; 45 gint ch_width, ch_height, ch_ascent; 46 gint curx, cury; /* character position */ 47 gint lastx, lasty; 48 gint marked_x, marked_y, marked_maxx, marked_maxy; 49 50#ifdef HAVE_PANGO 51 PangoContext *conx; 52 PangoAttrList* alist; 53#endif 54}; 55 56struct _GtkViScreenClass 57{ 58 GtkWidgetClass parent_class; 59 60 void (*rename) (GtkViScreen *vi, gchar *name, gint len); 61 void (*resized) (GtkViScreen *vi, gint width, gint height); 62}; 63 64GtkType gtk_vi_screen_get_type (void); 65GtkWidget* gtk_vi_screen_new (GtkAdjustment *vadj); 66void gtk_vi_screen_set_adjustment (GtkViScreen *vi_screen, 67 GtkAdjustment *vadj); 68void gtk_vi_screen_move (GtkViScreen *vi, gint row, gint col); 69void gtk_vi_screen_clrtoel (GtkViScreen *vi); 70void gtk_vi_screen_attribute(GtkViScreen *vi, gint attribute, gint on); 71void gtk_vi_screen_addstr (GtkViScreen *vi, const char *str, int len); 72void gtk_vi_screen_deleteln (GtkViScreen *vi); 73void gtk_vi_screen_insertln (GtkViScreen *vi); 74void gtk_vi_screen_refresh (GtkViScreen *vi); 75void gtk_vi_screen_rewrite (GtkViScreen *vi, gint row); 76 77#endif /* __GTK_VI_SCREEN_H__ */ 78