comparison gui/mplayer/gui_common.c @ 32955:e12d6cd72b75

Go without gtk functions. Normal string function are sufficient to handle item->text, there is no need to use gtk functions.
author ib
date Mon, 07 Mar 2011 20:27:29 +0000
parents 682b370ac832
children cde5d1cbb4bc
comparison
equal deleted inserted replaced
32954:682b370ac832 32955:e12d6cd72b75
16 * You should have received a copy of the GNU General Public License along 16 * You should have received a copy of the GNU General Public License along
17 * with MPlayer; if not, write to the Free Software Foundation, Inc., 17 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */ 19 */
20 20
21 #include <gtk/gtk.h>
22 #include <stdlib.h> 21 #include <stdlib.h>
23 #include <stdio.h> 22 #include <stdio.h>
24 #include <inttypes.h> 23 #include <inttypes.h>
25 #include <string.h> 24 #include <string.h>
26 25
289 case itDLabel: 288 case itDLabel:
290 { 289 {
291 int x; 290 int x;
292 unsigned int d; 291 unsigned int d;
293 char * t = Translate( item->label ); 292 char * t = Translate( item->label );
294 if ( g_strcmp0( item->text, t ) != 0 ) 293 if ( !item->text || ( strcmp( item->text, t ) != 0 ) )
295 { 294 {
296 g_free( item->text ); 295 free( item->text );
297 item->text = g_strdup( t ); 296 item->text = strdup( t );
298 item->textwidth = fntTextWidth( item->fontid, t ); 297 item->textwidth = fntTextWidth( item->fontid, t );
299 item->starttime = GetTimerMS(); 298 item->starttime = GetTimerMS();
300 item->last_x = 0; 299 item->last_x = 0;
301 } 300 }
302 d = GetTimerMS() - item->starttime; 301 d = GetTimerMS() - item->starttime;