[dba5ed]: src / utils.h  Maximize  Restore  History

Download this file

105 lines (84 with data), 3.5 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
/*
* Copyright (C) 2001-2005 the xine-project
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
* USA
*
* $Id: utils.h,v 1.43 2006/04/04 22:08:52 dsalt Exp $
*
* needful things
*/
#ifndef HAVE_UTILS_H
#define HAVE_UTILS_H
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <glib.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <pthread.h>
void utils_init (void);
int ensure_path_exists (char *path, int mode);
char *make_path_uri (const char *);
/* read an entire file and ensure that the buffer is LF+NUL-terminated
* file_size may be NULL
*/
char *read_entire_file (const char *mrl, ssize_t *file_size);
/* open or close a file, checking for errors */
FILE *open_write (const char *name, const char *errtitle);
void close_write (const char *name, FILE *fd, const char *errtitle);
/* display message boxes
* if fmt==NULL, first vararg is format string and window is modal
*/
typedef enum {
FROM_GXINE, FROM_XINE,
} gxine_msg_source;
void v_display_message (gxine_msg_source, gboolean modal, const gchar *primary,
GtkMessageType, const gchar *fmt, va_list)
__attribute__ ((format (printf, 5, 0)));
void display_error_modal (gxine_msg_source, const gchar *, const gchar *, ...)
__attribute__ ((format (printf, 3, 4)));
void display_error (gxine_msg_source, const gchar *, const gchar *, ...)
__attribute__ ((format (printf, 3, 4)));
void display_warning (gxine_msg_source, const gchar *, const gchar *, ...)
__attribute__ ((format (printf, 3, 4)));
void display_info (gxine_msg_source, const gchar *, const gchar *, ...)
__attribute__ ((format (printf, 3, 4)));
#define round_second(TIME) \
({ \
int _time = (TIME); \
if (_time % 1000 >= 500) _time += 1000; \
_time - (_time % 1000); \
})
void int_to_timestring (gint int_time, char* string_time, gint length) ;
int parse_timestring (const char *string_time);
/* Note: result of these functions needs to be freed */
gchar *modal_file_dialog (const char *title, gboolean loading, gboolean local,
gboolean uri, const char *pattern, GtkWidget *extra,
GtkWidget *parent);
GSList *modal_multi_file_dialog (const char *title, gboolean local,
const char *pattern, GtkWidget *parent);
void get_mrl_from_filesystem (GtkWindow *, GtkEntry *);
void window_show (GtkWidget *widget, GtkWidget *parent); /* NULL => app */
/* attach to delete-event signal -> hide widget & set *visible = FALSE */
void hide_on_delete (GtkWidget *widget, gboolean *visible);
void add_table_row_items (GtkWidget *table, gint row, gboolean expand,
const gchar *labeltext, ...)
__attribute__ ((sentinel));
char *asreprintf (char **str, const char *fmt, ...);
#ifdef EXP_STUFF
char *unique_name (char *base);
#endif
void do_pending_events (void);
#define foreach_glist(var,list) for (var = (list); var; var = var->next)
#endif

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks