comparison libinterp/corefcn/graphics.in.h @ 21163:2d22bd38deac

graphics.in.h: Rename function gripe_invalid to gripe_if_tkit_invalid. * graphics.in.h: Rename function gripe_invalid to gripe_if_tkit_invalid.
author Rik <rik@octave.org>
date Sun, 31 Jan 2016 07:49:27 -0800
parents e39e05d90788
children fcac5dbbf9ed
comparison
equal deleted inserted replaced
21162:5a02590028c6 21163:2d22bd38deac
2088 std::string get_name (void) const { return name; } 2088 std::string get_name (void) const { return name; }
2089 2089
2090 virtual bool is_valid (void) const { return false; } 2090 virtual bool is_valid (void) const { return false; }
2091 2091
2092 virtual void redraw_figure (const graphics_object&) const 2092 virtual void redraw_figure (const graphics_object&) const
2093 { gripe_invalid ("redraw_figure"); } 2093 { gripe_if_tkit_invalid ("redraw_figure"); }
2094 2094
2095 virtual void print_figure (const graphics_object&, const std::string&, 2095 virtual void print_figure (const graphics_object&, const std::string&,
2096 const std::string&, bool, 2096 const std::string&, bool,
2097 const std::string& = "") const 2097 const std::string& = "") const
2098 { gripe_invalid ("print_figure"); } 2098 { gripe_if_tkit_invalid ("print_figure"); }
2099 2099
2100 virtual Matrix get_canvas_size (const graphics_handle&) const 2100 virtual Matrix get_canvas_size (const graphics_handle&) const
2101 { 2101 {
2102 gripe_invalid ("get_canvas_size"); 2102 gripe_if_tkit_invalid ("get_canvas_size");
2103 return Matrix (1, 2, 0.0); 2103 return Matrix (1, 2, 0.0);
2104 } 2104 }
2105 2105
2106 virtual double get_screen_resolution (void) const 2106 virtual double get_screen_resolution (void) const
2107 { 2107 {
2108 gripe_invalid ("get_screen_resolution"); 2108 gripe_if_tkit_invalid ("get_screen_resolution");
2109 return 72.0; 2109 return 72.0;
2110 } 2110 }
2111 2111
2112 virtual Matrix get_screen_size (void) const 2112 virtual Matrix get_screen_size (void) const
2113 { 2113 {
2114 gripe_invalid ("get_screen_size"); 2114 gripe_if_tkit_invalid ("get_screen_size");
2115 return Matrix (1, 2, 0.0); 2115 return Matrix (1, 2, 0.0);
2116 } 2116 }
2117 2117
2118 // Callback function executed when the given graphics object 2118 // Callback function executed when the given graphics object
2119 // changes. This allows the graphics toolkit to act on property 2119 // changes. This allows the graphics toolkit to act on property
2120 // changes if needed. 2120 // changes if needed.
2121 virtual void update (const graphics_object&, int) 2121 virtual void update (const graphics_object&, int)
2122 { gripe_invalid ("base_graphics_toolkit::update"); } 2122 { gripe_if_tkit_invalid ("base_graphics_toolkit::update"); }
2123 2123
2124 void update (const graphics_handle&, int); 2124 void update (const graphics_handle&, int);
2125 2125
2126 // Callback function executed when the given graphics object is 2126 // Callback function executed when the given graphics object is
2127 // created. This allows the graphics toolkit to do toolkit-specific 2127 // created. This allows the graphics toolkit to do toolkit-specific
2128 // initializations for a newly created object. 2128 // initializations for a newly created object.
2129 virtual bool initialize (const graphics_object&) 2129 virtual bool initialize (const graphics_object&)
2130 { gripe_invalid ("base_graphics_toolkit::initialize"); return false; } 2130 {
2131 gripe_if_tkit_invalid ("base_graphics_toolkit::initialize");
2132 return false;
2133 }
2131 2134
2132 bool initialize (const graphics_handle&); 2135 bool initialize (const graphics_handle&);
2133 2136
2134 // Callback function executed just prior to deleting the given 2137 // Callback function executed just prior to deleting the given
2135 // graphics object. This allows the graphics toolkit to perform 2138 // graphics object. This allows the graphics toolkit to perform
2136 // toolkit-specific cleanup operations before an object is deleted. 2139 // toolkit-specific cleanup operations before an object is deleted.
2137 virtual void finalize (const graphics_object&) 2140 virtual void finalize (const graphics_object&)
2138 { gripe_invalid ("base_graphics_toolkit::finalize"); } 2141 { gripe_if_tkit_invalid ("base_graphics_toolkit::finalize"); }
2139 2142
2140 void finalize (const graphics_handle&); 2143 void finalize (const graphics_handle&);
2141 2144
2142 // Close the graphics toolkit. 2145 // Close the graphics toolkit.
2143 virtual void close (void) 2146 virtual void close (void)
2144 { gripe_invalid ("base_graphics_toolkit::close"); } 2147 { gripe_if_tkit_invalid ("base_graphics_toolkit::close"); }
2145 2148
2146 private: 2149 private:
2147 std::string name; 2150 std::string name;
2148 octave_refcount<int> count; 2151 octave_refcount<int> count;
2149 2152
2150 private: 2153 private:
2151 void gripe_invalid (const std::string& fname) const 2154 void gripe_if_tkit_invalid (const std::string& fname) const
2152 { 2155 {
2153 if (! is_valid ()) 2156 if (! is_valid ())
2154 error ("%s: invalid graphics toolkit", fname.c_str ()); 2157 error ("%s: invalid graphics toolkit", fname.c_str ());
2155 } 2158 }
2156 }; 2159 };