Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Toy Class Reference

#include <toy-framework-2.h>

Inheritance diagram for Toy:
LPEToy

Public Member Functions

 Toy ()
 
virtual ~Toy ()
 
virtual void draw (cairo_t *cr, std::ostringstream *notify, int w, int h, bool save, std::ostringstream *timing_stream)
 
virtual void mouse_moved (Geom::Point const &pos, unsigned modifiers)
 
virtual void mouse_pressed (Geom::Point const &pos, unsigned button, unsigned modifiers)
 
virtual void mouse_released (Geom::Point const &pos, unsigned button, unsigned modifiers)
 
virtual void canvas_click (Geom::Point at, int button)
 
virtual void scroll (GdkScrollDirection dir, Geom::Point const &delta)
 
virtual void key_hit (unsigned keyval, unsigned modifiers)
 
virtual bool should_draw_numbers ()
 
virtual int should_draw_bounds ()
 
virtual void first_time (int, char **)
 
virtual void resize_canvas (Geom::Rect const &)
 
virtual void load (FILE *f)
 
virtual void save (FILE *f)
 

Public Attributes

vector< Handle * > handles
 
bool mouse_down = false
 
Geom::Point old_mouse_point
 
Handleselected = nullptr
 
void * hit_data = nullptr
 
int canvas_click_button = 0
 
double notify_offset = 0.0
 
std::string name
 
bool show_timings = false
 
FILE * spool_file = nullptr
 

Detailed Description

Definition at line 315 of file toy-framework-2.h.

Constructor & Destructor Documentation

◆ Toy()

Toy::Toy ( )
inline

Definition at line 328 of file toy-framework-2.h.

◆ ~Toy()

virtual Toy::~Toy ( )
inlinevirtual

Definition at line 330 of file toy-framework-2.h.

Member Function Documentation

◆ canvas_click()

void Toy::canvas_click ( Geom::Point  at,
int  button 
)
virtual

Definition at line 243 of file toy-framework-2.cpp.

Referenced by mouse_released().

◆ draw()

void Toy::draw ( cairo_t cr,
std::ostringstream *  notify,
int  w,
int  h,
bool  save,
std::ostringstream *  timing_stream 
)
virtual

◆ first_time()

virtual void Toy::first_time ( int  ,
char **   
)
inlinevirtual

Definition at line 346 of file toy-framework-2.h.

Referenced by activate().

◆ key_hit()

virtual void Toy::key_hit ( unsigned  keyval,
unsigned  modifiers 
)
inlinevirtual

Definition at line 340 of file toy-framework-2.h.

Referenced by key_press_event().

◆ load()

void Toy::load ( FILE *  f)
virtual

Definition at line 260 of file toy-framework-2.cpp.

References data, handles, and name.

Referenced by activate(), and open_handles_cb().

◆ mouse_moved()

void Toy::mouse_moved ( Geom::Point const &  pos,
unsigned  modifiers 
)
virtual

Definition at line 211 of file toy-framework-2.cpp.

References hit_data, Handle::move_to(), old_mouse_point, redraw(), and selected.

Referenced by mouse_motion_event().

◆ mouse_pressed()

void Toy::mouse_pressed ( Geom::Point const &  pos,
unsigned  button,
unsigned  modifiers 
)
virtual

◆ mouse_released()

void Toy::mouse_released ( Geom::Point const &  pos,
unsigned  button,
unsigned  modifiers 
)
virtual

Definition at line 246 of file toy-framework-2.cpp.

References canvas_click(), canvas_click_button, hit_data, mouse_down, redraw(), and selected.

Referenced by mouse_release_event().

◆ resize_canvas()

virtual void Toy::resize_canvas ( Geom::Rect const &  )
inlinevirtual

Definition at line 348 of file toy-framework-2.h.

Referenced by draw_callback().

◆ save()

void Toy::save ( FILE *  f)
virtual

Definition at line 270 of file toy-framework-2.cpp.

References handles, and name.

Referenced by LPEToy::draw(), draw_callback(), and save_handles_cb().

◆ scroll()

void Toy::scroll ( GdkScrollDirection  dir,
Geom::Point const &  delta 
)
virtual

Definition at line 240 of file toy-framework-2.cpp.

Referenced by scroll_event().

◆ should_draw_bounds()

virtual int Toy::should_draw_bounds ( )
inlinevirtual

Definition at line 344 of file toy-framework-2.h.

Referenced by draw().

◆ should_draw_numbers()

virtual bool Toy::should_draw_numbers ( )
inlinevirtual

Definition at line 343 of file toy-framework-2.h.

Referenced by draw().

Member Data Documentation

◆ canvas_click_button

int Toy::canvas_click_button = 0

Definition at line 322 of file toy-framework-2.h.

Referenced by mouse_pressed(), and mouse_released().

◆ handles

vector<Handle*> Toy::handles

Definition at line 317 of file toy-framework-2.h.

Referenced by draw(), load(), LPEToy::LPEToy(), mouse_pressed(), and save().

◆ hit_data

void* Toy::hit_data = nullptr

Definition at line 321 of file toy-framework-2.h.

Referenced by mouse_moved(), mouse_pressed(), and mouse_released().

◆ mouse_down

bool Toy::mouse_down = false

Definition at line 318 of file toy-framework-2.h.

Referenced by draw(), mouse_pressed(), and mouse_released().

◆ name

std::string Toy::name

Definition at line 324 of file toy-framework-2.h.

Referenced by activate(), init(), load(), and save().

◆ notify_offset

double Toy::notify_offset = 0.0

Definition at line 323 of file toy-framework-2.h.

Referenced by draw().

◆ old_mouse_point

Geom::Point Toy::old_mouse_point

Definition at line 319 of file toy-framework-2.h.

Referenced by mouse_moved(), and mouse_pressed().

◆ selected

Handle* Toy::selected = nullptr

Definition at line 320 of file toy-framework-2.h.

Referenced by draw(), mouse_moved(), mouse_pressed(), and mouse_released().

◆ show_timings

bool Toy::show_timings = false

Definition at line 325 of file toy-framework-2.h.

Referenced by draw(), and set_show_timings().

◆ spool_file

FILE* Toy::spool_file = nullptr

Definition at line 326 of file toy-framework-2.h.

Referenced by activate(), and draw_callback().


The documentation for this class was generated from the following files: