Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
d477acf4
Commit
d477acf4
authored
Aug 05, 2003
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removing files for Familiar interface (Gtk+1.2 and GPE).
parent
2c4e15bb
Changes
14
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
0 additions
and
3972 deletions
+0
-3972
modules/gui/familiar/Modules.am
modules/gui/familiar/Modules.am
+0
-16
modules/gui/familiar/callbacks.c
modules/gui/familiar/callbacks.c
+0
-609
modules/gui/familiar/callbacks.h
modules/gui/familiar/callbacks.h
+0
-116
modules/gui/familiar/familiar.c
modules/gui/familiar/familiar.c
+0
-539
modules/gui/familiar/familiar.glade
modules/gui/familiar/familiar.glade
+0
-1118
modules/gui/familiar/familiar.h
modules/gui/familiar/familiar.h
+0
-69
modules/gui/familiar/interface.c
modules/gui/familiar/interface.c
+0
-860
modules/gui/familiar/interface.h
modules/gui/familiar/interface.h
+0
-5
modules/gui/familiar/network.c
modules/gui/familiar/network.c
+0
-136
modules/gui/familiar/network.h
modules/gui/familiar/network.h
+0
-58
modules/gui/familiar/playlist.c
modules/gui/familiar/playlist.c
+0
-203
modules/gui/familiar/playlist.h
modules/gui/familiar/playlist.h
+0
-20
modules/gui/familiar/support.c
modules/gui/familiar/support.c
+0
-162
modules/gui/familiar/support.h
modules/gui/familiar/support.h
+0
-61
No files found.
modules/gui/familiar/Modules.am
deleted
100644 → 0
View file @
2c4e15bb
SOURCES_familiar = \
familiar.c \
familiar.h \
interface.c \
interface.h \
support.c \
support.h \
callbacks.c \
callbacks.h \
network.c \
network.h \
playlist.c \
playlist.h \
$(NULL)
EXTRA_DIST += familiar.glade
modules/gui/familiar/callbacks.c
deleted
100644 → 0
View file @
2c4e15bb
This diff is collapsed.
Click to expand it.
modules/gui/familiar/callbacks.h
deleted
100644 → 0
View file @
2c4e15bb
/*****************************************************************************
* callbacks.h : familiar plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: callbacks.h,v 1.9 2003/03/13 15:50:17 marcari Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#include <gtk/gtk.h>
#include "network.h"
#include "playlist.h"
gboolean
FamiliarExit
(
GtkWidget
*
,
gpointer
);
void
ReadDirectory
(
GtkCList
*
clist
,
char
*
psz_dir
);
void
MediaURLOpenChanged
(
GtkWidget
*
widget
,
gchar
*
psz_url
);
void
on_toolbar_open_clicked
(
GtkButton
*
button
,
gpointer
user_data
);
void
on_toolbar_preferences_clicked
(
GtkButton
*
button
,
gpointer
user_data
);
void
on_toolbar_rewind_clicked
(
GtkButton
*
button
,
gpointer
user_data
);
void
on_toolbar_pause_clicked
(
GtkButton
*
button
,
gpointer
user_data
);
void
on_toolbar_play_clicked
(
GtkButton
*
button
,
gpointer
user_data
);
void
on_toolbar_stop_clicked
(
GtkButton
*
button
,
gpointer
user_data
);
void
on_toolbar_forward_clicked
(
GtkButton
*
button
,
gpointer
user_data
);
void
on_toolbar_about_clicked
(
GtkButton
*
button
,
gpointer
user_data
);
void
on_comboURL_entry_changed
(
GtkEditable
*
editable
,
gpointer
user_data
);
void
on_clistmedia_click_column
(
GtkCList
*
clist
,
gint
column
,
gpointer
user_data
);
void
on_clistmedia_select_row
(
GtkCList
*
clist
,
gint
row
,
gint
column
,
GdkEvent
*
event
,
gpointer
user_data
);
void
on_cbautoplay_toggled
(
GtkToggleButton
*
togglebutton
,
gpointer
user_data
);
gboolean
on_familiar_delete_event
(
GtkWidget
*
widget
,
GdkEvent
*
event
,
gpointer
user_data
);
gboolean
FamiliarSliderRelease
(
GtkWidget
*
widget
,
GdkEventButton
*
event
,
gpointer
user_data
);
gboolean
FamiliarSliderPress
(
GtkWidget
*
widget
,
GdkEventButton
*
event
,
gpointer
user_data
);
void
FamiliarMrlGo
(
GtkButton
*
button
,
gpointer
user_data
);
void
on_toolbar_playlist_clicked
(
GtkButton
*
button
,
gpointer
user_data
);
void
FamiliarPreferencesApply
(
GtkButton
*
button
,
gpointer
user_data
);
modules/gui/familiar/familiar.c
deleted
100644 → 0
View file @
2c4e15bb
This diff is collapsed.
Click to expand it.
modules/gui/familiar/familiar.glade
deleted
100644 → 0
View file @
2c4e15bb
This diff is collapsed.
Click to expand it.
modules/gui/familiar/familiar.h
deleted
100644 → 0
View file @
2c4e15bb
/*****************************************************************************
* familiar.h: private Gtk+ interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: familiar.h,v 1.13 2003/03/13 15:50:17 marcari Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MAX_ATEXIT 10
/*****************************************************************************
* intf_sys_t: description and status of Gtk+ interface
*****************************************************************************/
struct
intf_sys_t
{
/* The gtk_main module */
module_t
*
p_gtk_main
;
/* windows and widgets */
GtkWidget
*
p_window
;
/* main window */
GtkEntry
*
p_mrlentry
;
GtkNotebook
*
p_notebook
;
GtkNotebook
*
p_mediabook
;
GtkHScale
*
p_slider
;
GtkCList
*
p_clist
;
GtkCList
*
p_clistplaylist
;
/* slider */
GtkLabel
*
p_slider_label
;
GtkAdjustment
*
p_adj
;
/* slider adjustment object */
off_t
i_adj_oldvalue
;
/* previous value -no FPU hardware */
float
f_adj_oldvalue
;
/* previous value -with FPU hardware*/
/* special actions */
vlc_bool_t
b_playing
;
vlc_bool_t
b_window_changed
;
/* window display toggled ? */
vlc_bool_t
b_slider_free
;
/* slider status */
/* Preference settings */
vlc_bool_t
b_autoplayfile
;
/* The input thread */
input_thread_t
*
p_input
;
};
/*****************************************************************************
* Useful macro
****************************************************************************/
#define GTK_GET( type, nom ) GTK_##type( gtk_object_get_data( \
GTK_OBJECT( p_intf->p_sys->p_window ), nom ) )
#define GtkGetIntf( widget ) E_(__GtkGetIntf)( GTK_WIDGET( widget ) )
void
*
E_
(
__GtkGetIntf
)(
GtkWidget
*
);
modules/gui/familiar/interface.c
deleted
100644 → 0
View file @
2c4e15bb
This diff is collapsed.
Click to expand it.
modules/gui/familiar/interface.h
deleted
100644 → 0
View file @
2c4e15bb
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
GtkWidget
*
create_familiar
(
void
);
modules/gui/familiar/network.c
deleted
100644 → 0
View file @
2c4e15bb
/*****************************************************************************
* network.c : Network interface of the gtk-familiar plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: network.c,v 1.1 2003/03/13 15:50:17 marcari Exp $
*
* Authors: Marc Ariberti <marcari@videolan.org>
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <sys/types.h>
/* off_t */
#include <stdlib.h>
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include <vlc/vout.h>
#include <stdio.h>
#include <string.h>
#include <dirent.h>
#include <sys/stat.h>
#include <unistd.h>
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <gtk/gtk.h>
#include "callbacks.h"
#include "interface.h"
#include "support.h"
#include "familiar.h"
static
void
update_network_multicast
(
GtkWidget
*
widget
);
static
void
update_network_multicast
(
GtkWidget
*
widget
)
{
intf_thread_t
*
p_intf
=
GtkGetIntf
(
widget
);
GtkToggleButton
*
p_network_multicast
=
GTK_GET
(
TOGGLE_BUTTON
,
"network_multicast"
);
GtkEditable
*
p_network_multicast_address
=
GTK_GET
(
EDITABLE
,
"network_multicast_address"
);
GtkEditable
*
p_network_multicast_port
=
GTK_GET
(
EDITABLE
,
"network_multicast_port"
);
if
(
gtk_toggle_button_get_active
(
p_network_multicast
))
{
gchar
*
str
=
g_strconcat
(
"udp://@"
,
gtk_editable_get_chars
(
p_network_multicast_address
,
0
,
-
1
),
":"
,
gtk_editable_get_chars
(
p_network_multicast_port
,
0
,
-
1
),
NULL
);
gtk_entry_set_text
(
p_intf
->
p_sys
->
p_mrlentry
,
str
);
g_free
(
str
);
}
}
void
on_network_multicast_toggled
(
GtkToggleButton
*
togglebutton
,
gpointer
user_data
)
{
update_network_multicast
(
GTK_WIDGET
(
togglebutton
));
}
void
on_network_multicast_port_changed
(
GtkEditable
*
editable
,
gpointer
user_data
)
{
update_network_multicast
(
GTK_WIDGET
(
editable
));
}
void
on_network_multicast_address_changed
(
GtkEditable
*
editable
,
gpointer
user_data
)
{
update_network_multicast
(
GTK_WIDGET
(
editable
));
}
void
on_network_http_toggled
(
GtkToggleButton
*
togglebutton
,
gpointer
user_data
)
{
intf_thread_t
*
p_intf
=
GtkGetIntf
(
togglebutton
);
if
(
gtk_toggle_button_get_active
(
togglebutton
))
{
gtk_entry_set_text
(
p_intf
->
p_sys
->
p_mrlentry
,
"http://"
);
}
}
void
on_network_ftp_toggled
(
GtkToggleButton
*
togglebutton
,
gpointer
user_data
)
{
intf_thread_t
*
p_intf
=
GtkGetIntf
(
togglebutton
);
if
(
gtk_toggle_button_get_active
(
togglebutton
))
{
gtk_entry_set_text
(
p_intf
->
p_sys
->
p_mrlentry
,
"ftp://"
);
}
}
void
on_network_mms_toggled
(
GtkToggleButton
*
togglebutton
,
gpointer
user_data
)
{
intf_thread_t
*
p_intf
=
GtkGetIntf
(
togglebutton
);
if
(
gtk_toggle_button_get_active
(
togglebutton
))
{
gtk_entry_set_text
(
p_intf
->
p_sys
->
p_mrlentry
,
"mms://"
);
}
}
modules/gui/familiar/network.h
deleted
100644 → 0
View file @
2c4e15bb
/*****************************************************************************
* network.h : Network part of the gtk-familiar plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: network.h,v 1.1 2003/03/13 15:50:17 marcari Exp $
*
* Authors: Marc Ariberti <marcari@videolan.org>
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
void
on_network_udp_toggled
(
GtkToggleButton
*
togglebutton
,
gpointer
user_data
);
void
on_network_udp_port_changed
(
GtkEditable
*
editable
,
gpointer
user_data
);
void
on_network_multicast_toggled
(
GtkToggleButton
*
togglebutton
,
gpointer
user_data
);
void
on_network_multicast_port_changed
(
GtkEditable
*
editable
,
gpointer
user_data
);
void
on_network_multicast_address_changed
(
GtkEditable
*
editable
,
gpointer
user_data
);
void
on_network_http_toggled
(
GtkToggleButton
*
togglebutton
,
gpointer
user_data
);
void
on_network_ftp_toggled
(
GtkToggleButton
*
togglebutton
,
gpointer
user_data
);
void
on_network_mms_toggled
(
GtkToggleButton
*
togglebutton
,
gpointer
user_data
);
void
FamiliarNetworkGo
(
GtkButton
*
button
,
gpointer
user_data
);
modules/gui/familiar/playlist.c
deleted
100644 → 0
View file @
2c4e15bb
/*****************************************************************************
* playlist.c : Playlist interface of the gtk-familiar plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: playlist.c,v 1.1 2003/03/13 15:50:17 marcari Exp $
*
* Authors: Marc Ariberti <marcari@videolan.org>
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <sys/types.h>
/* off_t */
#include <stdlib.h>
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include <vlc/vout.h>
#include <stdio.h>
#include <string.h>
#include <dirent.h>
#include <sys/stat.h>
#include <unistd.h>
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <gtk/gtk.h>
#include "interface.h"
#include "support.h"
#include "familiar.h"
#include "playlist.h"
gboolean
FamiliarPlaylistEvent
(
GtkWidget
*
widget
,
GdkEvent
*
event
,
gpointer
user_data
)
{
intf_thread_t
*
p_intf
=
GtkGetIntf
(
widget
);
playlist_t
*
p_playlist
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
if
(
p_playlist
==
NULL
)
{
return
FALSE
;
}
if
(
(
event
->
button
).
type
==
GDK_2BUTTON_PRESS
)
{
GtkCList
*
p_clist
;
gint
i_row
;
gint
i_col
;
p_clist
=
p_intf
->
p_sys
->
p_clistplaylist
;
if
(
gtk_clist_get_selection_info
(
p_clist
,
(
event
->
button
).
x
,
(
event
->
button
).
y
,
&
i_row
,
&
i_col
)
==
1
)
{
playlist_Goto
(
p_playlist
,
i_row
);
}
vlc_object_release
(
p_playlist
);
FamiliarRebuildCList
(
p_clist
,
p_playlist
);
return
TRUE
;
}
vlc_object_release
(
p_playlist
);
return
FALSE
;
}
void
FamiliarPlaylistClear
(
GtkButton
*
button
,
gpointer
user_data
)
{
intf_thread_t
*
p_intf
=
GtkGetIntf
(
button
);
playlist_t
*
p_playlist
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
int
item
;
if
(
p_playlist
==
NULL
)
{
return
;
}
for
(
item
=
p_playlist
->
i_size
-
1
;
item
>=
0
;
item
--
)
{
playlist_Delete
(
p_playlist
,
item
);
}
vlc_object_release
(
p_playlist
);
FamiliarRebuildCList
(
p_intf
->
p_sys
->
p_clistplaylist
,
p_playlist
);
}
void
FamiliarRebuildCList
(
GtkCList
*
p_clist
,
playlist_t
*
p_playlist
)
{
int
i_dummy
;
gchar
*
ppsz_text
[
2
];
GdkColor
red
;
red
.
red
=
65535
;
red
.
blue
=
0
;
red
.
green
=
0
;
gtk_clist_freeze
(
p_clist
);
gtk_clist_clear
(
p_clist
);
vlc_mutex_lock
(
&
p_playlist
->
object_lock
);
for
(
i_dummy
=
p_playlist
->
i_size
;
i_dummy
--
;
)
{
ppsz_text
[
0
]
=
p_playlist
->
pp_items
[
i_dummy
]
->
psz_name
;
ppsz_text
[
1
]
=
"no info"
;
gtk_clist_insert
(
p_clist
,
0
,
ppsz_text
);
}
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
gtk_clist_set_background
(
p_clist
,
p_playlist
->
i_index
,
&
red
);
gtk_clist_thaw
(
p_clist
);
}
void
FamiliarPlaylistUpdate
(
GtkButton
*
button
,
gpointer
user_data
)
{
intf_thread_t
*
p_intf
=
GtkGetIntf
(
button
);
playlist_t
*
p_playlist
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
if
(
p_playlist
==
NULL
)
{
return
;
}
FamiliarRebuildCList
(
p_intf
->
p_sys
->
p_clistplaylist
,
p_playlist
);
}
static
void
FamiliarDeleteGListItem
(
gpointer
data
,
gpointer
param
)
{
int
i_cur_row
=
(
long
)
data
;
playlist_t
*
p_playlist
=
param
;
playlist_Delete
(
p_playlist
,
i_cur_row
);
}
static
gint
FamiliarCompareItems
(
gconstpointer
a
,
gconstpointer
b
)
{
return
(
ptrdiff_t
)
(
(
int
*
)
b
-
(
int
*
)
a
);
}
void
FamiliarPlaylistDel
(
GtkButton
*
button
,
gpointer
user_data
)
{
/* user wants to delete a file in the queue */
GList
*
p_selection
;
intf_thread_t
*
p_intf
=
GtkGetIntf
(
button
);
playlist_t
*
p_playlist
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
if
(
p_playlist
==
NULL
)
{
return
;
}
/* lock the struct */
vlc_mutex_lock
(
&
p_intf
->
change_lock
);
p_selection
=
p_intf
->
p_sys
->
p_clistplaylist
->
selection
;
if
(
g_list_length
(
p_selection
)
)
{
/* reverse-sort so that we can delete from the furthest
* to the closest item to delete...
*/
p_selection
=
g_list_sort
(
p_selection
,
FamiliarCompareItems
);
g_list_foreach
(
p_selection
,
FamiliarDeleteGListItem
,
p_playlist
);
}
vlc_mutex_unlock
(
&
p_intf
->
change_lock
);
vlc_object_release
(
p_playlist
);
FamiliarRebuildCList
(
p_intf
->
p_sys
->
p_clistplaylist
,
p_playlist
);
}
modules/gui/familiar/playlist.h
deleted
100644 → 0
View file @
2c4e15bb
gboolean
FamiliarPlaylistEvent
(
GtkWidget
*
widget
,
GdkEvent
*
event
,
gpointer
user_data
);
void
FamiliarRebuildCList
(
GtkCList
*
p_clist
,
playlist_t
*
p_playlist
);
void
FamiliarPlaylistClear
(
GtkButton
*
button
,
gpointer
user_data
);
void
FamiliarPlaylistUpdate
(
GtkButton
*
button
,
gpointer
user_data
);
void
FamiliarPlaylistDel
(
GtkButton
*
button
,
gpointer
user_data
);
modules/gui/familiar/support.c
deleted
100644 → 0
View file @
2c4e15bb
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <gtk/gtk.h>
#include "support.h"
/* This is an internally used function to check if a pixmap file exists. */
static
gchar
*
check_file_exists
(
const
gchar
*
directory
,
const
gchar
*
filename
);
/* This is an internally used function to create pixmaps. */
static
GtkWidget
*
create_dummy_pixmap
(
GtkWidget
*
widget
);
GtkWidget
*
lookup_widget
(
GtkWidget
*
widget
,
const
gchar
*
widget_name
)
{
GtkWidget
*
parent
,
*
found_widget
;
for
(;;)
{
if
(
GTK_IS_MENU
(
widget
))
parent
=
gtk_menu_get_attach_widget
(
GTK_MENU
(
widget
));
else
parent
=
widget
->
parent
;
if
(
parent
==
NULL
)
break
;
widget
=
parent
;
}
found_widget
=
(
GtkWidget
*
)
gtk_object_get_data
(
GTK_OBJECT
(
widget
),
widget_name
);
if
(
!
found_widget
)
g_warning
(
"Widget not found: %s"
,
widget_name
);
return
found_widget
;
}
/* This is a dummy pixmap we use when a pixmap can't be found. */
static
char
*
dummy_pixmap_xpm
[]
=
{
/* columns rows colors chars-per-pixel */
"1 1 1 1"
,
" c None"
,
/* pixels */
" "
};
/* This is an internally used function to create pixmaps. */
static
GtkWidget
*
create_dummy_pixmap
(
GtkWidget
*
widget
)
{
GdkColormap
*
colormap
;
GdkPixmap
*
gdkpixmap
;
GdkBitmap
*
mask
;
GtkWidget
*
pixmap
;
colormap
=
gtk_widget_get_colormap
(
widget
);
gdkpixmap
=
gdk_pixmap_colormap_create_from_xpm_d
(
NULL
,
colormap
,
&
mask
,
NULL
,
dummy_pixmap_xpm
);
if
(
gdkpixmap
==
NULL
)
g_error
(
"Couldn't create replacement pixmap."
);
pixmap
=
gtk_pixmap_new
(
gdkpixmap
,
mask
);
gdk_pixmap_unref
(
gdkpixmap
);
gdk_bitmap_unref
(
mask
);
return
pixmap
;
}
static
GList
*
pixmaps_directories
=
NULL
;
/* Use this function to set the directory containing installed pixmaps. */
void
add_pixmap_directory
(
const
gchar
*
directory
)
{
pixmaps_directories
=
g_list_prepend
(
pixmaps_directories
,
g_strdup
(
directory
));
}
/* This is an internally used function to create pixmaps. */
GtkWidget
*
create_pixmap
(
GtkWidget
*
widget
,
const
gchar
*
filename
)
{
gchar
*
found_filename
=
NULL
;
GdkColormap
*
colormap
;
GdkPixmap
*
gdkpixmap
;
GdkBitmap
*
mask
;
GtkWidget
*
pixmap
;
GList
*
elem
;
if
(
!
filename
||
!
filename
[
0
])
return
create_dummy_pixmap
(
widget
);
/* We first try any pixmaps directories set by the application. */
elem
=
pixmaps_directories
;
while
(
elem
)
{
found_filename
=
check_file_exists
((
gchar
*
)
elem
->
data
,
filename
);
if
(
found_filename
)
break
;
elem
=
elem
->
next
;
}
/* If we haven't found the pixmap, try the source directory. */
if
(
!
found_filename
)
{
found_filename
=
check_file_exists
(
"../../../share"
,
filename
);
}
if
(
!
found_filename
)
{
g_warning
(
_
(
"Couldn't find pixmap file: %s"
),
filename
);
return
create_dummy_pixmap
(
widget
);
}
colormap
=
gtk_widget_get_colormap
(
widget
);
gdkpixmap
=
gdk_pixmap_colormap_create_from_xpm
(
NULL
,
colormap
,
&
mask
,
NULL
,
found_filename
);
if
(
gdkpixmap
==
NULL
)
{
g_warning
(
_
(
"Error loading pixmap file: %s"
),
found_filename
);
g_free
(
found_filename
);
return
create_dummy_pixmap
(
widget
);
}
g_free
(
found_filename
);
pixmap
=
gtk_pixmap_new
(
gdkpixmap
,
mask
);
gdk_pixmap_unref
(
gdkpixmap
);
gdk_bitmap_unref
(
mask
);
return
pixmap
;
}
/* This is an internally used function to check if a pixmap file exists. */
static
gchar
*
check_file_exists
(
const
gchar
*
directory
,
const
gchar
*
filename
)
{
gchar
*
full_filename
;
struct
stat
s
;
gint
status
;
full_filename
=
(
gchar
*
)
g_malloc
(
strlen
(
directory
)
+
1
+
strlen
(
filename
)
+
1
);
strcpy
(
full_filename
,
directory
);
strcat
(
full_filename
,
G_DIR_SEPARATOR_S
);
strcat
(
full_filename
,
filename
);
status
=
stat
(
full_filename
,
&
s
);
if
(
status
==
0
&&
S_ISREG
(
s
.
st_mode
))
return
full_filename
;
g_free
(
full_filename
);
return
NULL
;
}
modules/gui/familiar/support.h
deleted
100644 → 0
View file @
2c4e15bb
/*
* Created by glade, fixed by bootstrap
*/
#ifdef HAVE_CONFIG_H
# include <vlc/vlc.h>
#endif
#include <gtk/gtk.h>
/*
* Standard gettext macros.
*/
#if 0 /* Disabled by bootstrap */
# include <libintl.h>
# undef _
# define _(String) dgettext (PACKAGE, String)
# ifdef gettext_noop
# define N_(String) gettext_noop (String)
# else
# define N_(String) (String)
# endif
/* #else */
# define textdomain(String) (String)
# define gettext(String) (String)
# define dgettext(Domain,Message) (Message)
# define dcgettext(Domain,Message,Type) (Message)
# define bindtextdomain(Domain,Directory) (Domain)
# define _(String) (String)
# define N_(String) (String)
#endif
/*
* Public Functions.
*/
/*
* This function returns a widget in a component created by Glade.
* Call it with the toplevel widget in the component (i.e. a window/dialog),
* or alternatively any widget in the component, and the name of the widget
* you want returned.
*/
GtkWidget
*
lookup_widget
(
GtkWidget
*
widget
,
const
gchar
*
widget_name
);
/* get_widget() is deprecated. Use lookup_widget instead. */
#define get_widget lookup_widget
/* Use this function to set the directory containing installed pixmaps. */
void
add_pixmap_directory
(
const
gchar
*
directory
);
/*
* Private Functions.
*/
/* This is used to create the pixmaps in the interface. */
GtkWidget
*
create_pixmap
(
GtkWidget
*
widget
,
const
gchar
*
filename
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment