changeset 4042:a3ec0146c73e

[gaim-migrate @ 4250] undo winprefs/transparency committer: Tailor Script <tailor@pidgin.im>
author Herman Bloggs <hermanator12002@yahoo.com>
date Wed, 04 Dec 2002 00:07:11 +0000
parents 3a36ec242415
children e25edee01c33
files src/Makefile.mingw src/conversation.c src/gaimrc.c src/prefs.c src/win32/mingw_plus/winuser_extra.h src/win32/win32dep.c src/win32/win32dep.h src/win32/winprefs.c src/win32/winprefs.h
diffstat 9 files changed, 1 insertions(+), 262 deletions(-) [+]
line wrap: on
line diff
--- a/src/Makefile.mingw	Tue Dec 03 22:26:54 2002 +0000
+++ b/src/Makefile.mingw	Wed Dec 04 00:07:11 2002 +0000
@@ -103,8 +103,7 @@
 			win32/win32dep.c \
 			win32/MinimizeToTray.c \
 			win32/libc_interface.c \
-			win32/systray.c \
-			win32/winprefs.c
+			win32/systray.c
 
 RC_SRC =		win32/gaimrc.rc
 
--- a/src/conversation.c	Tue Dec 03 22:26:54 2002 +0000
+++ b/src/conversation.c	Wed Dec 04 00:07:11 2002 +0000
@@ -2853,17 +2853,6 @@
 			menubar = build_conv_menubar(c);
 			gtk_box_pack_start(GTK_BOX(testidea), menubar, FALSE, TRUE, 0);
 			gtk_box_pack_start(GTK_BOX(testidea), convo_notebook, TRUE, TRUE, 0);
-#ifdef _WIN32
-			/* Windows transparency slider */
-			if ((wgaim_options & OPT_WGAIM_IMTRANS) &&
-			    (wgaim_options & OPT_WGAIM_SHOW_IMTRANS)) {
-				gtk_box_pack_start(GTK_BOX(testidea),
-						   wgaim_wintrans_slider(win),
-						   FALSE, FALSE, 0);
-			} else if(wgaim_options & OPT_WGAIM_IMTRANS) {
-				wgaim_set_wintrans(win, wgaim_get_imalpha());
-			}
-#endif
 			gtk_widget_show(testidea);
 			gtk_widget_show(convo_notebook);
 			convo_menubar = menubar;
@@ -2998,23 +2987,6 @@
 	gtk_box_pack_start(GTK_BOX(vbox2), bbox, FALSE, FALSE, 0);
 	gtk_widget_show(bbox);
 
-#ifdef _WIN32
-	/* Windows transparency slider */
-	if ((wgaim_options & OPT_WGAIM_IMTRANS) &&
-	    (wgaim_options & OPT_WGAIM_SHOW_IMTRANS) &&
-	    !(im_options & OPT_IM_ONE_WINDOW)) {
-		GtkWidget *wsep = gtk_hseparator_new();
-		gtk_box_pack_start(GTK_BOX(vbox2), wsep, FALSE, FALSE, 0);
-		gtk_widget_show(wsep);
-		gtk_box_pack_start(GTK_BOX(vbox2),
-				   wgaim_wintrans_slider(c->window),
-				   FALSE, FALSE, 0);
-	} else if((wgaim_options & OPT_WGAIM_IMTRANS) &&
-		  !(im_options & OPT_IM_ONE_WINDOW)) {
-		wgaim_set_wintrans(win, wgaim_get_imalpha());
-	}
-#endif
-
 /* I'm leaving this here just incase we want to bring this back. I'd rather not have the close
  * button any more.  If we do, though, it needs to be on the left side.  I might bring it back and put
  * it on that side.  */
--- a/src/gaimrc.c	Tue Dec 03 22:26:54 2002 +0000
+++ b/src/gaimrc.c	Wed Dec 04 00:07:11 2002 +0000
@@ -57,9 +57,6 @@
 guint sound_options;
 guint away_options;
 guint away_resend;
-#ifdef _WIN32
-guint wgaim_options;
-#endif
 
 int report_idle;
 int web_browser;
@@ -769,10 +766,6 @@
 		} else if (!strcmp(p->option, "away_options")) {
 			away_options = atoi(p->value[0]);
 			away_resend = atoi(p->value[1]);
-#ifdef _WIN32
-		} else if(!strcmp(p->option, "wgaim_options")) {
-			wgaim_options = atoi(p->value[0]);
-#endif
 		} else if (!strcmp(p->option, "font_face")) {
 			g_snprintf(fontface, sizeof(fontface), "%s", p->value[0]);
 		} else if (!strcmp(p->option, "font_size")) {
@@ -881,9 +874,6 @@
 	fprintf(f, "\tfont_options { %u }\n", font_options);
 	fprintf(f, "\tsound_options { %u }\n", sound_options);
 	fprintf(f, "\taway_options { %u } { %u }\n", away_options, away_resend);
-#ifdef _WIN32
-	fprintf(f, "\twgaim_options { %u }\n", wgaim_options);
-#endif
 	fprintf(f, "\tfont_face { %s }\n", fontface);
 	fprintf(f, "\tfont_size { %d }\n", fontsize);
 	fprintf(f, "\tforeground { %d } { %d } { %d }\n", fgcolor.red, fgcolor.green, fgcolor.blue);
@@ -1130,38 +1120,6 @@
 	fprintf(f, "}\n");
 }
 
-#ifdef _WIN32
-static void gaimrc_read_wgaim(FILE *f)
-{
-	char buf[2048];
-	struct parse parse_buffer;
-	struct parse *p;
-
-	buf[0] = 0;
-
-	while (buf[0] != '}') {
-		if (buf[0] == '#')
-			continue;
-
-		if (!fgets(buf, sizeof(buf), f))
-			return;
-
-		p = parse_line(buf, &parse_buffer);
-
-		if (!strcmp(p->option, "imalpha")) {
-			wgaim_set_imalpha(atoi(p->value[0]));
-		}
-	}
-}
-
-static void gaimrc_write_wgaim(FILE *f)
-{
-	fprintf(f, "wgaim {\n");
-	fprintf(f, "\timalpha { %d }\n", wgaim_get_imalpha());
-	fprintf(f, "}\n");
-}
-#endif
-
 static void set_defaults()
 {
 	int i;
@@ -1206,10 +1164,6 @@
 	away_options =
 		OPT_AWAY_BACK_ON_IM;
 
-#ifdef _WIN32
-	wgaim_options = 0;
-#endif
-
 	for (i = 0; i < NUM_SOUNDS; i++)
 		sound_file[i] = NULL;
 	font_options = 0;
@@ -1304,11 +1258,6 @@
 			case 7:
 				gaimrc_read_proxy(f);
 				break;
-#ifdef _WIN32
-			case 8:
-				gaimrc_read_wgaim(f);
-				break;
-#endif
 			default:
 				/* NOOP */
 				break;
@@ -1350,9 +1299,6 @@
 		gaimrc_write_plugins(f);
 #endif
 		gaimrc_write_proxy(f);
-#ifdef _WIN32
-		gaimrc_write_wgaim(f);
-#endif
 		fclose(f);
 
 		chmod(buf, S_IRUSR | S_IWUSR);
--- a/src/prefs.c	Tue Dec 03 22:26:54 2002 +0000
+++ b/src/prefs.c	Wed Dec 04 00:07:11 2002 +0000
@@ -1398,9 +1398,6 @@
 	prefs_notebook_add_page(_("Sound Events"), NULL, sound_events_page(), &c, &p, notebook_page++);
 	prefs_notebook_add_page(_("Away / Idle"), NULL, away_page(), &p, NULL, notebook_page++);
 	prefs_notebook_add_page(_("Away Messages"), NULL, away_message_page(), &c, &p, notebook_page++);
-#ifdef _WIN32
-	prefs_notebook_add_page(_("Windows Only"), NULL, wgaim_winprefs_page(), &p, NULL, notebook_page++);
-#endif
 #if USE_PLUGINS
 	prefs_notebook_add_page(_("Plugins"), NULL, plugin_page(), &plugin_iter, NULL, notebook_page++);
 	while (l) {
@@ -1748,14 +1745,6 @@
 	save_prefs();
 }
 
-#ifdef _WIN32
-static void set_wgaim_option(GtkWidget *w, int option)
-{
-	wgaim_options ^= option;
-	save_prefs();
-}
-#endif
-
 GtkWidget *gaim_button(const char *text, guint *options, int option, GtkWidget *page)
 {
 	GtkWidget *button;
@@ -1788,11 +1777,6 @@
 	if (options == &sound_options)
 		gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_sound_option),
 				   (int *)option);
-#ifdef _WIN32
-	if (options == &wgaim_options)
-		gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_wgaim_option),
-				   (int *)option);
-#endif
 	gtk_widget_show(button);
 
 	return button;
