Commit 78eb43ed authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

Reenable some things and ifdef out others. Put gnome-run back. Compiles

Tue Sep 04 23:07:54 2001  George Lebl <jirka@5z.com>

	* Makefile.am, basep-widget.[ch], conditional.c, foobar-widget.c,
	  gnome-run.c, main.c, menu.c, panel-util.c, panel-widget.c,
	  panel_config.c, session.c, tasklist_icon.c:  Reenable some things
	  and ifdef out others.  Put gnome-run back.  Compiles with latest
	  libgnome/ui now.
parent 45674df8
Tue Sep 04 23:07:54 2001 George Lebl <jirka@5z.com>
* Makefile.am, basep-widget.[ch], conditional.c, foobar-widget.c,
gnome-run.c, main.c, menu.c, panel-util.c, panel-widget.c,
panel_config.c, session.c, tasklist_icon.c: Reenable some things
and ifdef out others. Put gnome-run back. Compiles with latest
libgnome/ui now.
2001-08-31 Kevin Vandersloot <kfv101@psu.edu>
* panel_widget.c (panel_widget_get_free_space): fix
......
......@@ -136,6 +136,7 @@ panel_sources = \
panel_config.c \
status.c \
distribution.c \
gnome-run.c \
menu.c \
menu-util.c \
menu-rh.c \
......@@ -179,6 +180,7 @@ panel_headers = \
panel_config_global.h \
status.h \
distribution.h \
gnome-run.h \
menu.h \
menu-util.h \
menu-rh.h \
......
......@@ -1100,6 +1100,7 @@ basep_widget_show_hidebutton_pixmaps(BasePWidget *basep)
void
basep_widget_update_winhints (BasePWidget *basep)
{
#if FIXME
GtkWidget *w = GTK_WIDGET (basep);
GnomeWinLayer layer;
guint coverhint;
......@@ -1168,6 +1169,7 @@ basep_widget_update_winhints (BasePWidget *basep)
: WIN_LAYER_ABOVE_DOCK);
break;
}
#endif
}
void
......
......@@ -315,7 +315,9 @@ void basep_border_get (int screen,
int *center,
int *right);
/* FIXME:
#define GNOME_PANEL_HINTS (WIN_HINTS_SKIP_FOCUS|WIN_HINTS_SKIP_WINLIST|WIN_HINTS_SKIP_TASKBAR)
*/
G_END_DECLS
......
......@@ -11,6 +11,7 @@
#include <sys/wait.h>
#include "panel-include.h"
#include <libgnome/gnome-config.h>
#include "conditional.h"
......
......@@ -660,6 +660,7 @@ foobar_widget_set_clock_format (FoobarWidget *foo, const char *clock_format)
void
foobar_widget_update_winhints (FoobarWidget *foo)
{
#if FIXME
GtkWidget *w = GTK_WIDGET (foo);
GnomeWinLayer layer;
......@@ -687,6 +688,7 @@ foobar_widget_update_winhints (FoobarWidget *foo)
layer = WIN_LAYER_DOCK;
}
gnome_win_hints_set_layer (w, layer);
#endif
}
static void
......
......@@ -22,7 +22,8 @@
*/
#include <config.h>
#include <libgnomeui/gnome-window-icon.h>
#include <libgnome.h>
#include <libgnomeui.h>
#include <errno.h>
#include <sys/types.h>
#include <dirent.h>
......@@ -78,7 +79,7 @@ static void
fill_executables (void)
{
int i;
char *path;
const char *path;
char **pathv;
g_list_foreach (executables, (GFunc) g_free, NULL);
......@@ -178,9 +179,10 @@ string_callback (GtkWidget *w, int button_num, gpointer data)
GtkEntry *entry;
GtkWidget *clist;
GtkToggleButton *terminal;
char **argv, **temp_argv = NULL;
char **argv;
char **temp_argv = NULL;
int argc, temp_argc;
char *s;
const char *s;
GSList *tofree = NULL;
char **envv = NULL;
int envc;
......@@ -216,6 +218,7 @@ string_callback (GtkWidget *w, int button_num, gpointer data)
name = gtk_clist_get_row_data (GTK_CLIST (clist),
GPOINTER_TO_INT (GTK_CLIST (clist)->selection->data));
if (name) {
#if FIXME
GnomeDesktopEntry *dentry;
dentry = gnome_desktop_entry_load (name);
......@@ -231,6 +234,7 @@ string_callback (GtkWidget *w, int button_num, gpointer data)
} else {
panel_error_dialog (_("Failed to load this program!\n"));
}
#endif
}
} else {
entry = GTK_ENTRY (gtk_object_get_data(GTK_OBJECT(w), "entry"));
......@@ -265,13 +269,13 @@ string_callback (GtkWidget *w, int button_num, gpointer data)
/* Somewhat of a hack I suppose */
if (panel_is_url (s)) {
gnome_url_show (s);
gnome_url_show (s, NULL);
goto return_and_close;
}
/* we use a popt function as it does exactly what we want to do and
gnome already uses popt */
if (poptParseArgvString (s, &temp_argc, &temp_argv) != 0) {
if (poptParseArgvString (s, &temp_argc, (const char ***)&temp_argv) != 0) {
panel_error_dialog (_("Failed to execute command:\n"
"%s"), s);
goto return_and_close;
......@@ -345,7 +349,7 @@ return_and_close:
static void
browse_ok(GtkWidget *widget, GtkFileSelection *fsel)
{
char *fname;
const char *fname;
GtkWidget *entry;
g_return_if_fail(GTK_IS_FILE_SELECTION(fsel));
......@@ -354,13 +358,13 @@ browse_ok(GtkWidget *widget, GtkFileSelection *fsel)
fname = gtk_file_selection_get_filename(fsel);
if(fname != NULL) {
char *s = gtk_entry_get_text (GTK_ENTRY (entry));
const char *s = gtk_entry_get_text (GTK_ENTRY (entry));
if (string_empty (s)) {
gtk_entry_set_text (GTK_ENTRY (entry), fname);
} else {
s = g_strconcat (s, " ", fname, NULL);
gtk_entry_set_text (GTK_ENTRY (entry), s);
g_free (s);
char *str = g_strconcat (s, " ", fname, NULL);
gtk_entry_set_text (GTK_ENTRY (entry), str);
g_free (str);
}
}
gtk_widget_destroy(GTK_WIDGET(fsel));
......@@ -410,7 +414,7 @@ entry_event (GtkEntry * entry, GdkEventKey * event, gpointer data)
ensure_completion ();
pos = GTK_EDITABLE (entry)->current_pos;
pos = gtk_editable_get_position (GTK_EDITABLE (entry));
prefix = gtk_editable_get_chars (GTK_EDITABLE (entry), 0, pos);
g_completion_complete (exe_completion, prefix, &nprefix);
......@@ -422,7 +426,7 @@ entry_event (GtkEntry * entry, GdkEventKey * event, gpointer data)
strlen (nprefix) -
strlen (prefix),
&pos);
GTK_EDITABLE (entry)->current_pos = pos;
gtk_editable_set_position (GTK_EDITABLE (entry), pos);
} else {
gdk_beep ();
}
......@@ -474,6 +478,7 @@ sync_list_to_entry (GtkWidget *dialog)
name = gtk_clist_get_row_data (GTK_CLIST (clist),
GPOINTER_TO_INT (GTK_CLIST (clist)->selection->data));
if (name) {
#if FIXME
GnomeDesktopEntry *dentry;
dentry = gnome_desktop_entry_load (name);
......@@ -491,6 +496,7 @@ sync_list_to_entry (GtkWidget *dialog)
gnome_desktop_entry_free (dentry);
g_free (command);
}
#endif
}
}
......@@ -754,12 +760,12 @@ simple_contents_shown (GtkWidget *vbox,
fr = tmp->data;
if (fr->icon != NULL) {
pixbuf = gdk_pixbuf_new_from_file (fr->icon);
pixbuf = gdk_pixbuf_new_from_file (fr->icon, NULL);
} else {
pixbuf = NULL;
}
if (pixbuf) {
if (pixbuf != NULL) {
GdkPixbuf *scaled;
scaled = gdk_pixbuf_scale_simple (pixbuf, CLIST_ICON_SIZE, CLIST_ICON_SIZE, GDK_INTERP_BILINEAR);
gdk_pixbuf_render_pixmap_and_mask (scaled,
......@@ -913,6 +919,7 @@ select_row_handler (GtkCList *clist,
row);
if (name) {
#if FIXME
GnomeDesktopEntry *dentry;
dentry = gnome_desktop_entry_load (name);
......@@ -959,6 +966,7 @@ select_row_handler (GtkCList *clist,
gnome_desktop_entry_free (dentry);
}
#endif
}
sync_list_to_entry (dialog);
......@@ -1144,8 +1152,10 @@ show_run_dialog (void)
gtk_window_set_default_size (GTK_WINDOW (run_dialog),
-1, 400);
#if FIXME
gnome_window_icon_set_from_file (GTK_WINDOW (run_dialog),
GNOME_ICONDIR"/gnome-run.png");
#endif
gtk_signal_connect(GTK_OBJECT(run_dialog), "destroy",
GTK_SIGNAL_FUNC(gtk_widget_destroyed),
&run_dialog);
......
......@@ -11,9 +11,8 @@
#include <string.h>
#include <signal.h>
#include <sys/wait.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-util.h>
#include <libgnomeui/gnome-ui-init.h>
#include <libgnome.h>
#include <libgnomeui.h>
#include <bonobo-activation/bonobo-activation.h>
#include <bonobo/bonobo-ui-main.h>
......@@ -46,9 +45,7 @@ extern GSList *panel_list;
GtkTooltips *panel_tooltips = NULL;
#ifdef FIXME
GnomeClient *client = NULL;
#endif
char *kde_menudir = NULL;
char *kde_icondir = NULL;
......@@ -242,7 +239,6 @@ check_screen (void)
return;
tmp = gdk_pixbuf_new_from_file (phsh_file, NULL);
/* FIXME:2 check error, for, well, errors */
if (tmp == NULL)
return;
......@@ -389,8 +385,10 @@ setup_merge_directory(void)
{
int len;
/* FIXME:2 this used to be gnome_datadir_file("gnome/apps") */
merge_main_dir = "/gnome/GNOME20/share/gnome/apps/";
merge_main_dir = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_DATADIR,
"gnome/apps",
FALSE /* only if exists */,
NULL /* ret locations */);
merge_main_dir_len = merge_main_dir != NULL ? strlen (merge_main_dir) : 0;
merge_merge_dir = conditional_get_string ("/panel/Merge/Directory",
"/etc/X11/applnk/",
......@@ -471,14 +469,13 @@ main(int argc, char **argv)
{
CORBA_ORB orb;
gboolean duplicate;
#ifdef FIXME
gchar *real_global_path;
#endif
bindtextdomain (PACKAGE, GNOMELOCALEDIR);
textdomain (PACKAGE);
gnome_program_init ("panel", VERSION, &libgnomeui_module_info,
gnome_program_init ("panel", VERSION,
LIBGNOMEUI_MODULE,
argc, argv, NULL);
do_the_roswell_check ();
......@@ -525,7 +522,6 @@ main(int argc, char **argv)
find_kde_directory();
#ifdef FIXME
client = gnome_master_client ();
gnome_client_set_restart_style (client, duplicate
......@@ -541,8 +537,7 @@ main(int argc, char **argv)
old_panel_cfg_path = g_strdup ("/panel.d/default/");
#ifndef PER_SESSION_CONFIGURATION
/*FIXME:2 why did I comment this out ??? It complained 'gnome_user_dir' undeclared */
/* real_global_path = gnome_config_get_real_path (old_panel_cfg_path); */
real_global_path = gnome_config_get_real_path (old_panel_cfg_path);
real_global_path = "";
if ( ! panel_file_exists (real_global_path)) {
g_free (old_panel_cfg_path);
......@@ -557,14 +552,15 @@ main(int argc, char **argv)
GTK_SIGNAL_FUNC (panel_session_save), NULL);
gtk_signal_connect (GTK_OBJECT (client), "die",
GTK_SIGNAL_FUNC (panel_session_die), NULL);
#endif
panel_tooltips = gtk_tooltips_new ();
xstuff_init ();
multiscreen_init ();
#if FIXME
gnome_win_hints_init ();
#endif
load_system_wide ();
......
......@@ -22,8 +22,8 @@
#include <errno.h>
#include <math.h>
#include <gdk/gdkkeysyms.h>
#include <libgnome/gnome-util.h>
#include <libgnome/gnome-config.h>
#include <libgnome.h>
#include <libgnomeui.h>
#include "panel-include.h"
#include "panel-widget.h"
......@@ -2664,10 +2664,12 @@ show_tearoff_menu (GtkWidget *menu, const char *title, gboolean cursor_position,
GDK_DECOR_MAXIMIZE);
gtk_window_set_policy (GTK_WINDOW (win), FALSE, FALSE, TRUE);
my_gtk_menu_reparent (GTK_MENU (menu), win, FALSE);
#if FIXME
/* set sticky so that we mask the fact that we have no clue
how to restore non sticky windows */
gnome_win_hints_set_state (win, gnome_win_hints_get_state (win) |
WIN_STATE_STICKY);
#endif
GTK_MENU (menu)->torn_off = TRUE;
......@@ -6019,12 +6021,14 @@ save_tornoff (void)
gnome_config_set_int("menu_panel", menu_panel);
gnome_config_set_int("menu_unique_panel_id", menu_panel_id);
#if FIXME
gnome_config_set_int("workspace",
gnome_win_hints_get_workspace(tw));
gnome_config_set_int("hints",
gnome_win_hints_get_hints(tw));
gnome_config_set_int("state",
gnome_win_hints_get_state(tw));
#endif
gnome_config_set_string("special",
sure_string (tm->special));
......@@ -6217,9 +6221,11 @@ load_tearoff_menu(void)
{
GtkWidget *window = GTK_MENU(menu)->tearoff_window;
#if FIXME
gnome_win_hints_set_workspace(window,workspace);
gnome_win_hints_set_hints(window,hints);
gnome_win_hints_set_state(window,state);
#endif
}
tm = g_new0(TearoffMenu,1);
......
......@@ -21,7 +21,8 @@
#include "multiscreen-stuff.h"
#include "nothing.cP"
#include <libgnomeui/gnome-uidefs.h>
#include <libgnome.h>
#include <libgnomeui.h>
static void config_apply (PerPanelConfig *ppc);
......
......@@ -780,6 +780,7 @@ static GSList *layered_dialogs = NULL;
static void
panel_dialog_realized (GtkWidget *dialog)
{
#if FIXME
if ( ! global_config.keep_bottom &&
! global_config.normal_layer)
gnome_win_hints_set_layer (GTK_WIDGET(dialog),
......@@ -787,6 +788,7 @@ panel_dialog_realized (GtkWidget *dialog)
else
gnome_win_hints_set_layer (GTK_WIDGET (dialog),
WIN_LAYER_NORMAL);
#endif
}
static void
......@@ -798,6 +800,7 @@ remove_from_layered (GtkWidget *w)
void
panel_set_dialog_layer (GtkWidget *dialog)
{
#if FIXME
if (g_slist_find (layered_dialogs, dialog) == NULL) {
layered_dialogs = g_slist_prepend (layered_dialogs, dialog);
gtk_signal_connect (GTK_OBJECT (dialog), "destroy",
......@@ -814,11 +817,13 @@ panel_set_dialog_layer (GtkWidget *dialog)
gtk_signal_connect (GTK_OBJECT (dialog), "realize",
GTK_SIGNAL_FUNC (panel_dialog_realized),
NULL);
#endif
}
void
panel_reset_dialog_layers (void)
{
#if FIXME
GSList *li;
for (li = layered_dialogs; li != NULL; li = li->next) {
......@@ -835,6 +840,7 @@ panel_reset_dialog_layers (void)
gnome_win_hints_set_layer (GTK_WIDGET (dialog),
WIN_LAYER_NORMAL);
}
#endif
}
GtkWidget *
......
......@@ -47,8 +47,6 @@ static void panel_widget_cremove (GtkContainer *container,
GtkWidget *widget);
static int panel_widget_expose (GtkWidget *widget,
GdkEventExpose *event);
static void panel_widget_draw (GtkWidget *widget,
GdkRectangle *area);
static void applet_move (PanelWidget *panel,
GtkWidget *applet);
......@@ -247,8 +245,6 @@ panel_widget_class_init (PanelWidgetClass *class)
widget_class->size_request = panel_widget_size_request;
widget_class->size_allocate = panel_widget_size_allocate;
widget_class->expose_event = panel_widget_expose;
/* FIXME:2 is this necessary in GTK2? Compression stuff shouldn't be done */
/* widget_class->draw = panel_widget_draw; */
container_class->add = panel_widget_cadd;
container_class->remove = panel_widget_cremove;
......@@ -1140,42 +1136,6 @@ panel_widget_draw_icon(PanelWidget *panel, ButtonWidget *button)
panel_widget_draw_all(panel, &area);
}
static void
panel_widget_draw(GtkWidget *widget, GdkRectangle *area)
{
GList *li;
PanelWidget *panel;
g_return_if_fail(widget!=NULL);
g_return_if_fail(IS_PANEL_WIDGET(widget));
#ifdef PANEL_DEBUG
puts("PANEL_WIDGET_DRAW");
printf("allocation %d x %d\n",
widget->allocation.width,
widget->allocation.height);
#endif
panel = PANEL_WIDGET(widget);
if(!GTK_WIDGET_DRAWABLE(widget) ||
panel->inhibit_draw)
return;
panel_widget_draw_all(panel, area);
for(li = panel->applet_list;
li != NULL;
li = g_list_next(li)) {
AppletData *ad = li->data;
GdkRectangle ch_area;
if(!IS_BUTTON_WIDGET(ad->applet) &&
gtk_widget_intersect(ad->applet, area, &ch_area))
gtk_widget_draw(ad->applet, &ch_area);
}
}
static int
panel_widget_expose(GtkWidget *widget, GdkEventExpose *event)
{
......
......@@ -21,7 +21,8 @@
#include "multiscreen-stuff.h"
#include "nothing.cP"
#include <libgnomeui/gnome-uidefs.h>
#include <libgnome.h>
#include <libgnomeui.h>
static void config_apply (PerPanelConfig *ppc);
......
......@@ -15,6 +15,8 @@
#include <sys/wait.h>
#include <gnome-desktop/gnome-desktop-item.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-init.h>
#include <libgnome/gnome-config.h>
#include <gdk/gdkx.h>
#include <X11/keysym.h>
#include "panel-include.h"
......@@ -256,9 +258,11 @@ apply_global_config (void)
static void
timeout_dlg_realized (GtkWidget *dialog)
{
#if FIXME
/* always make top layer */
gnome_win_hints_set_layer (GTK_WIDGET(dialog),
WIN_LAYER_ABOVE_DOCK);
#endif
}
static gboolean
......@@ -414,6 +418,7 @@ save_applet_configuration(AppletInfo *info)
case APPLET_EXTERN:
{
Extern *ext = info->data;
char *s;
/*just in case the applet times out*/
gnome_config_set_string("id", EMPTY_ID);
......@@ -429,11 +434,9 @@ save_applet_configuration(AppletInfo *info)
gnome_config_pop_prefix();
gnome_config_sync();*/
/* but gnome-config.[ch] is broken ! */
#ifdef FIXME
s = gnome_config_get_real_path (buf->str);
unlink(s);
g_free(s);
#endif
gnome_config_sync();
......@@ -758,7 +761,6 @@ static gboolean sync_handler_needed = FALSE;
void
panel_config_sync(void)
{
#ifdef FIXME
int ncs = need_complete_save;
int ats = applets_to_sync;
int pts = panels_to_sync;
......@@ -793,7 +795,6 @@ panel_config_sync(void)
}
#endif /* PER_SESSION_CONFIGURATION */
}
#endif
}
static gboolean
......@@ -895,10 +896,8 @@ panel_session_die (GnomeClient *client,
void
panel_quit (void)
{
#ifdef FIXME
gnome_client_request_save (client, GNOME_SAVE_BOTH, 1,
GNOME_INTERACT_ANY, 0, 1);
#endif
}
/* try evil hacks to rewrite panel config from old applets (gnomepager for
......@@ -1120,9 +1119,7 @@ init_user_applets(void)
load_status_applet (panel, pos, TRUE);
} else if (strcmp (applet_name, RUN_ID) == 0) {
#ifdef FIXME
load_run_applet (panel, pos, TRUE);
#endif
} else if (strcmp (applet_name, SWALLOW_ID) == 0) {
char *path = conditional_get_string ("execpath",
......
......@@ -8,6 +8,7 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include "gwmh.h"
#include "xstuff.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment