mirror of https://github.com/aseprite/aseprite.git
				
				
				
			Refactor all member functions of Context class to camel case.
This commit is contained in:
		
							parent
							
								
									bf395fca61
								
							
						
					
					
						commit
						8e8ac7aa50
					
				
							
								
								
									
										12
									
								
								src/app.cpp
								
								
								
								
							
							
						
						
									
										12
									
								
								src/app.cpp
								
								
								
								
							|  | @ -257,12 +257,12 @@ int App::run() | |||
| 	  else { | ||||
| 	    // Mount and select the sprite
 | ||||
| 	    UIContext* context = UIContext::instance(); | ||||
| 	    context->add_sprite(sprite); | ||||
| 	    context->set_current_sprite(sprite); | ||||
| 	    context->addSprite(sprite); | ||||
| 	    context->setCurrentSprite(sprite); | ||||
| 
 | ||||
| 	    if (isGui()) { | ||||
| 	      // Show it
 | ||||
| 	      set_sprite_in_more_reliable_editor(context->get_first_sprite()); | ||||
| 	      set_sprite_in_more_reliable_editor(context->getFirstSprite()); | ||||
| 
 | ||||
| 	      // Recent file
 | ||||
| 	      getRecentFiles()->addRecentFile(option->data().c_str()); | ||||
|  | @ -368,7 +368,7 @@ void app_refresh_screen(const Sprite* sprite) | |||
| void app_realloc_sprite_list() | ||||
| { | ||||
|   UIContext* context = UIContext::instance(); | ||||
|   const SpriteList& list = context->get_sprite_list(); | ||||
|   const SpriteList& list = context->getSpriteList(); | ||||
| 
 | ||||
|   // Insert all other sprites
 | ||||
|   for (SpriteList::const_iterator | ||||
|  | @ -437,7 +437,7 @@ int app_get_current_image_type() | |||
|   Context* context = UIContext::instance(); | ||||
|   ASSERT(context != NULL); | ||||
| 
 | ||||
|   Sprite* sprite = context->get_current_sprite(); | ||||
|   Sprite* sprite = context->getCurrentSprite(); | ||||
|   if (sprite != NULL) | ||||
|     return sprite->getImgType(); | ||||
|   else if (screen != NULL && bitmap_color_depth(screen) == 8) | ||||
|  | @ -486,7 +486,7 @@ void TabsBarHandler::clickTab(Tabs* tabs, void* data, int button) | |||
|     Command* close_file_cmd = | ||||
|       CommandsModule::instance()->get_command_by_name(CommandId::close_file); | ||||
| 
 | ||||
|     UIContext::instance()->execute_command(close_file_cmd, NULL); | ||||
|     UIContext::instance()->executeCommand(close_file_cmd, NULL); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -63,7 +63,7 @@ void CanvasSizeCommand::onExecute(Context* context) | |||
| { | ||||
|   CurrentSpriteWriter sprite(context); | ||||
| 
 | ||||
|   if (context->is_ui_available()) { | ||||
|   if (context->isUiAvailable()) { | ||||
|     JWidget left, top, right, bottom, ok; | ||||
| 
 | ||||
|     // load the window widget
 | ||||
|  |  | |||
|  | @ -84,16 +84,16 @@ protected: | |||
| 
 | ||||
|   bool onEnabled(Context* context) | ||||
|   { | ||||
|     return !context->get_sprite_list().empty(); | ||||
|     return !context->getSpriteList().empty(); | ||||
|   } | ||||
| 
 | ||||
|   void onExecute(Context* context) | ||||
|   { | ||||
|     if (!context->get_current_sprite()) | ||||
|       set_sprite_in_more_reliable_editor(context->get_first_sprite()); | ||||
|     if (!context->getCurrentSprite()) | ||||
|       set_sprite_in_more_reliable_editor(context->getFirstSprite()); | ||||
| 
 | ||||
|     while (true) { | ||||
|       if (context->get_current_sprite() != NULL) { | ||||
|       if (context->getCurrentSprite() != NULL) { | ||||
| 	if (!close_current_sprite(context)) | ||||
| 	  break; | ||||
|       } | ||||
|  | @ -147,7 +147,7 @@ try_again:; | |||
|   if (save_it) { | ||||
|     Command* save_command = | ||||
|       CommandsModule::instance()->get_command_by_name(CommandId::save_file); | ||||
|     context->execute_command(save_command); | ||||
|     context->executeCommand(save_command); | ||||
| 
 | ||||
|     goto try_again; | ||||
|   } | ||||
|  |  | |||
|  | @ -539,7 +539,7 @@ void ConfigureTools::onSetGridClick() | |||
|       Command* grid_settings_cmd =  | ||||
| 	CommandsModule::instance()->get_command_by_name(CommandId::grid_settings); | ||||
|    | ||||
|       UIContext::instance()->execute_command(grid_settings_cmd, NULL); | ||||
|       UIContext::instance()->executeCommand(grid_settings_cmd, NULL); | ||||
|     } | ||||
|   } | ||||
|   catch (LockedSpriteException& e) { | ||||
|  |  | |||
|  | @ -95,7 +95,7 @@ void DuplicateSpriteCommand::onExecute(Context* context) | |||
|     if (sprite_copy != NULL) { | ||||
|       sprite_copy->setFilename(dst_name->getText()); | ||||
| 
 | ||||
|       context->add_sprite(sprite_copy); | ||||
|       context->addSprite(sprite_copy); | ||||
|       set_sprite_in_more_reliable_editor(sprite_copy); | ||||
|     } | ||||
|   } | ||||
|  |  | |||
|  | @ -47,7 +47,7 @@ ExitCommand::ExitCommand() | |||
| 
 | ||||
| void ExitCommand::onExecute(Context* context) | ||||
| { | ||||
|   Sprite *sprite = context->get_first_sprite(); | ||||
|   Sprite *sprite = context->getFirstSprite(); | ||||
| 
 | ||||
|   while (sprite) { | ||||
|     // check if this sprite is modified
 | ||||
|  | @ -57,7 +57,7 @@ void ExitCommand::onExecute(Context* context) | |||
|       } | ||||
|       break; | ||||
|     } | ||||
|     sprite = context->get_next_sprite(sprite); | ||||
|     sprite = context->getNextSprite(sprite); | ||||
|   } | ||||
| 
 | ||||
|   /* close the window */ | ||||
|  |  | |||
|  | @ -68,7 +68,7 @@ void InvertMaskCommand::onExecute(Context* context) | |||
|     // so we select all
 | ||||
|     Command* mask_all_cmd = | ||||
|       CommandsModule::instance()->get_command_by_name(CommandId::mask_all); | ||||
|     context->execute_command(mask_all_cmd); | ||||
|     context->executeCommand(mask_all_cmd); | ||||
|   } | ||||
|   // invert the current mask
 | ||||
|   else { | ||||
|  |  | |||
|  | @ -70,7 +70,7 @@ void LoadMaskCommand::onExecute(Context* context) | |||
| 
 | ||||
|   base::string filename = m_filename; | ||||
| 
 | ||||
|   if (context->is_ui_available()) { | ||||
|   if (context->isUiAvailable()) { | ||||
|     filename = ase_file_selector("Load .msk File", filename, "msk"); | ||||
|     if (filename.empty()) | ||||
|       return; | ||||
|  |  | |||
|  | @ -172,7 +172,7 @@ void NewFileCommand::onExecute(Context* context) | |||
| 	} | ||||
| 
 | ||||
| 	// Show the sprite to the user
 | ||||
| 	context->add_sprite(sprite); | ||||
| 	context->addSprite(sprite); | ||||
| 	set_sprite_in_more_reliable_editor(sprite); | ||||
|       } | ||||
|     } | ||||
|  |  | |||
|  | @ -139,7 +139,7 @@ void OpenFileCommand::onExecute(Context* context) | |||
|   Console console; | ||||
| 
 | ||||
|   // interactive
 | ||||
|   if (context->is_ui_available() && m_filename.empty()) { | ||||
|   if (context->isUiAvailable() && m_filename.empty()) { | ||||
|     char exts[4096]; | ||||
|     get_readable_extensions(exts, sizeof(exts)); | ||||
|     m_filename = ase_file_selector(friendly_name(), "", exts); | ||||
|  | @ -188,7 +188,7 @@ void OpenFileCommand::onExecute(Context* context) | |||
| 	  UIContext* context = UIContext::instance(); | ||||
| 
 | ||||
| 	  App::instance()->getRecentFiles()->addRecentFile(fop->filename.c_str()); | ||||
| 	  context->add_sprite(sprite); | ||||
| 	  context->addSprite(sprite); | ||||
| 
 | ||||
| 	  set_sprite_in_more_reliable_editor(sprite); | ||||
| 	} | ||||
|  |  | |||
|  | @ -487,7 +487,7 @@ static void sort_command(JWidget widget) | |||
|       std::vector<int> mapping; | ||||
|       sort_by_criteria(palette, from, to, data.selected_criteria->children, mapping); | ||||
| 
 | ||||
|       if (UIContext::instance()->get_current_sprite()) { | ||||
|       if (UIContext::instance()->getCurrentSprite()) { | ||||
| 	// Remap all colors
 | ||||
| 	if (mapping.size() > 0) { | ||||
| 	  CurrentSpriteWriter sprite(UIContext::instance()); | ||||
|  | @ -901,7 +901,7 @@ static void update_hex_entry() | |||
| 
 | ||||
| static void update_current_sprite_palette(const char* operationName) | ||||
| { | ||||
|   if (UIContext::instance()->get_current_sprite()) { | ||||
|   if (UIContext::instance()->getCurrentSprite()) { | ||||
|     try { | ||||
|       CurrentSpriteWriter sprite(UIContext::instance()); | ||||
|       Palette* newPalette = get_current_palette(); // System current pal
 | ||||
|  |  | |||
|  | @ -187,7 +187,7 @@ void PreviewCommand::onExecute(Context* context) | |||
| 	   strcmp(command->short_name(), CommandId::goto_next_frame) == 0 || | ||||
| 	   strcmp(command->short_name(), CommandId::goto_last_frame) == 0)) { | ||||
| 	// Execute the command
 | ||||
| 	context->execute_command(command); | ||||
| 	context->executeCommand(command); | ||||
| 
 | ||||
| 	// Redraw
 | ||||
| 	redraw = true; | ||||
|  |  | |||
|  | @ -43,12 +43,12 @@ Context::~Context() | |||
|   delete m_settings; | ||||
| } | ||||
| 
 | ||||
| const SpriteList& Context::get_sprite_list() const | ||||
| const SpriteList& Context::getSpriteList() const | ||||
| { | ||||
|   return m_sprites; | ||||
| } | ||||
| 
 | ||||
| Sprite* Context::get_first_sprite() const | ||||
| Sprite* Context::getFirstSprite() const | ||||
| { | ||||
|   if (!m_sprites.empty()) | ||||
|     return m_sprites.front(); | ||||
|  | @ -56,7 +56,7 @@ Sprite* Context::get_first_sprite() const | |||
|     return NULL; | ||||
| } | ||||
| 
 | ||||
| Sprite* Context::get_next_sprite(Sprite* sprite) const | ||||
| Sprite* Context::getNextSprite(Sprite* sprite) const | ||||
| { | ||||
|   ASSERT(sprite != NULL); | ||||
| 
 | ||||
|  | @ -70,20 +70,17 @@ Sprite* Context::get_next_sprite(Sprite* sprite) const | |||
|   return NULL; | ||||
| } | ||||
| 
 | ||||
| /**
 | ||||
|  * Append the sprite to the context's sprites' list. | ||||
|  */ | ||||
| void Context::add_sprite(Sprite* sprite) | ||||
| void Context::addSprite(Sprite* sprite) | ||||
| { | ||||
|   ASSERT(sprite != NULL); | ||||
| 
 | ||||
|   m_sprites.push_front(sprite); | ||||
| 
 | ||||
|   // generate on_add_sprite event
 | ||||
|   on_add_sprite(sprite); | ||||
|   // Generate onAddSprite event
 | ||||
|   onAddSprite(sprite); | ||||
| } | ||||
| 
 | ||||
| void Context::remove_sprite(Sprite* sprite) | ||||
| void Context::removeSprite(Sprite* sprite) | ||||
| { | ||||
|   ASSERT(sprite != NULL); | ||||
| 
 | ||||
|  | @ -94,14 +91,14 @@ void Context::remove_sprite(Sprite* sprite) | |||
|   m_sprites.erase(it); | ||||
| 
 | ||||
|   // generate on_remove_sprite event
 | ||||
|   on_remove_sprite(sprite); | ||||
|   onRemoveSprite(sprite); | ||||
| 
 | ||||
|   // the current sprite cannot be the removed sprite anymore
 | ||||
|   if (m_currentSprite == sprite) | ||||
|     set_current_sprite(NULL); | ||||
|     setCurrentSprite(NULL); | ||||
| } | ||||
| 
 | ||||
| void Context::send_sprite_to_top(Sprite* sprite) | ||||
| void Context::sendSpriteToTop(Sprite* sprite) | ||||
| { | ||||
|   ASSERT(sprite); | ||||
| 
 | ||||
|  | @ -115,19 +112,19 @@ void Context::send_sprite_to_top(Sprite* sprite) | |||
|   m_sprites.push_front(sprite); | ||||
| } | ||||
| 
 | ||||
| Sprite* Context::get_current_sprite() const | ||||
| Sprite* Context::getCurrentSprite() const | ||||
| { | ||||
|   return m_currentSprite; | ||||
| } | ||||
| 
 | ||||
| void Context::set_current_sprite(Sprite* sprite) | ||||
| void Context::setCurrentSprite(Sprite* sprite) | ||||
| { | ||||
|   m_currentSprite = sprite; | ||||
| 
 | ||||
|   on_set_current_sprite(sprite); | ||||
|   onSetCurrentSprite(sprite); | ||||
| } | ||||
| 
 | ||||
| void Context::execute_command(Command* command, Params* params) | ||||
| void Context::executeCommand(Command* command, Params* params) | ||||
| { | ||||
|   Console console; | ||||
| 
 | ||||
|  | @ -168,17 +165,17 @@ void Context::execute_command(Command* command, Params* params) | |||
| #endif | ||||
| } | ||||
| 
 | ||||
| void Context::on_add_sprite(Sprite* sprite) | ||||
| void Context::onAddSprite(Sprite* sprite) | ||||
| { | ||||
|   // do nothing
 | ||||
| } | ||||
| 
 | ||||
| void Context::on_remove_sprite(Sprite* sprite) | ||||
| void Context::onRemoveSprite(Sprite* sprite) | ||||
| { | ||||
|   // do nothing
 | ||||
| } | ||||
| 
 | ||||
| void Context::on_set_current_sprite(Sprite* sprite) | ||||
| void Context::onSetCurrentSprite(Sprite* sprite) | ||||
| { | ||||
|   // do nothing
 | ||||
| } | ||||
|  |  | |||
|  | @ -43,34 +43,35 @@ class Context | |||
| public: | ||||
|   virtual ~Context(); | ||||
| 
 | ||||
|   virtual bool is_ui_available() const		{ return false; } | ||||
|   virtual bool is_recording_macro() const	{ return false; } | ||||
|   virtual bool is_executing_macro() const	{ return false; } | ||||
|   virtual bool is_executing_script() const	{ return false; } | ||||
|   virtual bool isUiAvailable() const     { return false; } | ||||
|   virtual bool isRecordingMacro() const  { return false; } | ||||
|   virtual bool isExecutingMacro() const  { return false; } | ||||
|   virtual bool isExecutingScript() const { return false; } | ||||
| 
 | ||||
|   ISettings* getSettings() { return m_settings; } | ||||
| 
 | ||||
|   const SpriteList& get_sprite_list() const; | ||||
|   Sprite* get_first_sprite() const; | ||||
|   Sprite* get_next_sprite(Sprite* sprite) const; | ||||
|   const SpriteList& getSpriteList() const; | ||||
|   Sprite* getFirstSprite() const; | ||||
|   Sprite* getNextSprite(Sprite* sprite) const; | ||||
| 
 | ||||
|   void add_sprite(Sprite* sprite); | ||||
|   void remove_sprite(Sprite* sprite); | ||||
|   void send_sprite_to_top(Sprite* sprite); | ||||
|   // Appends the sprite to the context's sprites' list.
 | ||||
|   void addSprite(Sprite* sprite); | ||||
|   void removeSprite(Sprite* sprite); | ||||
|   void sendSpriteToTop(Sprite* sprite); | ||||
| 
 | ||||
|   Sprite* get_current_sprite() const; | ||||
|   void set_current_sprite(Sprite* sprite); | ||||
|   Sprite* getCurrentSprite() const; | ||||
|   void setCurrentSprite(Sprite* sprite); | ||||
| 
 | ||||
|   virtual void execute_command(Command* command, Params* params = NULL); | ||||
|   virtual void executeCommand(Command* command, Params* params = NULL); | ||||
| 
 | ||||
| protected: | ||||
| 
 | ||||
|   // The "settings" are deleted automatically in the ~Context destructor
 | ||||
|   Context(ISettings* settings); | ||||
| 
 | ||||
|   virtual void on_add_sprite(Sprite* sprite); | ||||
|   virtual void on_remove_sprite(Sprite* sprite); | ||||
|   virtual void on_set_current_sprite(Sprite* sprite); | ||||
|   virtual void onAddSprite(Sprite* sprite); | ||||
|   virtual void onRemoveSprite(Sprite* sprite); | ||||
|   virtual void onSetCurrentSprite(Sprite* sprite); | ||||
| 
 | ||||
| private: | ||||
| 
 | ||||
|  |  | |||
|  | @ -84,7 +84,7 @@ void check_for_dropped_files() | |||
|     for (std::vector<base::string>::iterator | ||||
| 	   it = files.begin(); it != files.end(); ++it) { | ||||
|       params.set("filename", it->c_str()); | ||||
|       UIContext::instance()->execute_command(cmd_open_file, ¶ms); | ||||
|       UIContext::instance()->executeCommand(cmd_open_file, ¶ms); | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -163,7 +163,7 @@ bool animation_editor_is_movingcel() | |||
|  */ | ||||
| void switch_between_animation_and_sprite_editor() | ||||
| { | ||||
|   const Sprite* sprite = UIContext::instance()->get_current_sprite(); | ||||
|   const Sprite* sprite = UIContext::instance()->getCurrentSprite(); | ||||
| 
 | ||||
|   /* create the window & the animation-editor */ | ||||
|   Frame* window = new Frame(true, NULL); | ||||
|  | @ -537,8 +537,8 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg) | |||
| 	    else if (msg->mouse.left) { | ||||
| 	      if (anieditor->clk_frame == anieditor->hot_frame) { | ||||
| 		UIContext::instance() | ||||
| 		  ->execute_command(CommandsModule::instance() | ||||
| 				    ->get_command_by_name(CommandId::frame_properties)); | ||||
| 		  ->executeCommand(CommandsModule::instance() | ||||
| 				   ->get_command_by_name(CommandId::frame_properties)); | ||||
| 	      } | ||||
| 	      else { | ||||
| 		const SpriteReader sprite((Sprite*)anieditor->sprite); | ||||
|  | @ -738,7 +738,7 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg) | |||
| 	    strcmp(command->short_name(), CommandId::goto_next_layer) == 0 || | ||||
| 	    strcmp(command->short_name(), CommandId::goto_last_frame) == 0) { | ||||
| 	  // execute the command
 | ||||
| 	  UIContext::instance()->execute_command(command); | ||||
| 	  UIContext::instance()->executeCommand(command); | ||||
| 
 | ||||
| 	  anieditor_show_current_cel(widget); | ||||
| 	  jwidget_dirty(widget); | ||||
|  | @ -748,7 +748,7 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg) | |||
| 	if (strcmp(command->short_name(), CommandId::new_layer) == 0 || | ||||
| 	    strcmp(command->short_name(), CommandId::remove_layer) == 0) { | ||||
| 	  // execute the command
 | ||||
| 	  UIContext::instance()->execute_command(command); | ||||
| 	  UIContext::instance()->executeCommand(command); | ||||
| 
 | ||||
| 	  anieditor_regenerate_layers(widget); | ||||
| 	  anieditor_show_current_cel(widget); | ||||
|  |  | |||
|  | @ -177,7 +177,7 @@ void editors_draw_sprite_tiled(const Sprite* sprite, int x1, int y1, int x2, int | |||
| void editors_hide_sprite(const Sprite* sprite) | ||||
| { | ||||
|   UIContext* context = UIContext::instance(); | ||||
|   bool refresh = (context->get_current_sprite() == sprite) ? true: false; | ||||
|   bool refresh = (context->getCurrentSprite() == sprite) ? true: false; | ||||
| 
 | ||||
|   for (EditorList::iterator it = editors.begin(); it != editors.end(); ++it) { | ||||
|     Editor* editor = *it; | ||||
|  | @ -189,7 +189,7 @@ void editors_hide_sprite(const Sprite* sprite) | |||
|   if (refresh) { | ||||
|     Sprite* sprite = current_editor->getSprite(); | ||||
| 
 | ||||
|     context->set_current_sprite(sprite); | ||||
|     context->setCurrentSprite(sprite); | ||||
|     app_refresh_screen(sprite); | ||||
|   } | ||||
| } | ||||
|  | @ -206,7 +206,7 @@ void set_current_editor(Editor* editor) | |||
| 
 | ||||
|     UIContext* context = UIContext::instance(); | ||||
|     Sprite* sprite = current_editor->getSprite(); | ||||
|     context->set_current_sprite(sprite); | ||||
|     context->setCurrentSprite(sprite); | ||||
| 
 | ||||
|     app_refresh_screen(sprite); | ||||
|     app_realloc_sprite_list(); | ||||
|  | @ -218,9 +218,9 @@ void set_sprite_in_current_editor(Sprite *sprite) | |||
|   if (current_editor) { | ||||
|     UIContext* context = UIContext::instance(); | ||||
|      | ||||
|     context->set_current_sprite(sprite); | ||||
|     context->setCurrentSprite(sprite); | ||||
|     if (sprite != NULL) | ||||
|       context->send_sprite_to_top(sprite); | ||||
|       context->sendSpriteToTop(sprite); | ||||
| 
 | ||||
|     current_editor->editor_set_sprite(sprite); | ||||
| 
 | ||||
|  | @ -408,7 +408,7 @@ static int is_sprite_in_some_editor(Sprite* sprite) | |||
| static Sprite* get_more_reliable_sprite() | ||||
| { | ||||
|   UIContext* context = UIContext::instance(); | ||||
|   const SpriteList& list = context->get_sprite_list(); | ||||
|   const SpriteList& list = context->getSpriteList(); | ||||
| 
 | ||||
|   for (SpriteList::const_iterator | ||||
| 	 it = list.begin(); it != list.end(); ++it) { | ||||
|  |  | |||
|  | @ -1240,7 +1240,7 @@ static bool manager_msg_proc(JWidget widget, JMessage msg) | |||
| 
 | ||||
| 	      // the screen shot is available in everywhere
 | ||||
| 	      if (strcmp(command->short_name(), CommandId::screen_shot) == 0) { | ||||
| 		UIContext::instance()->execute_command(command, shortcut->params); | ||||
| 		UIContext::instance()->executeCommand(command, shortcut->params); | ||||
| 		return true; | ||||
| 	      } | ||||
| 	      // all other keys are only available in the main-window
 | ||||
|  | @ -1258,7 +1258,7 @@ static bool manager_msg_proc(JWidget widget, JMessage msg) | |||
| 		  else if (child->is_desktop() && child == app_get_top_window()) { | ||||
| 		    /* ok, so we can execute the command represented by the
 | ||||
| 		       pressed-key in the message... */ | ||||
| 		    UIContext::instance()->execute_command(command, shortcut->params); | ||||
| 		    UIContext::instance()->executeCommand(command, shortcut->params); | ||||
| 		    return true; | ||||
| 		  } | ||||
| 		} | ||||
|  |  | |||
|  | @ -211,7 +211,7 @@ class CurrentSpriteReader : public SpriteReader | |||
| public: | ||||
| 
 | ||||
|   CurrentSpriteReader(Context* context) | ||||
|     : SpriteReader(context->get_current_sprite()) | ||||
|     : SpriteReader(context->getCurrentSprite()) | ||||
|   { | ||||
|   } | ||||
| 
 | ||||
|  | @ -228,7 +228,7 @@ class CurrentSpriteWriter : public SpriteWriter | |||
| public: | ||||
| 
 | ||||
|   CurrentSpriteWriter(Context* context) | ||||
|     : SpriteWriter(context->get_current_sprite()) | ||||
|     : SpriteWriter(context->getCurrentSprite()) | ||||
|     , m_context(context) | ||||
|   { | ||||
|   } | ||||
|  | @ -241,7 +241,7 @@ public: | |||
|   { | ||||
|     ASSERT(m_sprite != NULL); | ||||
| 
 | ||||
|     m_context->remove_sprite(m_sprite); | ||||
|     m_context->removeSprite(m_sprite); | ||||
|     unlock_writer(); | ||||
| 
 | ||||
|     delete m_sprite; | ||||
|  |  | |||
|  | @ -44,10 +44,10 @@ UIContext::~UIContext() | |||
|   m_instance = NULL; | ||||
| } | ||||
| 
 | ||||
| void UIContext::on_add_sprite(Sprite* sprite) | ||||
| void UIContext::onAddSprite(Sprite* sprite) | ||||
| { | ||||
|   // base method
 | ||||
|   Context::on_add_sprite(sprite); | ||||
|   Context::onAddSprite(sprite); | ||||
| 
 | ||||
|   // add the tab for this sprite
 | ||||
|   app_get_tabsbar()->addTab(get_filename(sprite->getFilename()), sprite); | ||||
|  | @ -56,10 +56,10 @@ void UIContext::on_add_sprite(Sprite* sprite) | |||
|   app_realloc_sprite_list(); | ||||
| } | ||||
| 
 | ||||
| void UIContext::on_remove_sprite(Sprite* sprite) | ||||
| void UIContext::onRemoveSprite(Sprite* sprite) | ||||
| { | ||||
|   // base method
 | ||||
|   Context::on_remove_sprite(sprite); | ||||
|   Context::onRemoveSprite(sprite); | ||||
| 
 | ||||
|   // remove this sprite from tabs
 | ||||
|   app_get_tabsbar()->removeTab(sprite); | ||||
|  | @ -71,9 +71,9 @@ void UIContext::on_remove_sprite(Sprite* sprite) | |||
|   editors_hide_sprite(sprite); | ||||
| } | ||||
| 
 | ||||
| void UIContext::on_set_current_sprite(Sprite* sprite) | ||||
| void UIContext::onSetCurrentSprite(Sprite* sprite) | ||||
| { | ||||
|   Context::on_set_current_sprite(sprite); | ||||
|   Context::onSetCurrentSprite(sprite); | ||||
| 
 | ||||
|   // Select the sprite in the tabs.
 | ||||
|   app_get_tabsbar()->selectTab(sprite); | ||||
|  |  | |||
|  | @ -29,12 +29,12 @@ public: | |||
|   UIContext(); | ||||
|   virtual ~UIContext(); | ||||
| 
 | ||||
|   virtual bool is_ui_available() const { return true; } | ||||
|   virtual bool isUiAvailable() const { return true; } | ||||
| 
 | ||||
| protected: | ||||
|   virtual void on_add_sprite(Sprite* sprite); | ||||
|   virtual void on_remove_sprite(Sprite* sprite); | ||||
|   virtual void on_set_current_sprite(Sprite* sprite); | ||||
|   virtual void onAddSprite(Sprite* sprite); | ||||
|   virtual void onRemoveSprite(Sprite* sprite); | ||||
|   virtual void onSetCurrentSprite(Sprite* sprite); | ||||
| 
 | ||||
| private: | ||||
|   static UIContext* m_instance; | ||||
|  |  | |||
|  | @ -422,7 +422,7 @@ bool ColorBar::onProcessMessage(JMessage msg) | |||
| 		params.set("target", (m_hot == HOTCOLOR_FGCOLOR ? "foreground": "background")); | ||||
| 		params.set("open", "true"); | ||||
| 
 | ||||
| 		UIContext::instance()->execute_command(paledit_cmd, ¶ms); | ||||
| 		UIContext::instance()->executeCommand(paledit_cmd, ¶ms); | ||||
| 		break; | ||||
| 	      } | ||||
| 
 | ||||
|  |  | |||
|  | @ -1049,7 +1049,7 @@ bool Editor::onProcessMessage(JMessage msg) | |||
| 	Tool* current_tool = getCurrentEditorTool(); | ||||
| 
 | ||||
| 	set_current_editor(this); | ||||
| 	context->set_current_sprite(m_sprite); | ||||
| 	context->setCurrentSprite(m_sprite); | ||||
| 
 | ||||
| 	// Start scroll loop
 | ||||
| 	if (msg->mouse.middle || | ||||
|  | @ -1145,7 +1145,7 @@ bool Editor::onProcessMessage(JMessage msg) | |||
| 	  Params params; | ||||
| 	  params.set("target", msg->mouse.right ? "background": "foreground"); | ||||
| 
 | ||||
| 	  UIContext::instance()->execute_command(eyedropper_cmd, ¶ms); | ||||
| 	  UIContext::instance()->executeCommand(eyedropper_cmd, ¶ms); | ||||
| 	  return true; | ||||
| 	} | ||||
| 	// Start the Tool-Loop
 | ||||
|  | @ -1444,7 +1444,7 @@ bool Editor::onProcessMessage(JMessage msg) | |||
| 		Command* command = CommandsModule::instance()->get_command_by_name | ||||
| 		  ((dz < 0) ? CommandId::goto_next_frame: CommandId::goto_previous_frame); | ||||
| 		if (command) | ||||
| 		  UIContext::instance()->execute_command(command, NULL); | ||||
| 		  UIContext::instance()->executeCommand(command, NULL); | ||||
| 	      } | ||||
| 	      break; | ||||
| 
 | ||||
|  |  | |||
|  | @ -133,7 +133,7 @@ static bool menuitem_msg_proc(JWidget widget, JMessage msg) | |||
| 	    menuitem->m_command->loadParams(menuitem->m_params); | ||||
| 
 | ||||
| 	  if (menuitem->m_command->isEnabled(context)) { | ||||
| 	    context->execute_command(menuitem->m_command); | ||||
| 	    context->executeCommand(menuitem->m_command); | ||||
| 	    return true; | ||||
| 	  } | ||||
| 	} | ||||
|  |  | |||
|  | @ -575,7 +575,7 @@ bool StatusBar::onProcessMessage(JMessage msg) | |||
|     } | ||||
| 
 | ||||
|     case JM_MOUSEENTER: { | ||||
|       bool state = (UIContext::instance()->get_current_sprite() != NULL); | ||||
|       bool state = (UIContext::instance()->getCurrentSprite() != NULL); | ||||
| 
 | ||||
|       if (!jwidget_has_child(this, m_movePixelsBox)) { | ||||
| 	if (!jwidget_has_child(this, m_commandsBox) && state) { | ||||
|  | @ -686,7 +686,7 @@ bool StatusBar::onProcessMessage(JMessage msg) | |||
| 	      ->get_command_by_name(CommandId::donate); | ||||
| 
 | ||||
| 	    Params params; | ||||
| 	    UIContext::instance()->execute_command(donate, ¶ms); | ||||
| 	    UIContext::instance()->executeCommand(donate, ¶ms); | ||||
| 	  } | ||||
| 	} | ||||
| 	catch (LockedSpriteException&) { | ||||
|  | @ -779,7 +779,7 @@ static void ani_button_command(Button* widget, AniAction action) | |||
|   } | ||||
| 
 | ||||
|   if (cmd) | ||||
|     UIContext::instance()->execute_command(cmd); | ||||
|     UIContext::instance()->executeCommand(cmd); | ||||
| } | ||||
| 
 | ||||
| void StatusBar::updateFromLayer() | ||||
|  |  | |||
|  | @ -279,7 +279,7 @@ bool ToolBar::onProcessMessage(JMessage msg) | |||
| 	Command* conf_tools_cmd =  | ||||
| 	  CommandsModule::instance()->get_command_by_name(CommandId::configure_tools); | ||||
| 
 | ||||
| 	UIContext::instance()->execute_command(conf_tools_cmd); | ||||
| 	UIContext::instance()->executeCommand(conf_tools_cmd); | ||||
|       } | ||||
|       break; | ||||
|     } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue