From d9e203fd6d084e66dfe3b3175a6810d289f39f03 Mon Sep 17 00:00:00 2001 From: ehouse Date: Sun, 29 May 2005 20:39:01 +0000 Subject: [PATCH] New fields in drawCtxt for pango-based text layout; other tweaks for switch to GTK 2.n. --- linux/gtkmain.h | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/linux/gtkmain.h b/linux/gtkmain.h index 938e8e4fe..61b7056e1 100644 --- a/linux/gtkmain.h +++ b/linux/gtkmain.h @@ -1,4 +1,5 @@ -/* Copyright 1997 - 2002 by Eric House (fixin@peak.org) (fixin@peak.org). All rights reserved. +/* -*- mode: C; fill-column: 78; c-basic-offset: 4; -*- */ +/* Copyright 1997 - 2005 by Eric House (fixin@peak.org) (fixin@peak.org). All rights reserved. * 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 @@ -20,17 +21,25 @@ #ifdef PLATFORM_GTK #include #include +#include #include "draw.h" #include "main.h" #include "game.h" #include "dictnry.h" +enum { + LAYOUT_BOARD + ,LAYOUT_SMALL + ,LAYOUT_LARGE + ,LAYOUT_NLAYOUTS +}; + typedef struct GtkDrawCtx { DrawCtxVTable* vtable; /* GdkDrawable* pixmap; */ - GtkWidget* widget; + GtkWidget* drawing_area; struct GtkAppGlobals* globals; GdkGC* drawGC; @@ -38,13 +47,16 @@ typedef struct GtkDrawCtx { GdkColor black; GdkColor white; GdkColor red; /* for pending tiles */ + GdkColor tileBack; /* for pending tiles */ GdkColor bonusColors[4]; GdkColor playerColors[MAX_NUM_PLAYERS]; - GdkFont *gdkFont; - GdkFont *gdkBoldFont; - GdkFont *gdkTrayFont; - gint trayFontHeight; + /* new for gtk 2.0 */ + PangoContext* pangoContext; + PangoFontDescription* fontdesc[LAYOUT_NLAYOUTS]; + PangoLayout* layout[LAYOUT_NLAYOUTS]; + + XP_U16 trayOwner; } GtkDrawCtx; typedef struct ClientStreamRec { @@ -58,6 +70,9 @@ typedef struct GtkAppGlobals { GtkWidget* window; GtkDrawCtx* draw; +/* GdkPixmap* pixmap; */ + GtkWidget* drawing_area; + EngineCtxt* engine; guint idleID; @@ -95,7 +110,7 @@ int gtkmain( XP_Bool isServer, LaunchParams* params, int argc, char *argv[] ); #define SCORE_BOARD_PADDING 0 #define HOR_SCORE_LEFT (BOARD_LEFT_MARGIN) -#define HOR_SCORE_HEIGHT 8 +#define HOR_SCORE_HEIGHT 12 #define TIMER_HEIGHT HOR_SCORE_HEIGHT #define HOR_SCORE_TOP (TOP_MARGIN) #define TIMER_PAD 10