Shape_chooser Class Reference

#include <shapelst.h>

Inheritance diagram for Shape_chooser:

Inheritance graph
[legend]
Collaboration diagram for Shape_chooser:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Shape_chooser (Vga_file *i, unsigned char *palbuf, int w, int h, Shape_group *g=0, Shape_file_info *fi=0)
virtual ~Shape_chooser ()
void set_shapes_file (Shapes_vga_file *sh)
void set_framenum0 (int f)
void shape_dropped_here (int file, int shapenum, int framenum)
int get_count ()
virtual void search (const char *srch, int dir)
virtual void locate (bool upwards)
void unselect (bool need_render=true)
int is_selected ()
void set_selected_callback (void(*fun)())
int get_selected (int &shapenum, int &framenum)
gint configure (GdkEventConfigure *event)
gint mouse_press (GtkWidget *widget, GdkEventButton *event)
time_t export_png (const char *fname)
time_t export_png (const char *fname, Image_buffer8 &img, int xoff, int yoff)
time_t export_tiled_png (const char *fname, int tiles, bool bycols)
void edit_shape_info ()
void edit_shape (int tiles=0, bool bycols=false)
void new_frame ()
void from_font_toggled (bool on)
void new_shape ()
void create_new_shape ()
void del_frame ()

Static Public Member Functions

