@ImageAtlasEditor.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /******************************************************************************/
  2. /******************************************************************************/
  3. class ImageAtlasEditor : PropWin
  4. {
  5. class Change : Edit::_Undo::Change
  6. {
  7. ElmImageAtlas data;
  8. virtual void create(ptr user)override;
  9. virtual void apply(ptr user)override;
  10. };
  11. class ListElm
  12. {
  13. bool removed;
  14. Color color;
  15. UID img_id;
  16. Button remove;
  17. void setColor();
  18. void operator=(C ElmImageAtlas::Img&src);
  19. static int ComparePath(C ListElm &a, C ListElm &b);
  20. public:
  21. ListElm();
  22. };
  23. Region region;
  24. Memx<ListElm> list_data; // Memx because of Button
  25. List<ListElm> list;
  26. Button make, undo, redo, locate, show_removed;
  27. UID elm_id;
  28. Elm *elm;
  29. bool changed, changed_file;
  30. Edit::Undo<Change> undos; void undoVis();
  31. static void ShowRemoved(ImageAtlasEditor &iae);
  32. static void Make (ImageAtlasEditor &iae);
  33. static Str ElmFullName(C ListElm &le);
  34. static Str ElmName (C ListElm &le);
  35. static int CompareSource(C ImageAtlas::Source &a, C ImageAtlas::Source &b);
  36. static void MipMaps( ImageAtlasEditor &iae, C Str &t);
  37. static Str MipMaps(C ImageAtlasEditor &iae );
  38. static void Undo (ImageAtlasEditor &editor);
  39. static void Redo (ImageAtlasEditor &editor);
  40. static void Locate(ImageAtlasEditor &editor);
  41. ElmImageAtlas* data()C;
  42. GuiObj& desc(C Str &desc)override;
  43. void makeDo();
  44. void create();
  45. virtual Rect sizeLimit()C override;
  46. virtual ImageAtlasEditor& rect(C Rect&rect)override;
  47. void skinChanged();
  48. void flush();
  49. void setChanged(bool file=false);
  50. static void Remove(ListElm &le);
  51. void remove(ListElm &le);
  52. void toGui();
  53. void set(Elm *elm);
  54. void activate(Elm *elm);
  55. void toggle (Elm *elm);
  56. virtual ImageAtlasEditor& hide ( )override;
  57. void elmChanged(C UID &elm_id);
  58. void drag(Memc<UID> &elms, GuiObj*obj, C Vec2&screen_pos);
  59. void erasing(C UID &elm_id);
  60. public:
  61. ImageAtlasEditor();
  62. };
  63. /******************************************************************************/
  64. /******************************************************************************/
  65. extern ImageAtlasEditor ImageAtlasEdit;
  66. /******************************************************************************/