--- a/src/win32/mingw_plus/winuser_extra.h	Tue Dec 03 22:26:54 2002 +0000
+++ b/src/win32/mingw_plus/winuser_extra.h	Wed Dec 04 00:07:11 2002 +0000
@@ -27,13 +27,4 @@
     DWORD dwTimeout;
 } FLASHWINFO, *PFLASHWINFO;
 
-/* These defines aren't found in the current version of mingw */
-#ifndef LWA_ALPHA
-#define LWA_ALPHA               0x00000002
-#endif
-
-#ifndef WS_EX_LAYERED
-#define WS_EX_LAYERED           0x00080000
-#endif
-
 #endif /* _WINUSER_EXTRA_H_ */
--- a/src/win32/win32dep.c	Tue Dec 03 22:26:54 2002 +0000
+++ b/src/win32/win32dep.c	Wed Dec 04 00:07:11 2002 +0000
@@ -40,7 +40,6 @@
 static char lib_dir[MAXPATHLEN];
 static char locale_dir[MAXPATHLEN];
 static int bhide_icon;
-static int imalpha = 255;
 
 /*
  *  GLOBALS
@@ -52,8 +51,6 @@
  *  PROTOS
  */
 BOOL (*MyFlashWindowEx)(PFLASHWINFO pfwi)=NULL;
-BOOL (*MySetLayeredWindowAttributes)(HWND hwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags)=NULL;
-void wgaim_set_wintrans(GtkWidget *window, int trans);
 
 /*
  *  STATIC CODE
@@ -108,13 +105,6 @@
 static void load_winver_specific_procs(void) {
 	/* Used for Win98+ and WinNT5+ */
 	MyFlashWindowEx = (void*)find_and_loadproc("user32.dll", "FlashWindowEx" );
