pixmap_t Struct Reference

#include <Structs.h>


Public Member Functions

 pixmap_t ()
 ~pixmap_t ()
void set_pixmap (GdkColor &col, GdkWindow *win)
void get_pixmap (GdkColor &col, GdkWindow *win, GdkPixmap *&pixm, GdkBitmap *&bitm)

Data Fields

GdkPixmap * pixmap
GdkWindow * window
GdkBitmap * bitmap


Constructor & Destructor Documentation

pixmap_t::pixmap_t  )  [inline]
 

Definition at line 80 of file Structs.h.

00080 : pixmap(NULL), window(NULL) {}

pixmap_t::~pixmap_t  ) 
 

Definition at line 30 of file Structs.cc.

References pixmap.

00031 {
00032   if( pixmap != NULL )
00033     {
00034       //      gdk_pixmap_unref(pixmap);
00035       //      gdk_bitmap_unref(bitmap);
00036       //TODO: check if window is open before unrefing
00037     }
00038 }


Member Function Documentation

void pixmap_t::get_pixmap GdkColor col,
GdkWindow *  win,
GdkPixmap *&  pixm,
GdkBitmap *&  bitm
 

Definition at line 61 of file Structs.cc.

References bitmap, pixmap, set_pixmap(), and window.

Referenced by Robot::get_score_pixmap(), and Robot::get_stat_pixmap().

00062 {
00063   if( win != window && pixmap != NULL )
00064     {
00065       gdk_pixmap_unref(pixmap);
00066       pixmap = NULL;
00067       gdk_bitmap_unref(bitmap);
00068       bitmap = NULL;
00069     }
00070   if( pixmap == NULL ) set_pixmap(col, win);
00071   
00072   pixm = pixmap;
00073   bitm = bitmap;
00074 }

Here is the call graph for this function:

void pixmap_t::set_pixmap GdkColor col,
GdkWindow *  win
 

Definition at line 41 of file Structs.cc.

References bitmap, Gui::get_bg_gdk_colour_p(), pixmap, and the_gui.

Referenced by get_pixmap().

00042 {
00043   if( pixmap != NULL )
00044     {
00045       gdk_pixmap_unref(pixmap);
00046       gdk_bitmap_unref(bitmap);
00047     }
00048   
00049   gchar square_bits[] = {
00050     0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f,
00051     0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f,
00052     0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f};
00053 
00054   pixmap = gdk_pixmap_create_from_data( win, square_bits, 16, 16, -1, &col, 
00055                                         the_gui.get_bg_gdk_colour_p() );
00056 
00057   bitmap = gdk_bitmap_create_from_data( win, square_bits, 16, 16 );
00058 }

Here is the call graph for this function:


Field Documentation

GdkBitmap* pixmap_t::bitmap
 

Definition at line 88 of file Structs.h.

Referenced by get_pixmap(), and set_pixmap().

GdkPixmap* pixmap_t::pixmap
 

Definition at line 86 of file Structs.h.

Referenced by get_pixmap(), set_pixmap(), and ~pixmap_t().

GdkWindow* pixmap_t::window
 

Definition at line 87 of file Structs.h.

Referenced by get_pixmap().


The documentation for this struct was generated from the following files:
Generated on Fri Oct 15 15:50:28 2004 for Real Time Battle by  doxygen 1.3.9.1