Chunk_chooser Class Reference

#include <chunklst.h>

Inheritance diagram for Chunk_chooser:

Inheritance graph
[legend]
Collaboration diagram for Chunk_chooser:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Chunk_chooser (Vga_file *i, std::istream &cfile, unsigned char *palbuf, int w, int h, Shape_group *g=0)
virtual ~Chunk_chooser ()
virtual bool server_response (int id, unsigned char *data, int datalen)
virtual void end_terrain_editing ()
void unselect (bool need_render=true)
int is_selected ()
void set_selected_callback (void(*fun)())
int get_count ()
void enable_drop ()
void locate (int dir)
virtual void locate (bool upwards)
void locate_response (unsigned char *data, int datalen)
void insert (bool dup)
void del ()
void insert_response (unsigned char *data, int datalen)
void delete_response (unsigned char *data, int datalen)
virtual void move (bool upwards)
void swap_response (unsigned char *data, int datalen)

Static Public Member Functions

static gint configure (GtkWidget *widget, GdkEventConfigure *event, gpointer data)
static gint expose (GtkWidget *widget, GdkEventExpose *event, gpointer data)
static gint mouse_press (GtkWidget *widget, GdkEventButton *event, gpointer data)
static void drag_data_get (GtkWidget *widget, GdkDragContext *context, GtkSelectionData *data, guint info, guint time, gpointer data)
static gint selection_clear (GtkWidget *widget, GdkEventSelection *event, gpointer data)
static gint drag_begin (GtkWidget *widget, GdkDragContext *context, gpointer data)
static void drag_data_received (GtkWidget *widget, GdkDragContext *context, gint x, gint y, GtkSelectionData *selection_data, guint info, guint time, gpointer udata)
static void scrolled (GtkAdjustment *adj, gpointer data)
static gint drag_motion (GtkWidget *widget, GdkEventMotion *event, gpointer data)

Private Member Functions

virtual void show (int x, int y, int w, int h)
virtual void show ()
void tell_server ()
void select (int new_sel)
virtual void render ()
virtual void set_background_color (guint32 c)
virtual int get_selected_id ()
unsigned char * get_chunk (int chunknum)
void update_num_chunks (int new_num_chunks)
void set_chunk (unsigned char *data, int datalen)
void render_chunk (int chunknum, int xoff, int yoff)
void scroll (int newindex)
void scroll (bool upwards)
void enable_controls ()
virtual GtkWidget * create_popup ()

Private Attributes

std::istream & chunkfile
GtkWidget * sbar
guint sbar_sel
int num_chunks
std::vector< unsigned char * > chunklist
Chunk_infoinfo
int info_cnt
int locate_cx
int locate_cy
bool drop_enabled
int to_del
void(* sel_changed )()

Detailed Description

Definition at line 56 of file chunklst.h.


Constructor & Destructor Documentation

Chunk_chooser::Chunk_chooser ( Vga_file i,
std::istream &  cfile,
unsigned char *  palbuf,
int  w,
int  h,
Shape_group g = 0 
)

Definition at line 804 of file chunklst.cc.

References c_tiles_per_chunk, Ucscript::frame, and Mouse_release().

Here is the call graph for this function:

Chunk_chooser::~Chunk_chooser (  )  [virtual]

Definition at line 901 of file chunklst.cc.


Member Function Documentation

void Chunk_chooser::show ( int  x,
int  y,
int  w,
int  h 
) [private, virtual]

Implements Object_browser.

Definition at line 64 of file chunklst.cc.

References Rectangle::h, Exult_server::info, Shape_draw::show(), Rectangle::w, Rectangle::x, and Rectangle::y.

Referenced by expose(), and mouse_press().

Here is the call graph for this function:

virtual void Chunk_chooser::show (  )  [inline, private, virtual]

Implements Object_browser.

Definition at line 73 of file chunklst.h.

References Shape_draw::draw.

void Chunk_chooser::tell_server (  )  [private]

Definition at line 83 of file chunklst.cc.

References ExultStudio::get_instance(), Exult_server::info, Exult_server::maxlength, ExultStudio::send_to_server(), Exult_server::set_edit_chunknum, and Write2().

Here is the call graph for this function:

void Chunk_chooser::select ( int  new_sel  )  [private]

Definition at line 102 of file chunklst.cc.

References Exult_server::info.

void Chunk_chooser::render (  )  [private, virtual]

Implements Object_browser.

Definition at line 124 of file chunklst.cc.

References border, and Exult_server::info.

Referenced by configure(), drag_data_received(), and mouse_press().

virtual void Chunk_chooser::set_background_color ( guint32  c  )  [inline, private, virtual]

Reimplemented from Object_browser.

Definition at line 79 of file chunklst.h.

References Shape_draw::set_background_color().

Here is the call graph for this function:

virtual int Chunk_chooser::get_selected_id (  )  [inline, private, virtual]

Reimplemented from Object_browser.

Definition at line 81 of file chunklst.h.

References info, Chunk_info::num, and Object_browser::selected.

unsigned char * Chunk_chooser::get_chunk ( int  chunknum  )  [private]

Definition at line 181 of file chunklst.cc.

References ExultStudio::get_instance(), ExultStudio::get_server_socket(), Exult_server::maxlength, Read2(), Exult_server::Receive_data(), Exult_server::send_terrain, ExultStudio::send_to_server(), Exult_server::wait_for_response(), and Write2().

Here is the call graph for this function:

void Chunk_chooser::update_num_chunks ( int  new_num_chunks  )  [private]

Definition at line 225 of file chunklst.cc.

void Chunk_chooser::set_chunk ( unsigned char *  data,
int  datalen 
) [private]

Definition at line 243 of file chunklst.cc.

References Read2().

Here is the call graph for this function:

void Chunk_chooser::render_chunk ( int  chunknum,
int  xoff,
int  yoff 
) [private]

Definition at line 279 of file chunklst.cc.

References c_tiles_per_chunk, c_tilesize, and s.

void Chunk_chooser::scroll ( int  newindex  )  [private]

Definition at line 662 of file chunklst.cc.

Referenced by mouse_press(), and scrolled().

void Chunk_chooser::scroll ( bool  upwards  )  [private]

Definition at line 680 of file chunklst.cc.

void Chunk_chooser::enable_controls (  )  [private]

Definition at line 714 of file chunklst.cc.

GtkWidget * Chunk_chooser::create_popup (  )  [private, virtual]

Reimplemented from Object_browser.

Definition at line 777 of file chunklst.cc.

References EStudio::Add_menu_item(), Object_browser::create_popup(), ExultStudio::get_instance(), on_delete(), on_insert_dup(), and on_insert_empty().

Referenced by mouse_press().

Here is the call graph for this function:

bool Chunk_chooser::server_response ( int  id,
unsigned char *  data,
int  datalen 
) [virtual]

Reimplemented from Object_browser.

Definition at line 918 of file chunklst.cc.

References Exult_server::delete_terrain, Exult_server::insert_terrain, Exult_server::locate_terrain, Exult_server::send_terrain, and Exult_server::swap_terrain.

void Chunk_chooser::end_terrain_editing (  )  [virtual]

Reimplemented from Object_browser.

Definition at line 953 of file chunklst.cc.

void Chunk_chooser::unselect ( bool  need_render = true  ) 

Definition at line 971 of file chunklst.cc.

Referenced by mouse_press().

int Chunk_chooser::is_selected (  )  [inline]

Definition at line 100 of file chunklst.h.

References Object_browser::selected.

void Chunk_chooser::set_selected_callback ( void(*)()  fun  )  [inline]

Definition at line 102 of file chunklst.h.

References sel_changed.

int Chunk_chooser::get_count (  ) 

Definition at line 308 of file chunklst.cc.

gint Chunk_chooser::configure ( GtkWidget *  widget,
GdkEventConfigure *  event,
gpointer  data 
) [static]

Definition at line 319 of file chunklst.cc.

References border, enable_drop(), Object_browser::group, render(), and Object_browser::vscroll.

Here is the call graph for this function:

gint Chunk_chooser::expose ( GtkWidget *  widget,
GdkEventExpose *  event,
gpointer  data 
) [static]

Definition at line 351 of file chunklst.cc.

References show().

Here is the call graph for this function:

gint Chunk_chooser::mouse_press ( GtkWidget *  widget,
GdkEventButton *  event,
gpointer  data 
) [static]

Definition at line 427 of file chunklst.cc.

References Chunk_info::box, create_popup(), Rectangle::has_point(), info, info_cnt, locate_cx, locate_cy, render(), scroll(), sel_changed, Object_browser::selected, show(), and unselect().

Here is the call graph for this function:

void Chunk_chooser::drag_data_get ( GtkWidget *  widget,
GdkDragContext *  context,
GtkSelectionData *  data,
guint  info,
guint  time,
gpointer  data 
) [static]

Definition at line 497 of file chunklst.cc.

References info, len, Chunk_info::num, Object_browser::selected, Store_u7_chunkid(), U7_TARGET_CHUNKID, and U7_TARGET_CHUNKID_NAME.

Here is the call graph for this function:

gint Chunk_chooser::selection_clear ( GtkWidget *  widget,
GdkEventSelection *  event,
gpointer  data 
) [static]

Definition at line 533 of file chunklst.cc.

gint Chunk_chooser::drag_begin ( GtkWidget *  widget,
GdkDragContext *  context,
gpointer  data 
) [static]

Definition at line 549 of file chunklst.cc.

References Shape_draw::drawgc, Image_buffer8::fill8(), Image_buffer::get_bits(), Image_buffer::get_line_width(), Shape_draw::ifile, info, Shape_draw::palette, and Object_browser::selected.

Here is the call graph for this function:

void Chunk_chooser::drag_data_received ( GtkWidget *  widget,
GdkDragContext *  context,
gint  x,
gint  y,
GtkSelectionData *  selection_data,
guint  info,
guint  time,
gpointer  udata 
) [static]

Reimplemented from Shape_draw.

Definition at line 608 of file chunklst.cc.

References Shape_group::add(), Get_u7_chunkid(), Object_browser::group, render(), and U7_TARGET_CHUNKID_NAME.

Here is the call graph for this function:

void Chunk_chooser::enable_drop (  ) 

Definition at line 637 of file chunklst.cc.

References U7_TARGET_CHUNKID, and U7_TARGET_CHUNKID_NAME.

Referenced by configure().

void Chunk_chooser::scrolled ( GtkAdjustment *  adj,
gpointer  data 
) [static]

Definition at line 698 of file chunklst.cc.

References scroll().

Here is the call graph for this function:

void Chunk_chooser::locate ( int  dir  ) 

Definition at line 1004 of file chunklst.cc.

References ExultStudio::get_instance(), Exult_server::locate_terrain, Exult_server::maxlength, ExultStudio::send_to_server(), and Write2().

Here is the call graph for this function:

void Chunk_chooser::locate ( bool  upwards  )  [virtual]

Reimplemented from Object_browser.

Definition at line 1032 of file chunklst.cc.

void Chunk_chooser::locate_response ( unsigned char *  data,
int  datalen 
)

Definition at line 1044 of file chunklst.cc.

References EStudio::Alert(), Exult_server::delete_terrain, ExultStudio::get_instance(), Exult_server::maxlength, Read2(), ExultStudio::send_to_server(), and Write2().

Here is the call graph for this function:

void Chunk_chooser::insert ( bool  dup  ) 

Definition at line 1088 of file chunklst.cc.

References ExultStudio::get_instance(), Exult_server::insert_terrain, Exult_server::maxlength, ExultStudio::send_to_server(), and Write2().

Referenced by on_insert_dup(), and on_insert_empty().

Here is the call graph for this function:

void Chunk_chooser::del (  ) 

Definition at line 1109 of file chunklst.cc.

Referenced by on_delete().

void Chunk_chooser::insert_response ( unsigned char *  data,
int  datalen 
)

Definition at line 1123 of file chunklst.cc.

References EStudio::Alert(), and Read2().

Here is the call graph for this function:

void Chunk_chooser::delete_response ( unsigned char *  data,
int  datalen 
)

Definition at line 1156 of file chunklst.cc.

References EStudio::Alert(), and Read2().

Here is the call graph for this function:

void Chunk_chooser::move ( bool  upwards  )  [virtual]

Reimplemented from Object_browser.

Definition at line 1181 of file chunklst.cc.

References ExultStudio::get_instance(), Exult_server::maxlength, ExultStudio::send_to_server(), Exult_server::swap_terrain, and Write2().

Here is the call graph for this function:

void Chunk_chooser::swap_response ( unsigned char *  data,
int  datalen 
)

Definition at line 1205 of file chunklst.cc.

References Read2().

Here is the call graph for this function:

gint Chunk_chooser::drag_motion ( GtkWidget *  widget,
GdkEventMotion *  event,
gpointer  data 
) [static]

Definition at line 412 of file chunklst.cc.

References Shape_draw::dragging, Object_browser::selected, Shape_draw::start_drag(), U7_TARGET_CHUNKID, and U7_TARGET_CHUNKID_NAME.

Here is the call graph for this function:


Member Data Documentation

std::istream& Chunk_chooser::chunkfile [private]

Definition at line 58 of file chunklst.h.

GtkWidget* Chunk_chooser::sbar [private]

Definition at line 60 of file chunklst.h.

guint Chunk_chooser::sbar_sel [private]

Definition at line 61 of file chunklst.h.

int Chunk_chooser::num_chunks [private]

Definition at line 62 of file chunklst.h.

std::vector<unsigned char *> Chunk_chooser::chunklist [private]

Definition at line 64 of file chunklst.h.

Chunk_info* Chunk_chooser::info [private]

Definition at line 65 of file chunklst.h.

Referenced by drag_begin(), drag_data_get(), get_selected_id(), and mouse_press().

int Chunk_chooser::info_cnt [private]

Definition at line 66 of file chunklst.h.

Referenced by mouse_press().

int Chunk_chooser::locate_cx [private]

Definition at line 67 of file chunklst.h.

Referenced by mouse_press().

int Chunk_chooser::locate_cy [private]

Definition at line 67 of file chunklst.h.

Referenced by mouse_press().

bool Chunk_chooser::drop_enabled [private]

Definition at line 68 of file chunklst.h.

int Chunk_chooser::to_del [private]

Definition at line 69 of file chunklst.h.

void(* Chunk_chooser::sel_changed)() [private]

Referenced by mouse_press(), and set_selected_callback().


The documentation for this class was generated from the following files:
Generated on Mon Jul 9 14:48:25 2007 for ExultEngine by  doxygen 1.5.1