Re: Solitaire hacks
- From: Paul Flinders <paul dawa demon co uk>
- To: Miguel de Icaza <miguel nuclecu unam mx>
- Cc: gnome-list gnome org
- Subject: Re: Solitaire hacks
- Date: 07 May 1998 19:58:49 +0100
Miguel de Icaza <miguel@nuclecu.unam.mx> writes:
> > I'm somewhat reluctant to post the patches as they're just over 90k
> > compressed (most of this is changing the card xpms) - is there somewhere
> > else I can send them?
>
> Could you post only the non-card diffs? I assume Jonathan will mail
> you for getting the full patch.
Here are the patches except for the cards - no hookup to the config
stuff and I know that Jonathan doesn't like the freecell cards but
anyway...
I want to look at the config stuff but in may take me a day or two¹ to
find some time
¹ Ever the optimist :-)
diff -r -N -c gnome-games/aisleriot/Makefile.am gnome-games-mod/aisleriot/Makefile.am
*** gnome-games/aisleriot/Makefile.am Mon May 4 19:54:22 1998
--- gnome-games-mod/aisleriot/Makefile.am Mon May 4 18:41:14 1998
***************
*** 23,28 ****
--- 23,29 ----
dialog.c \
cscmi.c \
events.c \
+ option.c \
press_data.c \
draw.c \
menu.c \
diff -r -N -c gnome-games/aisleriot/card.c gnome-games-mod/aisleriot/card.c
*** gnome-games/aisleriot/card.c Mon May 4 19:54:39 1998
--- gnome-games-mod/aisleriot/card.c Tue May 5 19:45:18 1998
***************
*** 19,32 ****
#include "card.h"
#include "pixmaps/cards.h"
! #include "pixmaps/slot.xpm"
! #include "pixmaps/back.xpm"
! #include "pixmaps/background.xpm"
GdkPixmap *default_background_pixmap;
GdkPixmap *slot_pixmap;
GdkPixmap *card_back_pixmap;
GdkPixmap *card_pixmaps[52];
GdkBitmap *mask;
GdkPixmap* get_card_picture(gint suit, gint value ) {
--- 19,34 ----
#include "card.h"
#include "pixmaps/cards.h"
! #include "pixmaps/backs.h"
! #include "pixmaps/backgrounds.h"
GdkPixmap *default_background_pixmap;
GdkPixmap *slot_pixmap;
GdkPixmap *card_back_pixmap;
GdkPixmap *card_pixmaps[52];
+ GdkPixmap *card_backs[NBACKS];
+ GdkPixmap *backgrounds[NBACKGROUNDS];
+ GdkPixmap *slots[NBACKGROUNDS];
GdkBitmap *mask;
GdkPixmap* get_card_picture(gint suit, gint value ) {
***************
*** 37,55 ****
}
! GdkPixmap* get_background_pixmap() {
return default_background_pixmap;
}
! GdkPixmap* get_slot_pixmap() {
return slot_pixmap;
}
! GdkPixmap* get_card_back_pixmap() {
return card_back_pixmap;
}
int get_card_width() {
int width, height;
gdk_window_get_size(card_back_pixmap, &width, &height);
--- 39,73 ----
}
! GdkPixmap* get_current_background_pixmap() {
return default_background_pixmap;
}
! void set_background_pixmap(GdkPixmap* pm) {
!
! default_background_pixmap = pm;
! }
!
! void set_background(int i) {
!
! default_background_pixmap = backgrounds[i];
! slot_pixmap = slots[i];
!
! }
!
! GdkPixmap* get_current_slot_pixmap() {
return slot_pixmap;
}
! GdkPixmap* get_current_card_back_pixmap() {
return card_back_pixmap;
}
+ void set_card_back_pixmap(GdkPixmap* pm) {
+ card_back_pixmap = pm;
+ }
+
int get_card_width() {
int width, height;
gdk_window_get_size(card_back_pixmap, &width, &height);
***************
*** 78,83 ****
--- 96,112 ----
return 30;
}
+ int get_number_of_card_backs()
+ {
+ return NBACKS;
+ }
+
+ int get_number_of_backgrounds()
+ {
+ return NBACKGROUNDS;
+ }
+
+
static GdkPixmap *
get_pixmap (char **data)
{
***************
*** 95,103 ****
void load_pixmaps(GtkWidget* app) {
/* cruft */
mask = gdk_bitmap_create_from_data(app->window, mask_bits, mask_width, mask_height);
- slot_pixmap = get_pixmap (slot_xpm);
- card_back_pixmap = get_pixmap (back_xpm);
- default_background_pixmap = get_pixmap (background_xpm);
/* cards */
/* we should put a load bar here... */
--- 124,129 ----
***************
*** 153,158 ****
--- 179,206 ----
card_pixmaps[49] = get_pixmap (queenspade_xpm);
card_pixmaps[50] = get_pixmap (kingspade_xpm);
card_pixmaps[51] = get_pixmap (acespade_xpm);
+ card_backs[0] = get_pixmap (cardback0_xpm);
+ card_backs[1] = get_pixmap (cardback1_xpm);
+ card_backs[2] = get_pixmap (cardback2_xpm);
+ card_backs[3] = get_pixmap (cardback3_xpm);
+ card_backs[4] = get_pixmap (cardback4_xpm);
+ card_backs[5] = get_pixmap (cardback5_xpm);
+ backgrounds[0] = get_pixmap (background0_xpm);
+ backgrounds[1] = get_pixmap (background1_xpm);
+ backgrounds[2] = get_pixmap (background2_xpm);
+ backgrounds[3] = get_pixmap (background3_xpm);
+ backgrounds[4] = get_pixmap (background4_xpm);
+ backgrounds[5] = get_pixmap (background5_xpm);
+ slots[0] = get_pixmap (slot0_xpm);
+ slots[1] = get_pixmap (slot1_xpm);
+ slots[2] = get_pixmap (slot2_xpm);
+ slots[3] = get_pixmap (slot3_xpm);
+ slots[4] = get_pixmap (slot4_xpm);
+ slots[5] = get_pixmap (slot5_xpm);
+
+ slot_pixmap = slots[0];
+ card_back_pixmap = card_backs[0];
+ default_background_pixmap = backgrounds[0];
}
void add_card(GList** card_list, hcard_type temp_card) {
diff -r -N -c gnome-games/aisleriot/card.h gnome-games-mod/aisleriot/card.h
*** gnome-games/aisleriot/card.h Mon May 4 19:54:39 1998
--- gnome-games-mod/aisleriot/card.h Tue May 5 19:50:56 1998
***************
*** 49,63 ****
extern GdkPixmap *slot_pixmap;
extern GdkPixmap *card_back_pixmap;
extern GdkPixmap card_pixmaps[52];
extern GdkBitmap *mask;
#endif
/*
* Functions
*/
GdkPixmap* get_card_picture(gint, gint);
! GdkPixmap* get_slot_pixmap();
! GdkPixmap* get_background_pixmap();
! GdkPixmap* get_card_back_pixmap();
void load_pixmaps(GtkWidget*);
--- 49,67 ----
extern GdkPixmap *slot_pixmap;
extern GdkPixmap *card_back_pixmap;
extern GdkPixmap card_pixmaps[52];
+ extern GdkPixmap *card_backs[6];
+ extern GdkPixmap *backgrounds[6];
extern GdkBitmap *mask;
#endif
/*
* Functions
*/
GdkPixmap* get_card_picture(gint, gint);
! GdkPixmap* get_current_slot_pixmap();
! GdkPixmap* get_current_background_pixmap();
! GdkPixmap* get_current_card_back_pixmap();
! void set_background_pixmap(GdkPixmap* pm);
! void set_card_back_pixmap(GdkPixmap* pm);
void load_pixmaps(GtkWidget*);
***************
*** 67,72 ****
--- 71,78 ----
int get_vert_offset();
int get_vert_start();
int get_horiz_start();
+ int get_number_of_card_backs();
+ int get_number_of_backgrounds();
void add_card(GList**, hcard_type);
#endif
diff -r -N -c gnome-games/aisleriot/dialog.h gnome-games-mod/aisleriot/dialog.h
*** gnome-games/aisleriot/dialog.h Mon May 4 19:54:41 1998
--- gnome-games-mod/aisleriot/dialog.h Mon May 4 18:40:12 1998
***************
*** 9,14 ****
--- 9,15 ----
void show_game_over_dialog(gboolean);
void show_load_game_dialog();
void show_hint_dialog(char*);
+ void show_option_dialog (GtkWidget *widget, GdkEvent *event);
#endif
Binary files gnome-games/aisleriot/dialog.o and gnome-games-mod/aisleriot/dialog.o differ
diff -r -N -c gnome-games/aisleriot/draw.c gnome-games-mod/aisleriot/draw.c
*** gnome-games/aisleriot/draw.c Mon May 4 19:54:46 1998
--- gnome-games-mod/aisleriot/draw.c Tue May 5 21:42:58 1998
***************
*** 47,54 ****
if (temp_card->direction == DOWN) {
gdk_gc_set_clip_origin(gc,((hslot_type)listptr->data)->x,((hslot_type)listptr->data)->y);
! gdk_draw_pixmap(pix, playing_area->style->black_gc, get_card_back_pixmap(), 0,0,
! ((hslot_type)listptr->data)->x, ((hslot_type)listptr->data)->y, -1, -1);
}
else {
tempPix = get_card_picture(temp_card->suit, temp_card->value);
--- 47,56 ----
if (temp_card->direction == DOWN) {
gdk_gc_set_clip_origin(gc,((hslot_type)listptr->data)->x,((hslot_type)listptr->data)->y);
! gdk_draw_pixmap(pix, playing_area->style->black_gc,
! get_current_card_back_pixmap(), 0,0,
! ((hslot_type)listptr->data)->x,
! ((hslot_type)listptr->data)->y, -1, -1);
}
else {
tempPix = get_card_picture(temp_card->suit, temp_card->value);
***************
*** 73,80 ****
/* print it the right direction */
if (temp_card->direction == DOWN) {
gdk_gc_set_clip_origin(gc,((hslot_type)listptr->data)->x,((hslot_type)listptr->data)->y + vert_offset);
! gdk_draw_pixmap(pix, playing_area->style->black_gc, get_card_back_pixmap(), 0,0,
! ((hslot_type)listptr->data)->x, ((hslot_type)listptr->data)->y + vert_offset, -1, -1);
}
else {
tempPix = get_card_picture(temp_card->suit, temp_card->value);
--- 75,84 ----
/* print it the right direction */
if (temp_card->direction == DOWN) {
gdk_gc_set_clip_origin(gc,((hslot_type)listptr->data)->x,((hslot_type)listptr->data)->y + vert_offset);
! gdk_draw_pixmap(pix, playing_area->style->black_gc,
! get_current_card_back_pixmap(), 0,0,
! ((hslot_type)listptr->data)->x,
! ((hslot_type)listptr->data)->y + vert_offset, -1, -1);
}
else {
tempPix = get_card_picture(temp_card->suit, temp_card->value);
***************
*** 101,108 ****
/* print it the right direction */
if (temp_card->direction == DOWN) {
gdk_gc_set_clip_origin(gc,((hslot_type)listptr->data)->x + horiz_offset,((hslot_type)listptr->data)->y);
! gdk_draw_pixmap(pix, playing_area->style->black_gc, get_card_back_pixmap(), 0,0,
! ((hslot_type)listptr->data)->x + horiz_offset, ((hslot_type)listptr->data)->y, -1, -1);
}
else {
tempPix = get_card_picture(temp_card->suit, temp_card->value);
--- 105,114 ----
/* print it the right direction */
if (temp_card->direction == DOWN) {
gdk_gc_set_clip_origin(gc,((hslot_type)listptr->data)->x + horiz_offset,((hslot_type)listptr->data)->y);
! gdk_draw_pixmap(pix, playing_area->style->black_gc,
! get_current_card_back_pixmap(), 0,0,
! ((hslot_type)listptr->data)->x + horiz_offset,
! ((hslot_type)listptr->data)->y, -1, -1);
}
else {
tempPix = get_card_picture(temp_card->suit, temp_card->value);
***************
*** 135,142 ****
/* print it the right direction */
if (temp_card->direction == DOWN) {
gdk_gc_set_clip_origin(gc,((hslot_type)listptr->data)->x,((hslot_type)listptr->data)->y + vert_offset);
! gdk_draw_pixmap(pix, playing_area->style->black_gc, get_card_back_pixmap(), 0,0,
! ((hslot_type)listptr->data)->x, ((hslot_type)listptr->data)->y + vert_offset, -1, -1);
}
else {
tempPix = get_card_picture(temp_card->suit, temp_card->value);
--- 141,150 ----
/* print it the right direction */
if (temp_card->direction == DOWN) {
gdk_gc_set_clip_origin(gc,((hslot_type)listptr->data)->x,((hslot_type)listptr->data)->y + vert_offset);
! gdk_draw_pixmap(pix, playing_area->style->black_gc,
! get_current_card_back_pixmap(), 0,0,
! ((hslot_type)listptr->data)->x,
! ((hslot_type)listptr->data)->y + vert_offset, -1, -1);
}
else {
tempPix = get_card_picture(temp_card->suit, temp_card->value);
***************
*** 168,175 ****
/* print it the right direction */
if (temp_card->direction == DOWN) {
gdk_gc_set_clip_origin(gc,((hslot_type)listptr->data)->x + horiz_offset,((hslot_type)listptr->data)->y);
! gdk_draw_pixmap(pix, playing_area->style->black_gc, get_card_back_pixmap(), 0,0,
! ((hslot_type)listptr->data)->x + horiz_offset, ((hslot_type)listptr->data)->y, -1, -1);
}
else {
tempPix = get_card_picture(temp_card->suit, temp_card->value);
--- 176,185 ----
/* print it the right direction */
if (temp_card->direction == DOWN) {
gdk_gc_set_clip_origin(gc,((hslot_type)listptr->data)->x + horiz_offset,((hslot_type)listptr->data)->y);
! gdk_draw_pixmap(pix, playing_area->style->black_gc,
! get_current_card_back_pixmap(), 0,0,
! ((hslot_type)listptr->data)->x + horiz_offset,
! ((hslot_type)listptr->data)->y, -1, -1);
}
else {
tempPix = get_card_picture(temp_card->suit, temp_card->value);
***************
*** 199,209 ****
gdk_gc_set_clip_mask(gc,mask);
gdk_gc_set_clip_origin(gc,x,y);
gdk_draw_pixmap(pix,
! playing_area->style->black_gc,
! get_slot_pixmap(),
! 0,0,
! x, y,
! -1, -1);
gdk_gc_set_clip_mask(gc,NULL);
return;
}
--- 209,219 ----
gdk_gc_set_clip_mask(gc,mask);
gdk_gc_set_clip_origin(gc,x,y);
gdk_draw_pixmap(pix,
! playing_area->style->black_gc,
! get_current_slot_pixmap(),
! 0,0,
! x, y,
! -1, -1);
gdk_gc_set_clip_mask(gc,NULL);
return;
}
***************
*** 217,227 ****
gdk_gc_set_clip_mask(gc,mask);
gdk_gc_set_clip_origin(gc,x,y);
gdk_draw_pixmap(pix,
! playing_area->style->black_gc,
! get_slot_pixmap(),
! 0,0,
! x,y,
! -1, -1);
gdk_gc_set_clip_mask(gc,NULL);
return;
}
--- 227,237 ----
gdk_gc_set_clip_mask(gc,mask);
gdk_gc_set_clip_origin(gc,x,y);
gdk_draw_pixmap(pix,
! playing_area->style->black_gc,
! get_current_slot_pixmap(),
! 0,0,
! x,y,
! -1, -1);
gdk_gc_set_clip_mask(gc,NULL);
return;
}
***************
*** 282,288 ****
printf("paint_blank_surface\n");
#endif
! gdk_window_get_size (get_background_pixmap(), &dbp_width, &dbp_height);
gdk_window_get_size (blank_surface, &bs_width, &bs_height);
/* tile the surface with the default background */
--- 292,299 ----
printf("paint_blank_surface\n");
#endif
! gdk_window_get_size (get_current_background_pixmap(),
! &dbp_width, &dbp_height);
gdk_window_get_size (blank_surface, &bs_width, &bs_height);
/* tile the surface with the default background */
***************
*** 290,296 ****
for (j = 0; j < bs_height; j += dbp_height)
gdk_draw_pixmap(blank_surface,
playing_area->style->black_gc,
! get_background_pixmap(),
0,0,
i,j,
-1, -1);
--- 301,307 ----
for (j = 0; j < bs_height; j += dbp_height)
gdk_draw_pixmap(blank_surface,
playing_area->style->black_gc,
! get_current_background_pixmap(),
0,0,
i,j,
-1, -1);
diff -r -N -c gnome-games/aisleriot/freecell.scm gnome-games-mod/aisleriot/freecell.scm
*** gnome-games/aisleriot/freecell.scm Mon May 4 19:54:51 1998
--- gnome-games-mod/aisleriot/freecell.scm Mon May 4 18:51:21 1998
***************
*** 142,162 ****
(not (empty-slot? slot-id))))))
(define (button-released start-slot-id card-list end-slot-id)
! (cond ((homecell? end-slot-id) (move-to-homecell card-list end-slot-id))
((field? end-slot-id) (move-to-field card-list end-slot-id))
(else (move-to-freecell card-list end-slot-id))))
(define (button-clicked slot-id)
#f)
! (define (button-double-clicked slot-id)
! #f)
(define (game-over ugh)
! #t)
(define (game-won ugh)
! #f)
(define (get-hint ugh)
#f)
--- 142,219 ----
(not (empty-slot? slot-id))))))
(define (button-released start-slot-id card-list end-slot-id)
! (cond ((homecell? end-slot-id)
! (move-to-homecell card-list end-slot-id))
((field? end-slot-id) (move-to-field card-list end-slot-id))
(else (move-to-freecell card-list end-slot-id))))
(define (button-clicked slot-id)
#f)
! ;; these are basically the same as klondike apart from the slot ids
! (define (place-ace card slot)
! (remove-card slot)
! (if (empty-slot? 4)
! (complete-transaction slot (list card) 4)
! (if (empty-slot? 5)
! (complete-transaction slot (list card) 5)
! (if (empty-slot? 6)
! (complete-transaction slot (list card) 6)
! (complete-transaction slot (list card) 7)))))
!
! (define (button-double-clicked slot)
! (if (and (not (empty-slot? slot))
! (or (field? slot)
! (freecell? slot)))
! (let ((top-card (get-top-card slot)))
! (if (eq? (get-value top-card) ace)
! (place-ace top-card slot)
! (if (and (not (empty-slot? 4))
! (eq? (- (get-value top-card) 1) (get-value (get-top-card 4)))
! (eq? (get-suit top-card) (get-suit (get-top-card 4))))
! (begin
! (remove-card slot)
! (complete-transaction slot (list top-card) 4))
! (if
! (and (not (empty-slot? 5))
! (eq? (- (get-value top-card) 1) (get-value (get-top-card 5)))
! (eq? (get-suit top-card) (get-suit (get-top-card 5))))
! (begin
! (remove-card slot)
! (complete-transaction slot (list top-card) 5))
! (if
! (and (not (empty-slot? 6))
! (eq? (- (get-value top-card) 1) (get-value (get-top-card 6)))
! (eq? (get-suit top-card) (get-suit (get-top-card 6))))
! (begin
! (remove-card slot)
! (complete-transaction slot (list top-card) 6))
! (if
! (and (not (empty-slot? 7))
! (eq? (- (get-value top-card) 1) (get-value (get-top-card 7)))
! (eq? (get-suit top-card) (get-suit (get-top-card 7))))
! (begin
! (remove-card slot)
! (complete-transaction slot (list top-card) 7))
! #f)))))
! #f)))
(define (game-over ugh)
! (if (and (= 13 (list-length (get-cards 4)))
! (= 13 (list-length (get-cards 5)))
! (= 13 (list-length (get-cards 6)))
! (= 13 (list-length (get-cards 7))))
! #f
! #t))
!
(define (game-won ugh)
! (if (and (= 13 (list-length (get-cards 4)))
! (= 13 (list-length (get-cards 5)))
! (= 13 (list-length (get-cards 6)))
! (= 13 (list-length (get-cards 7))))
! #t
! #f))
(define (get-hint ugh)
#f)
diff -r -N -c gnome-games/aisleriot/menu.c gnome-games-mod/aisleriot/menu.c
*** gnome-games/aisleriot/menu.c Mon May 4 19:54:52 1998
--- gnome-games-mod/aisleriot/menu.c Mon May 4 18:41:48 1998
***************
*** 38,43 ****
--- 38,44 ----
return TRUE;
}
+
int game_hint_callback (GtkWidget *app, void *data)
{
SCM hint;
***************
*** 182,187 ****
--- 183,190 ----
{GNOME_APP_UI_SUBTREE, N_("Variation"), NULL, variation_menu, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL, 0, 0, NULL},
{GNOME_APP_UI_ITEM, N_("Hint"), NULL, game_hint_callback, NULL, NULL,
+ GNOME_APP_PIXMAP_NONE, NULL, 0, 0, NULL},
+ {GNOME_APP_UI_ITEM, N_("Options"), NULL, show_option_dialog, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL, 0, 0, NULL},
{GNOME_APP_UI_ENDOFINFO, NULL, NULL, NULL, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL, 0, 0, NULL},
Binary files gnome-games/aisleriot/menu.o and gnome-games-mod/aisleriot/menu.o differ
diff -r -N -c gnome-games/aisleriot/option.c gnome-games-mod/aisleriot/option.c
*** gnome-games/aisleriot/option.c Thu Jan 1 01:00:00 1970
--- gnome-games-mod/aisleriot/option.c Tue May 5 21:42:46 1998
***************
*** 0 ****
--- 1,169 ----
+ /* Aisleriot - menu.c
+ * Copyright (C) 1998 Jonathan Blandford <jrb@mit.edu>
+ *
+ * This game is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+ #define MENU_C
+ #include <config.h>
+ #include <guile/gh.h>
+ #include "sol.h"
+ #include "menu.h"
+ #include "draw.h"
+ #include "cscmi.h"
+ #include "dialog.h"
+ /*
+ * Menu stuff...
+ */
+
+ static GdkPixmap* new_back_pixmap;
+ static int new_background = 0;
+
+ static void
+ optionsApply(GtkWidget *w, int page, GtkWidget *window)
+ {
+ set_card_back_pixmap(new_back_pixmap);
+ set_background(new_background);
+ refresh_screen();
+ }
+
+ static int
+ optionsCancel(GtkWidget *w, GtkWidget *window)
+ {
+ return FALSE;
+ }
+
+ static void
+ choseBack(GtkButton *button, GtkWidget *propbox)
+ {
+ GList *child_list = gtk_container_children (GTK_CONTAINER(button));
+ gtk_pixmap_get (child_list->data, &new_back_pixmap, 0);
+ g_list_free (child_list);
+ gnome_property_box_changed (GNOME_PROPERTY_BOX (propbox));
+ }
+
+ static void
+ choseBackground(GtkButton *button, GtkWidget *propbox)
+ {
+ new_background = (int)gtk_object_get_data (GTK_OBJECT(button), "index");
+ gnome_property_box_changed (GNOME_PROPERTY_BOX (propbox));
+ }
+
+ /* Will move to another file if it develops */
+ GtkWidget *
+ option_dialog (void)
+ {
+ int i;
+ GtkWidget *propbox = 0;
+ GtkWidget *pixmap;
+ GtkWidget *pbutton;
+
+ GtkWidget *box1;
+ GtkWidget *box2;
+ GtkWidget *check;
+ GtkWidget *label1;
+ GtkWidget *label2;
+
+ propbox = gnome_property_box_new ();
+ gtk_window_set_title (GTK_WINDOW(&GNOME_PROPERTY_BOX(propbox)->dialog.window),
+ _("Solitare Properties"));
+
+ /* the first option frame. */
+ box1 = gtk_hbox_new (TRUE, 4);
+ gtk_widget_show (box1);
+
+ for (i = 0; i < get_number_of_card_backs(); i++)
+ {
+ pixmap = gtk_pixmap_new(card_backs[i], mask);
+ pbutton = gtk_button_new ();
+ gtk_widget_show(pixmap);
+ gtk_widget_show(pbutton);
+
+ gtk_signal_connect(GTK_OBJECT(pbutton), "pressed",
+ (GtkSignalFunc)choseBack, propbox);
+
+ gtk_container_add(GTK_CONTAINER(pbutton), pixmap);
+ gtk_container_add(GTK_CONTAINER(box1), pbutton);
+ }
+
+ label2 = gtk_label_new (_("Card Backs"));
+ gnome_property_box_append_page (GNOME_PROPERTY_BOX (propbox), box1, label2);
+
+ /* Second option frame */
+ box2 = gtk_hbox_new (TRUE, 4);
+ gtk_widget_show (box2);
+
+ for (i = 0; i < get_number_of_backgrounds(); i++)
+ {
+ int bwidth = 79;
+ int bheight = 123;
+ int backgrwidth;
+ int backgrheight;
+ int x, y;
+ GdkPixmap *button_pixmap;
+
+ button_pixmap = gdk_pixmap_new (playing_area->window, bwidth, bheight,
+ gdk_window_get_visual (playing_area->window)->depth);
+
+ gdk_window_get_size (backgrounds[i], &backgrwidth, &backgrheight);
+
+ /* tile the button pixmap with the background */
+ for (x = 0; x < bwidth; x += backgrwidth)
+ for (y = 0; y < bheight; y += backgrheight)
+ gdk_draw_pixmap(button_pixmap,
+ playing_area->style->black_gc,
+ backgrounds[i],
+ 0,0,
+ x,y,
+ -1, -1);
+ pixmap = gtk_pixmap_new( button_pixmap, 0);
+ pbutton = gtk_button_new ();
+ gtk_object_set_data (GTK_OBJECT(pbutton), "index", i);
+ gtk_widget_show(pixmap);
+ gtk_widget_show(pbutton);
+
+ gtk_signal_connect(GTK_OBJECT(pbutton), "pressed",
+ (GtkSignalFunc)choseBackground, propbox);
+
+ gtk_container_add(GTK_CONTAINER(pbutton), pixmap);
+ gtk_container_add(GTK_CONTAINER(box2), pbutton);
+ }
+
+ label1 = gtk_label_new (_("Background"));
+ gnome_property_box_append_page (GNOME_PROPERTY_BOX (propbox), box2, label1);
+
+
+ gtk_signal_connect(GTK_OBJECT(propbox), "apply",
+ (GtkSignalFunc)optionsApply, propbox);
+ gtk_signal_connect(GTK_OBJECT(propbox), "delete_event",
+ (GtkSignalFunc)optionsCancel, propbox);
+ gtk_signal_connect(GTK_OBJECT(propbox), "destroy",
+ (GtkSignalFunc)optionsCancel, propbox);
+ new_back_pixmap = get_current_card_back_pixmap();
+ return propbox;
+ }
+
+
+ /* Call backs... */
+
+ void
+ show_option_dialog (GtkWidget *widget, GdkEvent *event)
+ {
+ GtkWidget *dialog;
+
+ dialog = option_dialog ();
+
+ gtk_widget_show (dialog);
+ }
diff -r -N -c gnome-games/aisleriot/pixmaps/Makefile.am gnome-games-mod/aisleriot/pixmaps/Makefile.am
*** gnome-games/aisleriot/pixmaps/Makefile.am Mon May 4 19:57:49 1998
--- gnome-games-mod/aisleriot/pixmaps/Makefile.am Mon May 4 18:38:36 1998
***************
*** 1,61 ****
pixmapdir = $(datadir)/pixmaps/cards
pixmap_DATA = \
! 10club.xpm \
! 10diamond.xpm \
! 10heart.xpm \
! 10spade.xpm \
! 2club.xpm \
! 2diamond.xpm \
! 2heart.xpm \
! 2spade.xpm \
! 3club.xpm \
! 3diamond.xpm \
! 3heart.xpm \
! 3spade.xpm \
! 4club.xpm \
! 4diamond.xpm \
! 4heart.xpm \
! 4spade.xpm \
! 5club.xpm \
! 5diamond.xpm \
! 5heart.xpm \
! 5spade.xpm \
! 6club.xpm \
! 6diamond.xpm \
! 6heart.xpm \
! 6spade.xpm \
! 7club.xpm \
! 7diamond.xpm \
! 7heart.xpm \
! 7spade.xpm \
! 8club.xpm \
! 8diamond.xpm \
! 8heart.xpm \
! 8spade.xpm \
! 9club.xpm \
! 9diamond.xpm \
! 9heart.xpm \
! 9spade.xpm \
! aceclub.xpm \
! acediamond.xpm \
! aceheart.xpm \
! acespade.xpm \
! back.xpm \
! background.xpm \
! jackclub.xpm \
! jackdiamond.xpm \
! jackheart.xpm \
! jackspade.xpm \
! kingclub.xpm \
! kingdiamond.xpm \
! kingheart.xpm \
! kingspade.xpm \
! mask.xbm \
! queenclub.xpm \
! queenheart.xpm \
! queenspade.xpm \
! slot.xpm \
! queendiamond.xpm
EXTRA_DIST = $(pixmap_DATA)
--- 1,76 ----
pixmapdir = $(datadir)/pixmaps/cards
pixmap_DATA = \
! 10club.xpm \
! 10diamond.xpm \
! 10heart.xpm \
! 10spade.xpm \
! 2club.xpm \
! 2diamond.xpm \
! 2heart.xpm \
! 2spade.xpm \
! 3club.xpm \
! 3diamond.xpm \
! 3heart.xpm \
! 3spade.xpm \
! 4club.xpm \
! 4diamond.xpm \
! 4heart.xpm \
! 4spade.xpm \
! 5club.xpm \
! 5diamond.xpm \
! 5heart.xpm \
! 5spade.xpm \
! 6club.xpm \
! 6diamond.xpm \
! 6heart.xpm \
! 6spade.xpm \
! 7club.xpm \
! 7diamond.xpm \
! 7heart.xpm \
! 7spade.xpm \
! 8club.xpm \
! 8diamond.xpm \
! 8heart.xpm \
! 8spade.xpm \
! 9club.xpm \
! 9diamond.xpm \
! 9heart.xpm \
! 9spade.xpm \
! Cardback0.xpm \
! Cardback1.xpm \
! Cardback2.xpm \
! Cardback3.xpm \
! Cardback4.xpm \
! Cardback5.xpm \
! aceclub.xpm \
! acediamond.xpm \
! aceheart.xpm \
! acespade.xpm \
! background0.xpm \
! background1.xpm \
! background2.xpm \
! background3.xpm \
! background4.xpm \
! background5.xpm \
! jackclub.xpm \
! jackdiamond.xpm \
! jackheart.xpm \
! jackspade.xpm \
! kingclub.xpm \
! kingdiamond.xpm \
! kingheart.xpm \
! kingspade.xpm \
! mask.xbm \
! queenclub.xpm \
! queendiamond.xpm \
! queenheart.xpm \
! queenspade.xpm \
! slot0.xpm \
! slot1.xpm \
! slot2.xpm \
! slot3.xpm \
! slot4.xpm \
! slot5.xpm
EXTRA_DIST = $(pixmap_DATA)
diff -r -N -c gnome-games/aisleriot/pixmaps/backgrounds.h gnome-games-mod/aisleriot/pixmaps/backgrounds.h
*** gnome-games/aisleriot/pixmaps/backgrounds.h Thu Jan 1 01:00:00 1970
--- gnome-games-mod/aisleriot/pixmaps/backgrounds.h Mon May 4 17:35:59 1998
***************
*** 0 ****
--- 1,18 ----
+ #ifndef PIXMAPS_BACKGROUNDS_H
+ #define PIXMAPS_BACKGROUNDS_H
+
+ #include "background0.xpm"
+ #include "background1.xpm"
+ #include "background2.xpm"
+ #include "background3.xpm"
+ #include "background4.xpm"
+ #include "background5.xpm"
+ #include "slot0.xpm"
+ #include "slot1.xpm"
+ #include "slot2.xpm"
+ #include "slot3.xpm"
+ #include "slot4.xpm"
+ #include "slot5.xpm"
+
+ #define NBACKGROUNDS 6
+ #endif
diff -r -N -c gnome-games/aisleriot/pixmaps/backs.h gnome-games-mod/aisleriot/pixmaps/backs.h
*** gnome-games/aisleriot/pixmaps/backs.h Thu Jan 1 01:00:00 1970
--- gnome-games-mod/aisleriot/pixmaps/backs.h Mon May 4 17:35:17 1998
***************
*** 0 ****
--- 1,12 ----
+ #ifndef PIXMAPS_BACKS_H
+ #define PIXMAPS_BACKS_H
+
+ #include "Cardback0.xpm"
+ #include "Cardback1.xpm"
+ #include "Cardback2.xpm"
+ #include "Cardback3.xpm"
+ #include "Cardback4.xpm"
+ #include "Cardback5.xpm"
+
+ #define NBACKS 6
+ #endif
diff -r -N -c gnome-games/aisleriot/pixmaps/cards.h gnome-games-mod/aisleriot/pixmaps/cards.h
*** gnome-games/aisleriot/pixmaps/cards.h Mon May 4 19:58:22 1998
--- gnome-games-mod/aisleriot/pixmaps/cards.h Mon May 4 17:35:08 1998
***************
*** 2,58 ****
#define PIXMAPS_CARDS_H
#include "pixmaps/mask.xbm"
! #include "pixmaps/2club.xpm"
! #include "pixmaps/3club.xpm"
! #include "pixmaps/4club.xpm"
! #include "pixmaps/5club.xpm"
! #include "pixmaps/6club.xpm"
! #include "pixmaps/7club.xpm"
! #include "pixmaps/8club.xpm"
! #include "pixmaps/9club.xpm"
! #include "pixmaps/10club.xpm"
! #include "pixmaps/jackclub.xpm"
! #include "pixmaps/queenclub.xpm"
! #include "pixmaps/kingclub.xpm"
! #include "pixmaps/aceclub.xpm"
! #include "pixmaps/2diamond.xpm"
! #include "pixmaps/3diamond.xpm"
! #include "pixmaps/4diamond.xpm"
! #include "pixmaps/5diamond.xpm"
! #include "pixmaps/6diamond.xpm"
! #include "pixmaps/7diamond.xpm"
! #include "pixmaps/8diamond.xpm"
! #include "pixmaps/9diamond.xpm"
! #include "pixmaps/10diamond.xpm"
! #include "pixmaps/jackdiamond.xpm"
! #include "pixmaps/queendiamond.xpm"
! #include "pixmaps/kingdiamond.xpm"
! #include "pixmaps/acediamond.xpm"
! #include "pixmaps/2heart.xpm"
! #include "pixmaps/3heart.xpm"
! #include "pixmaps/4heart.xpm"
! #include "pixmaps/5heart.xpm"
! #include "pixmaps/6heart.xpm"
! #include "pixmaps/7heart.xpm"
! #include "pixmaps/8heart.xpm"
! #include "pixmaps/9heart.xpm"
! #include "pixmaps/10heart.xpm"
! #include "pixmaps/jackheart.xpm"
! #include "pixmaps/queenheart.xpm"
! #include "pixmaps/kingheart.xpm"
! #include "pixmaps/aceheart.xpm"
! #include "pixmaps/2spade.xpm"
! #include "pixmaps/3spade.xpm"
! #include "pixmaps/4spade.xpm"
! #include "pixmaps/5spade.xpm"
! #include "pixmaps/6spade.xpm"
! #include "pixmaps/7spade.xpm"
! #include "pixmaps/8spade.xpm"
! #include "pixmaps/9spade.xpm"
! #include "pixmaps/10spade.xpm"
! #include "pixmaps/jackspade.xpm"
! #include "pixmaps/queenspade.xpm"
! #include "pixmaps/kingspade.xpm"
! #include "pixmaps/acespade.xpm"
!
#endif
--- 2,57 ----
#define PIXMAPS_CARDS_H
#include "pixmaps/mask.xbm"
! #include "10club.xpm"
! #include "10diamond.xpm"
! #include "10heart.xpm"
! #include "10spade.xpm"
! #include "2club.xpm"
! #include "2diamond.xpm"
! #include "2heart.xpm"
! #include "2spade.xpm"
! #include "3club.xpm"
! #include "3diamond.xpm"
! #include "3heart.xpm"
! #include "3spade.xpm"
! #include "4club.xpm"
! #include "4diamond.xpm"
! #include "4heart.xpm"
! #include "4spade.xpm"
! #include "5club.xpm"
! #include "5diamond.xpm"
! #include "5heart.xpm"
! #include "5spade.xpm"
! #include "6club.xpm"
! #include "6diamond.xpm"
! #include "6heart.xpm"
! #include "6spade.xpm"
! #include "7club.xpm"
! #include "7diamond.xpm"
! #include "7heart.xpm"
! #include "7spade.xpm"
! #include "8club.xpm"
! #include "8diamond.xpm"
! #include "8heart.xpm"
! #include "8spade.xpm"
! #include "9club.xpm"
! #include "9diamond.xpm"
! #include "9heart.xpm"
! #include "9spade.xpm"
! #include "aceclub.xpm"
! #include "acediamond.xpm"
! #include "aceheart.xpm"
! #include "acespade.xpm"
! #include "jackclub.xpm"
! #include "jackdiamond.xpm"
! #include "jackheart.xpm"
! #include "jackspade.xpm"
! #include "kingclub.xpm"
! #include "kingdiamond.xpm"
! #include "kingheart.xpm"
! #include "kingspade.xpm"
! #include "queenclub.xpm"
! #include "queendiamond.xpm"
! #include "queenheart.xpm"
! #include "queenspade.xpm"
#endif
diff -r -N -c gnome-games/aisleriot/press_data.c gnome-games-mod/aisleriot/press_data.c
*** gnome-games/aisleriot/press_data.c Mon May 4 19:54:54 1998
--- gnome-games-mod/aisleriot/press_data.c Tue May 5 21:42:55 1998
***************
*** 111,117 ****
tempcard = get_card_picture(((hcard_type) tempptr->data)->suit,
((hcard_type) tempptr->data)->value);
else
! tempcard = get_card_back_pixmap();
if ((slot->type == EXPANDING_SLOT_RIGHT) || (slot->type == PARTIALLY_EXPANDING_SLOT_RIGHT)) {
gdk_gc_set_clip_origin(gc,0,0);
--- 111,117 ----
tempcard = get_card_picture(((hcard_type) tempptr->data)->suit,
((hcard_type) tempptr->data)->value);
else
! tempcard = get_current_card_back_pixmap();
if ((slot->type == EXPANDING_SLOT_RIGHT) || (slot->type == PARTIALLY_EXPANDING_SLOT_RIGHT)) {
gdk_gc_set_clip_origin(gc,0,0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]