-	/* Used for Win2k+ */
-	MySetLayeredWindowAttributes = (void*)find_and_loadproc("user32.dll", "SetLayeredWindowAttributes" );
-}
-
-/* Transparency slider callbacks */
-static void change_im_alpha(GtkWidget *w, gpointer data) {
-	wgaim_set_wintrans(GTK_WIDGET(data), gtk_range_get_value(GTK_RANGE(w)));
 }
 
 /*
@@ -187,52 +177,6 @@
 	}
 }
 
-/* Set window transparency level */
-void wgaim_set_wintrans(GtkWidget *window, int trans) {
-	if(MySetLayeredWindowAttributes) {
-		HWND hWnd = GDK_WINDOW_HWND(window->window);
-		SetWindowLong(hWnd,GWL_EXSTYLE,GetWindowLong(hWnd,GWL_EXSTYLE) | WS_EX_LAYERED);
-		MySetLayeredWindowAttributes(hWnd,0,trans,LWA_ALPHA);
-	}
-}
-
-void wgaim_set_imalpha(int val) {
-	imalpha = val;
-}
-
-int wgaim_get_imalpha(int val) {
-	return imalpha;
-}
-
-int wgaim_has_transparency() {
-	return MySetLayeredWindowAttributes ? TRUE : FALSE;
-}
-
-GtkWidget *wgaim_wintrans_slider(GtkWidget *win) {
-	GtkWidget *hbox;
-	GtkWidget *label, *slider;
-
-	hbox = gtk_hbox_new(FALSE, 5);
-
-	label = gtk_label_new(_("Opacity:"));
-	gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
-
-	slider = gtk_hscale_new_with_range(50,255,1);
-	gtk_range_set_value(GTK_RANGE(slider), imalpha);
-	gtk_widget_set_usize(GTK_WIDGET(slider), 200, -1);
-	
-	/* On slider val change, update window's transparency level */
-	gtk_signal_connect(GTK_OBJECT(slider), "value-changed", GTK_SIGNAL_FUNC(change_im_alpha), win);
-	gtk_box_pack_start(GTK_BOX(hbox), slider, FALSE, TRUE, 5);
-
-	/* Set the initial transparency level */
-	wgaim_set_wintrans(win, imalpha);
-
-	gtk_widget_show_all(hbox);
-
-	return hbox;
-}
-
 /* Windows Initializations */
 
 void wgaim_init(void) {
--- a/src/win32/win32dep.h	Tue Dec 03 22:26:54 2002 +0000
+++ b/src/win32/win32dep.h	Wed Dec 04 00:07:11 2002 +0000
@@ -10,7 +10,6 @@
 #include "winerror.h"
 #include "libc_interface.h"
 #include "systray.h"
-#include "winprefs.h"
 
 /*
  *  PROTOS
@@ -22,11 +21,6 @@
 /* Misc */
 HINSTANCE wgaim_hinstance(void);
 extern void wgaim_im_blink(GtkWidget*);
-extern GtkWidget *wgaim_wintrans_slider(GtkWidget*);
-extern void wgaim_set_wintrans(GtkWidget*, int);
-extern void wgaim_set_imalpha(int);
-extern int wgaim_get_imalpha();
-extern int wgaim_has_transparency();
 
 /* Determine Gaim paths */
 extern char* wgaim_install_dir(void);
--- a/src/win32/winprefs.c	Tue Dec 03 22:26:54 2002 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- *  winprefs.c
- *  
- *  Author: Herman Bloggs <hermanator12002@yahoo.com>
- *  Date: November, 2002
- *  Description: Windows only preferences page
- */
-#include <gtk/gtk.h>
-#include "gaim.h"
-#include "win32dep.h"
-
-/*
- *  PROTOS
- */
-extern GtkWidget *gaim_button(const char*, guint*, int, GtkWidget*);
-
-static void im_alpha_change(GtkWidget *w, gpointer data) {
-	int val = gtk_range_get_value(GTK_RANGE(w));
-	wgaim_set_imalpha(val);
-}
-
-GtkWidget *wgaim_winprefs_page() {
-	GtkWidget *ret;
-	GtkWidget *vbox;
-	GtkWidget *hbox;
-	GtkWidget *label, *slider;
-	GtkWidget *button;
-	GtkWidget *trans_box;
-
-	ret = gtk_vbox_new(FALSE, 18);
-	gtk_container_set_border_width (GTK_CONTAINER (ret), 12);
-
-	/* transparency options */
-	vbox = make_frame (ret, _("Transparency"));
-	button = gaim_button(_("_IM window transparency"), &wgaim_options, OPT_WGAIM_IMTRANS, vbox);
-	trans_box =  gtk_vbox_new(FALSE, 18);
-	if (!(wgaim_options & OPT_WGAIM_IMTRANS))
-		gtk_widget_set_sensitive(GTK_WIDGET(trans_box), FALSE);
-	gtk_widget_show(trans_box);
-	gaim_button(_("_Show slider bar in IM window"), &wgaim_options, OPT_WGAIM_SHOW_IMTRANS, trans_box);
-	gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive),  trans_box);
-	gtk_box_pack_start(GTK_BOX(vbox), trans_box, FALSE, FALSE, 5);
-
-	/* transparency slider */
-	hbox = gtk_hbox_new(FALSE, 5);
-
-	label = gtk_label_new(_("Default Opacity:"));
-	gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
-
-	slider = gtk_hscale_new_with_range(50,255,1);
-	gtk_range_set_value(GTK_RANGE(slider), wgaim_get_imalpha());
-	gtk_widget_set_usize(GTK_WIDGET(slider), 200, -1);
-	
-	gtk_signal_connect(GTK_OBJECT(slider), "value-changed", GTK_SIGNAL_FUNC(im_alpha_change), NULL);
-	gtk_box_pack_start(GTK_BOX(hbox), slider, FALSE, TRUE, 5);
-
-	gtk_widget_show_all(hbox);
-
-	gtk_box_pack_start(GTK_BOX(trans_box), hbox, FALSE, FALSE, 5);
-	
-	/* If this version of Windows dosn't support Transparency, grey out options */
-	if(!wgaim_has_transparency()) {
-		gtk_widget_set_sensitive(GTK_WIDGET(vbox), FALSE);
-	}
-
-	gtk_widget_show_all(ret);
-	return ret;
-}
--- a/src/win32/winprefs.h	Tue Dec 03 22:26:54 2002 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-/*
- *  winprefs.h
- *  
- *  Author: Herman Bloggs <hermanator12002@yahoo.com>
- *  Date: November, 2002
- *  Description: Windows only preferences page
- */
-#ifndef _WINPREFS_H
-#define _WINPREFS_H
-
-extern guint wgaim_options;
-#define OPT_WGAIM_IMTRANS               0x00000001
-#define OPT_WGAIM_SHOW_IMTRANS          0x00000002
-
-#if 0
-#define OPT_WGAIM_                      0x00000004
-#define OPT_WGAIM_                      0x00000008
-#endif
-
-extern GtkWidget *wgaim_winprefs_page();
-
-
-#endif /*_WINPREFS_H*/