static gint expose (GtkWidget *widget, GdkEventExpose *event, gpointer data)
static gint check_editing_files_cb (gpointer data)
static gint check_editing_files ()
static void read_back_edited (Editing_file *ed)
static void clear_editing_files ()
static void export_frame (char *fname, gpointer user_data)
static void import_frame (char *fname, gpointer user_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 vscrolled (GtkAdjustment *adj, gpointer data)
static void hscrolled (GtkAdjustment *adj, gpointer data)
static void frame_changed (GtkAdjustment *adj, gpointer data)
static void all_frames_toggled (GtkToggleButton *btn, gpointer user_data)
static gint drag_motion (GtkWidget *widget, GdkEventMotion *event, gpointer data)
static void on_shapes_popup_info_activate (GtkMenuItem *item, gpointer udata)
static void on_shapes_popup_edit_activate (GtkMenuItem *item, gpointer udata)
static void on_shapes_popup_edtiles_activate (GtkMenuItem *item, gpointer udata)

Private Member Functions

virtual void show (int x, int y, int w, int h)
virtual void show ()
void tell_server_shape ()
void select (int new_sel)
virtual void render ()
virtual void set_background_color (guint32 c)
void render_frames ()
void scroll_to_frame ()
int next_row (int start)
void goto_index (int index)
virtual int get_selected_id ()
void scroll_vertical (int newindex)
void adjust_vscrollbar ()
void adjust_hscrollbar (int newmax)
virtual GtkWidget * create_popup ()

Private Attributes

Shapes_vga_fileshapes_file
GtkWidget * sbar
guint sbar_sel
GtkWidget * fspin
GtkAdjustment * frame_adj
int framenum0
Shape_entryinfo
int info_cnt
std::vector< short > row_indices
int row0
int nrows
bool frames_mode
int hoffset
void(* sel_changed )()

Static Private Attributes

static std::vector< Editing_file * > editing_files
static int check_editing_timer

Detailed Description

Definition at line 61 of file shapelst.h.


Constructor & Destructor Documentation

Shape_chooser::Shape_chooser ( Vga_file i,
unsigned char *  palbuf,
int  w,
int  h,
Shape_group g = 0,
Shape_file_info fi = 0 
)

Definition at line 2156 of file shapelst.cc.

References Configure_chooser(), Mouse_press(), Mouse_release(), and on_draw_key_press().

Here is the call graph for this function:

Shape_chooser::~Shape_chooser (  )  [virtual]

Definition at line 2289 of file shapelst.cc.


Member Function Documentation

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

Implements Object_browser.

Definition at line 114 of file shapelst.cc.

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

Referenced by expose(), frame_changed(), and import_frame().

Here is the call graph for this function:

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

Implements Object_browser.

Definition at line 84 of file shapelst.h.

References Shape_draw::draw.

Referenced by mouse_press().

void Shape_chooser::tell_server_shape (  )  [private]

Definition at line 133 of file shapelst.cc.

References ExultStudio::get_instance(), Exult_server::info, Exult_server::maxlength, Object_browser::selected, ExultStudio::send_to_server(), Exult_server::set_edit_shape, and Write2().

Referenced by select().

Here is the call graph for this function:

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

Definition at line 156 of file shapelst.cc.

References frame_adj, fspin, ExultStudio::get_instance(), Vga_file::get_num_frames(), ExultStudio::get_shape_name(), Shape_draw::ifile, Exult_server::info, len, sbar, sbar_sel, Object_browser::selected, shapes_file, and tell_server_shape().

Referenced by render(), and render_frames().

Here is the call graph for this function:

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

Implements Object_browser.

Definition at line 191 of file shapelst.cc.

References adjust_vscrollbar(), Shape_draw::draw, Image_buffer8::fill8(), framenum0, frames_mode, get_count(), Shape_frame::get_height(), Vga_file::get_shape(), Shape_frame::get_width(), Shape_frame::get_xleft(), Shape_frame::get_yabove(), Object_browser::group, Shape_draw::ifile, Object_browser::index0, Exult_server::info, info_cnt, Shape_draw::iwin, nrows, Shape_frame::paint(), render_frames(), row0, row_indices, select(), Object_browser::selected, and unselect().

Referenced by configure(), frame_changed(), import_frame(), and mouse_press().

Here is the call graph for this function:

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

Reimplemented from Object_browser.

Definition at line 90 of file shapelst.h.

References Shape_draw::set_background_color().

Here is the call graph for this function:

void Shape_chooser::render_frames (  )  [private]

Definition at line 324 of file shapelst.cc.

References adjust_vscrollbar(), Image_buffer::clear_clip(), Shape_draw::draw, Vga_file::extract_shape(), Image_buffer8::fill8(), Ucscript::frame, get_count(), Shape::get_frame(), Get_max_height(), Shape::get_num_frames(), Object_browser::group, hoffset, Shape_draw::ifile, Object_browser::index0, Exult_server::info, info_cnt, Shape_draw::iwin, nrows, row0, row_indices, select(), Object_browser::selected, Image_buffer::set_clip(), and unselect().

Referenced by render().

Here is the call graph for this function:

void Shape_chooser::scroll_to_frame (  )  [private]

Definition at line 418 of file shapelst.cc.

References Shape_draw::draw, Vga_file::extract_shape(), Shape::get_frame(), Shape_frame::get_width(), Get_x_offset(), hoffset, Object_browser::hscroll, Shape_draw::ifile, Exult_server::info, and Object_browser::selected.

Referenced by frame_changed().

Here is the call graph for this function:

int Shape_chooser::next_row ( int  start  )  [private]

Definition at line 449 of file shapelst.cc.

References Shape_draw::draw, framenum0, frames_mode, get_count(), Vga_file::get_shape(), Shape_frame::get_width(), Object_browser::group, Shape_draw::ifile, Exult_server::info, and Object_browser::selected.

Referenced by goto_index().

Here is the call graph for this function:

void Shape_chooser::goto_index ( int  index  )  [private]

Definition at line 491 of file shapelst.cc.

References adjust_vscrollbar(), frames_mode, get_count(), Object_browser::index0, info_cnt, next_row(), nrows, row0, row_indices, and Object_browser::vscroll.

Referenced by all_frames_toggled(), and configure().

Here is the call graph for this function:

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

Reimplemented from Object_browser.

Definition at line 96 of file shapelst.h.

References info, Object_browser::selected, and Shape_entry::shapenum.

void Shape_chooser::scroll_vertical ( int  newindex  )  [private]

Definition at line 1752 of file shapelst.cc.

Referenced by mouse_press().

void Shape_chooser::adjust_vscrollbar (  )  [private]

Definition at line 1783 of file shapelst.cc.

Referenced by goto_index(), render(), and render_frames().

void Shape_chooser::adjust_hscrollbar ( int  newmax  )  [private]

Definition at line 1804 of file shapelst.cc.

Referenced by configure().

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

Reimplemented from Object_browser.

Definition at line 2110 of file shapelst.cc.

References EStudio::Add_menu_item(), Object_browser::create_popup(), ExultStudio::get_image_editor(), ExultStudio::get_instance(), ExultStudio::get_vgafile(), on_shapes_popup_export(), on_shapes_popup_import(), on_shapes_popup_new_frame(), and on_shapes_popup_new_shape().

Referenced by mouse_press().

Here is the call graph for this function:

void Shape_chooser::set_shapes_file ( Shapes_vga_file sh  )  [inline]

Definition at line 106 of file shapelst.h.

References shapes_file.

Referenced by Image_file_info::create_browser().

void Shape_chooser::set_framenum0 ( int  f  )  [inline]

Definition at line 108 of file shapelst.h.

References framenum0.

Referenced by Image_file_info::create_browser().

void Shape_chooser::shape_dropped_here ( int  file,
int  shapenum,
int  framenum 
)

Definition at line 2013 of file shapelst.cc.

References ExultStudio::get_instance(), and ExultStudio::update_group_windows().

Here is the call graph for this function:

int Shape_chooser::get_count (  ) 

Definition at line 2033 of file shapelst.cc.

Referenced by goto_index(), next_row(), render(), and render_frames().

void Shape_chooser::search ( const char *  srch,
int  dir 
) [virtual]

Reimplemented from Object_browser.

Definition at line 2044 of file shapelst.cc.

References ExultStudio::get_instance(), and ExultStudio::get_shape_name().

Here is the call graph for this function:

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

Reimplemented from Object_browser.

Definition at line 2090 of file shapelst.cc.

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

Here is the call graph for this function:

void Shape_chooser::unselect ( bool  need_render = true  ) 

Definition at line 2301 of file shapelst.cc.

Referenced by mouse_press(), render(), and render_frames().

int Shape_chooser::is_selected (  )  [inline]

Definition at line 116 of file shapelst.h.

References Object_browser::selected.

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

Definition at line 118 of file shapelst.h.

References sel_changed.

int Shape_chooser::get_selected ( int &  shapenum,
int &  framenum 
) [inline]

Definition at line 121 of file shapelst.h.

References Shape_entry::framenum, info, Object_browser::selected, and Shape_entry::shapenum.

gint Shape_chooser::configure ( GdkEventConfigure *  event  ) 

Definition at line 552 of file shapelst.cc.

References adjust_hscrollbar(), Object_browser::config_height, Object_browser::config_width, Shape_draw::configure(), Shape_draw::drop_callback, Shape_draw::enable_drop(), goto_index(), Object_browser::index0, info_cnt, render(), row0, row_indices, and Shape_dropped_here().

Referenced by Configure_chooser().

Here is the call graph for this function:

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

Definition at line 585 of file shapelst.cc.

References show().

Here is the call graph for this function:

gint Shape_chooser::mouse_press ( GtkWidget *  widget,
GdkEventButton *  event 
)

Definition at line 663 of file shapelst.cc.

References create_popup(), edit_shape_info(), Exult_server::info, info_cnt, render(), row0, scroll_vertical(), sel_changed, Object_browser::selected, show(), and unselect().

Referenced by Mouse_press().

Here is the call graph for this function:

time_t Shape_chooser::export_png ( const char *  fname  ) 

Definition at line 769 of file shapelst.cc.

References Image_buffer8::fill8(), Ucscript::frame, ExultStudio::get_instance(), Vga_file::get_shape(), Shape_draw::ifile, Exult_server::info, and Object_browser::selected.

Referenced by export_frame().

Here is the call graph for this function:

time_t Shape_chooser::export_png ( const char *  fname,
Image_buffer8 img,
int  xoff,
int  yoff 
)

Definition at line 815 of file shapelst.cc.

References EStudio::Alert(), Image_buffer::get_bits(), Image_buffer::get_height(), Get_rgb_palette(), Image_buffer::get_width(), and stat().

Here is the call graph for this function:

time_t Shape_chooser::export_tiled_png ( const char *  fname,
int  tiles,
bool  bycols 
)

Definition at line 844 of file shapelst.cc.

References EStudio::Alert(), Image_buffer8::fill8(), Shape::get_frame(), ExultStudio::get_instance(), Shape::get_num_frames(), and Exult_server::info.

Here is the call graph for this function:

void Shape_chooser::edit_shape_info (  ) 

Definition at line 898 of file shapelst.cc.

References ExultStudio::get_instance(), ExultStudio::get_shape_name(), Exult_server::info, and ExultStudio::open_shape_window().

Referenced by mouse_press().

Here is the call graph for this function:

void Shape_chooser::edit_shape ( int  tiles = 0,
bool  bycols = false 
)

Definition at line 920 of file shapelst.cc.

References EStudio::Alert(), check_editing_files_cb(), ExultStudio::get_image_editor(), ExultStudio::get_instance(), get_system_path(), Exult_server::info, and U7mkdir().

Referenced by on_export_tiles_okay_clicked().

Here is the call graph for this function:

gint Shape_chooser::check_editing_files_cb ( gpointer  data  )  [static]

Definition at line 996 of file shapelst.cc.

References ExultStudio::get_instance(), and ExultStudio::has_focus().

Referenced by edit_shape().

Here is the call graph for this function:

gint Shape_chooser::check_editing_files (  )  [static]

Definition at line 1008 of file shapelst.cc.

References ExultStudio::get_browser(), ExultStudio::get_instance(), Object_browser::render(), Object_browser::show(), stat(), and ExultStudio::update_group_windows().

Referenced by on_main_window_focus_in_event(), and ExultStudio::save_all().

Here is the call graph for this function:

void Shape_chooser::read_back_edited ( Editing_file ed  )  [static]

Definition at line 1236 of file shapelst.cc.

References Editing_file::bycolumns, Editing_file::framenum, ExultStudio::get_instance(), ExultStudio::get_palbuf(), Import_png(), Import_png_tiles(), ExultStudio::open_shape_file(), Editing_file::pathname, Editing_file::shapenum, Editing_file::tiles, and Editing_file::vga_basename.

Here is the call graph for this function:

void Shape_chooser::clear_editing_files (  )  [static]

Definition at line 1262 of file shapelst.cc.

References Editing_file::pathname.

Referenced by ExultStudio::set_game_path(), and ExultStudio::~ExultStudio().

void Shape_chooser::export_frame ( char *  fname,
gpointer  user_data 
) [static]

Definition at line 1283 of file shapelst.cc.

References export_png(), EStudio::Prompt(), Object_browser::selected, and U7exists().

Referenced by on_shapes_popup_export().

Here is the call graph for this function:

void Shape_chooser::import_frame ( char *  fname,
gpointer  user_data 
) [static]

Definition at line 1308 of file shapelst.cc.

References Object_browser::file_info, Shape_entry::framenum, ExultStudio::get_instance(), Get_rgb_palette(), Import_png(), info, Shape_draw::palette, render(), Object_browser::selected, Shape_entry::shapenum, show(), and ExultStudio::update_group_windows().

Referenced by on_shapes_popup_import().

Here is the call graph for this function:

void Shape_chooser::new_frame (  ) 

Definition at line 1332 of file shapelst.cc.

References Shape::add_frame(), Vga_file::extract_shape(), Image_buffer8::fill8(), Ucscript::frame, Image_buffer::get_bits(), ExultStudio::get_browser(), Shape::get_frame(), Shape_frame::get_height(), ExultStudio::get_instance(), Shape::get_num_frames(), ExultStudio::get_vgafile(), Shape_frame::get_width(), Exult_server::info, Object_browser::render(), Object_browser::show(), and ExultStudio::update_group_windows().

Referenced by on_draw_key_press().

Here is the call graph for this function:

void Shape_chooser::from_font_toggled ( bool  on  ) 

Definition at line 1474 of file shapelst.cc.

References Create_file_selection(), font_file_chosen(), ExultStudio::get_instance(), and ExultStudio::set_sensitive().

Referenced by on_new_shape_font_toggled().

Here is the call graph for this function:

void Shape_chooser::new_shape (  ) 

Definition at line 1494 of file shapelst.cc.

References ExultStudio::get_instance(), Vga_file::get_num_frames(), Vga_file::get_num_shapes(), ExultStudio::get_vgafile(), ExultStudio::get_xml(), Exult_server::info, ExultStudio::set_sensitive(), and ExultStudio::set_toggle().

Here is the call graph for this function:

void Shape_chooser::create_new_shape (  ) 

Definition at line 1563 of file shapelst.cc.

References Shape::add_frame(), EStudio::Alert(), Image_buffer8::fill8(), Image_buffer::get_bits(), ExultStudio::get_browser(), ExultStudio::get_instance(), Vga_file::get_num_frames(), ExultStudio::get_spin(), ExultStudio::get_text_entry(), ExultStudio::get_toggle(), ExultStudio::get_vgafile(), Vga_file::new_shape(), EStudio::Prompt(), Object_browser::render(), Object_browser::show(), and ExultStudio::update_group_windows().

Referenced by on_new_shape_okay_clicked().

Here is the call graph for this function:

void Shape_chooser::del_frame (  ) 

Definition at line 1637 of file shapelst.cc.

References Shape::del_frame(), Vga_file::extract_shape(), ExultStudio::get_browser(), ExultStudio::get_instance(), Shape::get_num_frames(), Exult_server::info, Vga_file::is_flex(), Object_browser::render(), Object_browser::show(), and ExultStudio::update_group_windows().

Referenced by on_draw_key_press().

Here is the call graph for this function:

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

Definition at line 1670 of file shapelst.cc.

References Shape_entry::framenum, Vga_file::get_u7drag_type(), Shape_draw::ifile, info, len, Object_browser::selected, Shape_entry::shapenum, Store_u7_shapeid(), U7_SHAPE_SHAPES, U7_SHAPE_UNK, U7_TARGET_SHAPEID, and U7_TARGET_SHAPEID_NAME.

Here is the call graph for this function:

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

Definition at line 1711 of file shapelst.cc.

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

Definition at line 1727 of file shapelst.cc.

References Shape_entry::framenum, Vga_file::get_shape(), Shape_draw::ifile, info, Object_browser::selected, Shape_draw::set_drag_icon(), and Shape_entry::shapenum.

Here is the call graph for this function:

void Shape_chooser::vscrolled ( GtkAdjustment *  adj,
gpointer  data 
) [static]

Definition at line 1824 of file shapelst.cc.

void Shape_chooser::hscrolled ( GtkAdjustment *  adj,
gpointer  data 
) [static]

Definition at line 1835 of file shapelst.cc.

void Shape_chooser::frame_changed ( GtkAdjustment *  adj,
gpointer  data 
) [static]

Definition at line 1851 of file shapelst.cc.

References Shape_entry::framenum, frames_mode, Vga_file::get_num_frames(), Shape_draw::ifile, info, render(), scroll_to_frame(), Object_browser::selected, Shape_entry::shapenum, and show().

Here is the call graph for this function:

void Shape_chooser::all_frames_toggled ( GtkToggleButton *  btn,
gpointer  user_data 
) [static]

Definition at line 1877 of file shapelst.cc.

References frames_mode, goto_index(), Object_browser::hscroll, Shape_entry::index, Object_browser::index0, info, info_cnt, row0, row_indices, and Object_browser::selected.

Here is the call graph for this function:

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

Definition at line 645 of file shapelst.cc.

References Shape_draw::dragging, Object_browser::selected, Shape_draw::start_drag(), U7_TARGET_SHAPEID, and U7_TARGET_SHAPEID_NAME.

Here is the call graph for this function:

void Shape_chooser::on_shapes_popup_info_activate ( GtkMenuItem *  item,
gpointer  udata 
) [static]

Definition at line 1906 of file shapelst.cc.

void Shape_chooser::on_shapes_popup_edit_activate ( GtkMenuItem *  item,
gpointer  udata 
) [static]

Definition at line 1915 of file shapelst.cc.

void Shape_chooser::on_shapes_popup_edtiles_activate ( GtkMenuItem *  item,
gpointer  udata 
) [static]

Definition at line 1924 of file shapelst.cc.

References Object_browser::file_info, Shape_file_info::get_ifile(), ExultStudio::get_instance(), Vga_file::get_num_frames(), ExultStudio::get_xml(), info, Object_browser::selected, and Shape_entry::shapenum.

Here is the call graph for this function:


Member Data Documentation

Shapes_vga_file* Shape_chooser::shapes_file [private]

Definition at line 63 of file shapelst.h.

Referenced by select(), and set_shapes_file().

GtkWidget* Shape_chooser::sbar [private]

Definition at line 64 of file shapelst.h.

Referenced by select().

guint Shape_chooser::sbar_sel [private]

Definition at line 65 of file shapelst.h.

Referenced by select().

GtkWidget* Shape_chooser::fspin [private]

Definition at line 66 of file shapelst.h.

Referenced by select().

GtkAdjustment* Shape_chooser::frame_adj [private]

Definition at line 67 of file shapelst.h.

Referenced by select().

int Shape_chooser::framenum0 [private]

Definition at line 68 of file shapelst.h.

Referenced by next_row(), render(), and set_framenum0().

Shape_entry* Shape_chooser::info [private]

Definition at line 69 of file shapelst.h.

Referenced by all_frames_toggled(), drag_begin(), drag_data_get(), frame_changed(), get_selected(), get_selected_id(), import_frame(), and on_shapes_popup_edtiles_activate().

int Shape_chooser::info_cnt [private]

Definition at line 70 of file shapelst.h.

Referenced by all_frames_toggled(), configure(), goto_index(), mouse_press(), render(), and render_frames().

std::vector<short> Shape_chooser::row_indices [private]

Definition at line 71 of file shapelst.h.

Referenced by all_frames_toggled(), configure(), goto_index(), render(), and render_frames().

int Shape_chooser::row0 [private]

Definition at line 72 of file shapelst.h.

Referenced by all_frames_toggled(), configure(), goto_index(), mouse_press(), render(), and render_frames().

int Shape_chooser::nrows [private]

Definition at line 73 of file shapelst.h.

Referenced by goto_index(), render(), and render_frames().

bool Shape_chooser::frames_mode [private]

Definition at line 74 of file shapelst.h.

Referenced by all_frames_toggled(), frame_changed(), goto_index(), next_row(), and render().

int Shape_chooser::hoffset [private]

Definition at line 75 of file shapelst.h.

Referenced by render_frames(), and scroll_to_frame().

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

Referenced by mouse_press(), and set_selected_callback().

std::vector< Editing_file * > Shape_chooser::editing_files [static, private]

Definition at line 80 of file shapelst.h.

int Shape_chooser::check_editing_timer [static, private]

Definition at line 81 of file shapelst.h.


The documentation for this class was generated from the following files:
Generated on Mon Jul 9 15:02:19 2007 for ExultEngine by  doxygen 1.5.1