indexing description: "[ Shared access to theme singletons. ]" date: "$Date$" revision: "$Revision$" class EM_SHARED_THEME feature -- Access theme_fonts: EM_THEME_FONTS is -- Default fonts for all widgets do Result := Theme_fonts_cell.item ensure theme_fonts_not_void: Result /= Void end theme_colors: EM_THEME_COLORS is -- Default colors for all widgets do Result := Theme_colors_cell.item ensure theme_colors_not_void: Result /= Void end theme_delegates: EM_THEME_DELEGATES is -- Default delegates for all widgets do Result := Theme_delegates_cell.item ensure theme_delegates_not_void: Result /= Void end feature -- Element change set_theme_fonts (a_theme_fonts: like theme_fonts) is -- Set `theme_fonts' to `a_theme_fonts'. require a_theme_fonts_not_void: a_theme_fonts /= Void do Theme_fonts_cell.put (a_theme_fonts) ensure theme_fonts_set: theme_fonts = a_theme_fonts end set_theme_colors (a_theme_colors: like theme_colors) is -- Set `theme_colors' to `a_theme_colors'. require a_theme_colors_not_void: a_theme_colors /= Void do Theme_colors_cell.put (a_theme_colors) ensure theme_colors_set: theme_colors = a_theme_colors end set_theme_delegates (a_theme_delegates: like theme_delegates) is -- Set `theme_delegates' to `a_theme_delegates'. require a_theme_delegates_not_void: a_theme_delegates /= Void do Theme_delegates_cell.put (a_theme_delegates) ensure theme_delegates_set: theme_delegates = a_theme_delegates end feature -- Basic operations load_default_theme is -- Load default theme. do theme_colors.load_default_colors theme_fonts.load_default_fonts theme_delegates.load_default_delegates end load_eclipse_theme is -- Load eclipse theme. do theme_colors.load_default_colors theme_fonts.load_default_fonts theme_delegates.load_eclipse_delegates end feature {NONE} -- Implementation Theme_fonts_cell: DS_CELL [EM_THEME_FONTS] is -- Cell holding current fonts once create Result.make (create {EM_THEME_FONTS}.make) ensure theme_fonts_cell_not_void: Result /= Void end Theme_colors_cell: DS_CELL [EM_THEME_COLORS] is -- Cell holding current colors once create Result.make (create {EM_THEME_COLORS}.make) ensure theme_colors_cell_not_void: Result /= Void end Theme_delegates_cell: DS_CELL [EM_THEME_DELEGATES] is -- Cell holding current delegates once create Result.make (create {EM_THEME_DELEGATES}.make) ensure theme_delegates_cell_not_void: Result /= Void end end