From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Seiji Zenitani Newsgroups: gmane.emacs.devel Subject: Re: Adding parameters to windows Date: Fri, 16 May 2008 19:37:50 -0400 Message-ID: <5E334A4B-4D42-49E9-A05D-FFD689BD59B7@mac.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary_(ID_kohKSWo+WUGYTSpTxR4egg)" X-Trace: ger.gmane.org 1210981095 12168 80.91.229.12 (16 May 2008 23:38:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 May 2008 23:38:15 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 17 01:38:50 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Jx9Vh-0005zo-1e for ged-emacs-devel@m.gmane.org; Sat, 17 May 2008 01:38:49 +0200 Original-Received: from localhost ([127.0.0.1]:44634 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jx9Ux-0007ya-6v for ged-emacs-devel@m.gmane.org; Fri, 16 May 2008 19:38:03 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jx9Us-0007xg-QZ for emacs-devel@gnu.org; Fri, 16 May 2008 19:37:58 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jx9Uq-0007x9-EN for emacs-devel@gnu.org; Fri, 16 May 2008 19:37:57 -0400 Original-Received: from [199.232.76.173] (port=56638 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jx9Uq-0007x2-6e for emacs-devel@gnu.org; Fri, 16 May 2008 19:37:56 -0400 Original-Received: from smtpoutm.mac.com ([17.148.16.81]:58178) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jx9Up-0005Gh-MP for emacs-devel@gnu.org; Fri, 16 May 2008 19:37:56 -0400 Original-Received: from smtpin126.mac.com (smtpin126-bge351000 [10.150.68.126]) by smtpoutm.mac.com (Xserve/smtpout018/MantshX 4.0) with ESMTP id m4GNbrvR007582 for ; Fri, 16 May 2008 16:37:53 -0700 (PDT) Original-Received: from [10.0.1.200] (c-98-204-47-69.hsd1.md.comcast.net [98.204.47.69]) by smtpin126.mac.com (Sun Java(tm) System Messaging Server 6.3-6.03 (built Mar 14 2008; 32bit)) with ESMTPA id <0K0Z003BFIZ3OX80@smtpin126.mac.com> for emacs-devel@gnu.org; Fri, 16 May 2008 16:37:53 -0700 (PDT) X-Mailer: Apple Mail (2.919.2) X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:97303 Archived-At: --Boundary_(ID_kohKSWo+WUGYTSpTxR4egg) Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-transfer-encoding: 7BIT Hi, > Now that your copyright papers are on file, could you send us > a patch together with a corresponding ChangeLog entry? > > Stefan Here's a patch & ChangeLog lines for a new frame parameter. Seiji 2008-05-14 Seiji Zenitani , Ryo Yoshitake * frame.c (Qalpha): add a new frame parameter `alpha'. (Vframe_alpha_lower_limit) : new variable. (x_set_alpha): Add function. * frame.h (Qalpha, Vframe_parameter_lower_limit): export them. * xfns.c (x-create-frame, Qalpha): Initialize the frame parameter `alpha'. * xterm.c (x_set_frame_alpha): Add function. * macfns.c (mac_frame_parm_handlers): A null handler for x_set_alpha. * w32fns.c (w32_frame_parm_handlers): Likewise. --Boundary_(ID_kohKSWo+WUGYTSpTxR4egg) Content-type: application/octet-stream; x-unix-mode=0644; name=transparency4-x23.patch Content-transfer-encoding: quoted-printable Content-disposition: attachment; filename=transparency4-x23.patch diff=20-Naur=20../emacs.orig/src/frame.c=20../emacs/src/frame.c=0A---=20= ../emacs.orig/src/frame.c=092008-05-14=2003:49:31.000000000=20-0400=0A= +++=20../emacs/src/frame.c=092008-05-14=2023:14:44.000000000=20-0400=0A= @@=20-62,6=20+62,10=20@@=0A=20=0A=20Lisp_Object=20Vx_resource_class;=0A=20= =0A+/*=20Lower=20limit=20value=20of=20the=20frame=20opacity=20(alpha=20= transparency).=20=20*/=0A+=0A+Lisp_Object=20Vframe_alpha_lower_limit;=0A= +=0A=20#endif=0A=20=0A=20Lisp_Object=20Qframep,=20Qframe_live_p;=0A@@=20= -113,6=20+117,7=20@@=0A=20=0A=20Lisp_Object=20Qfullscreen,=20Qfullwidth,=20= Qfullheight,=20Qfullboth;=0A=20Lisp_Object=20Qfont_backend;=0A= +Lisp_Object=20Qalpha;=0A=20=0A=20Lisp_Object=20= Qinhibit_face_set_after_frame_default;=0A=20Lisp_Object=20= Qface_set_after_frame_default;=0A@@=20-2824,7=20+2829,8=20@@=0A=20=20=20= {"right-fringe",=09=09&Qright_fringe},=0A=20=20=20{"wait-for-wm",=09=09= &Qwait_for_wm},=0A=20=20=20{"fullscreen",=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20&Qfullscreen},=0A-=20=20{"font-backend",=09=09= &Qfont_backend}=0A+=20=20{"font-backend",=09=09&Qfont_backend},=0A+=20=20= {"alpha",=09=09=09&Qalpha}=0A=20};=0A=20=0A=20#ifdef=20= HAVE_WINDOW_SYSTEM=0A@@=20-3634,6=20+3640,61=20@@=0A=20=20=20=20=20= return=20Qnil;=0A=20}=0A=20=0A+void=0A+x_set_alpha=20(f,=20arg,=20= oldval)=0A+=20=20=20=20=20struct=20frame=20*f;=0A+=20=20=20=20=20= Lisp_Object=20arg,=20oldval;=0A+{=0A+=20=20double=20alpha=20=3D=201.0;=0A= +=20=20double=20newval[2];=0A+=20=20int=20i,=20ialpha;=0A+=20=20= Lisp_Object=20item;=0A+=0A+=20=20for=20(i=3D0;i<2;i++)=0A+=20=20=20=20{=0A= +=20=20=20=20=20=20newval[i]=20=3D=201.0;=0A+=20=20=20=20=20=20if=20= (CONSP=20(arg))=0A+=20=20=20=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=20=20= =20item=20=3D=20CAR=20(arg);=0A+=20=20=20=20=20=20=20=20=20=20arg=20=20=3D= =20CDR=20(arg);=0A+=20=20=20=20=20=20=20=20}=0A+=20=20=20=20=20=20else=0A= +=20=20=20=20=20=20=20=20item=3Darg;=0A+=0A+=20=20=20=20=20=20if=20= (!NILP=20(item))=0A+=20=20=20=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=20= =20=20if=20(FLOATP=20(item))=0A+=20=20=20=20=20=20=20=20=20=20=20=20{=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20alpha=20=3D=20XFLOAT_DATA=20= (item);=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20if=20(alpha=20<=20= 0.0=20||=201.0=20<=20alpha)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20args_out_of_range=20(make_float=20(0.0),=20make_float=20(1.0));=0A= +=20=20=20=20=20=20=20=20=20=20=20=20}=0A+=20=20=20=20=20=20=20=20=20=20= else=20if=20(INTEGERP=20(item))=0A+=20=20=20=20=20=20=20=20=20=20=20=20{=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20ialpha=20=3D=20XINT=20(item);=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20if=20(ialpha=20<=200=20||=20= 100=20<=20ialpha)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= args_out_of_range=20(make_number=20(0),=20make_number=20(100));=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20else=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20alpha=20=3D=20ialpha=20/=20100.0;=0A+=20=20=20=20=20=20= =20=20=20=20=20=20}=0A+=20=20=20=20=20=20=20=20=20=20else=0A+=20=20=20=20= =20=20=20=20=20=20=20=20wrong_type_argument=20(Qnumberp,=20item);=0A+=20=20= =20=20=20=20=20=20}=0A+=20=20=20=20=20=20newval[i]=20=3D=20alpha;=0A+=20=20= =20=20}=0A+=0A+=20=20for=20(i=3D0;i<2;i++)=0A+=20=20=20=20f->alpha[i]=20= =3D=20newval[i];=0A+=0A+#ifdef=20HAVE_X_WINDOWS=0A+=20=20BLOCK_INPUT;=0A= +=20=20x_set_frame_alpha=20(f);=0A+=20=20UNBLOCK_INPUT;=0A+#endif=0A+=0A= +=20=20return;=0A+}=0A+=0A=20=0C=0A=20/*=20Subroutines=20of=20creating=20= an=20X=20frame.=20=20*/=0A=20=0A@@=20-4403,6=20+4464,13=20@@=0A=20but=20= binding=20this=20variable=20locally=20around=20a=20call=20to=20= `x-get-resource'=0A=20is=20a=20reasonable=20practice.=20=20See=20also=20= the=20variable=20`x-resource-name'.=20=20*/);=0A=20=20=20= Vx_resource_class=20=3D=20build_string=20(EMACS_CLASS);=0A+=0A+=20=20= DEFVAR_LISP=20("frame-alpha-lower-limit",=20&Vframe_alpha_lower_limit,=0A= +=20=20=20=20doc:=20/*=20The=20lower=20limit=20of=20the=20frame=20= opacity=20(alpha=20transparency).=0A+The=20value=20should=20range=20from=20= 0=20(invisible)=20to=20100=20(completely=20opaque).=0A+The=20user=20can=20= also=20use=20a=20floating=20number=20between=200.0=20and=201.0.=0A+The=20= default=20is=2020.=20=20*/);=0A+=20=20Vframe_alpha_lower_limit=20=3D=20= make_number=20(20);=0A=20#endif=0A=20=0A=20=20=20DEFVAR_LISP=20= ("default-frame-alist",=20&Vdefault_frame_alist,=0Adiff=20-Naur=20= ../emacs.orig/src/frame.h=20../emacs/src/frame.h=0A---=20= ../emacs.orig/src/frame.h=092008-05-13=2021:27:45.000000000=20-0400=0A= +++=20../emacs/src/frame.h=092008-05-14=2023:19:16.000000000=20-0400=0A= @@=20-215,6=20+215,11=20@@=0A=20=20=20=20=20=20be=20used=20for=20output.=20= =20*/=0A=20=20=20unsigned=20glyphs_initialized_p=20:=201;=0A=20=0A+=20=20= /*=20frame=20opacity=0A+=20=20=20=20=20alpha[0]:=20alpha=20transparency=20= of=20the=20active=20frame=0A+=20=20=20=20=20alpha[1]:=20alpha=20= transparency=20of=20inactive=20frames=20=20=20*/=0A+=20=20double=20= alpha[2];=0A+=0A=20=20=20/*=20Set=20to=20non-zero=20in=20= change_frame_size=20when=20size=20of=20frame=20changed=0A=20=20=20=20=20=20= Clear=20the=20frame=20in=20clear_garbaged_frames=20if=20set.=20=20*/=0A=20= =20=20unsigned=20resized_p=20:=201;=0A@@=20-1035,6=20+1040,7=20@@=0A=20= extern=20Lisp_Object=20Qwait_for_wm;=0A=20extern=20Lisp_Object=20= Qfullscreen;=0A=20extern=20Lisp_Object=20Qfont_backend;=0A+extern=20= Lisp_Object=20Qalpha;=0A=20=0A=20extern=20Lisp_Object=20Qleft_fringe,=20= Qright_fringe;=0A=20extern=20Lisp_Object=20Qheight,=20Qwidth;=0A@@=20= -1099,6=20+1105,8=20@@=0A=20=0A=20extern=20int=20x_figure_window_size=20= P_=20((struct=20frame=20*,=20Lisp_Object,=20int));=0A=20=0A+extern=20= Lisp_Object=20Vframe_alpha_lower_limit;=0A+extern=20void=20x_set_alpha=20= P_=20((struct=20frame=20*,=20Lisp_Object,=20Lisp_Object));=0A=20=0A=20= extern=20void=20validate_x_resource_name=20P_=20((void));=0A=20=0Adiff=20= -Naur=20../emacs.orig/src/macfns.c=20../emacs/src/macfns.c=0A---=20= ../emacs.orig/src/macfns.c=092008-05-14=2003:49:40.000000000=20-0400=0A= +++=20../emacs/src/macfns.c=092008-05-14=2023:12:20.000000000=20-0400=0A= @@=20-4321,6=20+4321,8=20@@=0A=20=20=20x_set_fringe_width,=0A=20=20=200,=20= /*=20x_set_wait_for_wm,=20*/=0A=20=20=20x_set_fullscreen,=0A+=20=200,=20= /*=20x_set_font_backend,=20*/=0A+=20=200=20/*=20x_set_alpha,=20*/=0A=20= };=0A=20=0A=20void=0Adiff=20-Naur=20../emacs.orig/src/w32fns.c=20= ../emacs/src/w32fns.c=0A---=20../emacs.orig/src/w32fns.c=092008-05-14=20= 03:50:03.000000000=20-0400=0A+++=20../emacs/src/w32fns.c=092008-05-14=20= 23:14:22.000000000=20-0400=0A@@=20-8922,7=20+8922,8=20@@=0A=20=20=20= x_set_fringe_width,=0A=20=20=200,=20/*=20x_set_wait_for_wm,=20*/=0A=20=20= =20x_set_fullscreen,=0A-=20=20x_set_font_backend=0A+=20=20= x_set_font_backend,=0A+=20=200=20/*=20x_set_alpha,=20*/=0A=20};=0A=20=0A=20= void=0Adiff=20-Naur=20../emacs.orig/src/xfns.c=20../emacs/src/xfns.c=0A= ---=20../emacs.orig/src/xfns.c=092008-05-14=2003:50:22.000000000=20-0400=0A= +++=20../emacs/src/xfns.c=092008-05-14=2023:15:26.000000000=20-0400=0A@@=20= -3405,6=20+3405,8=20@@=0A=20=20=20x_default_parameter=20(f,=20parms,=20= Qscroll_bar_width,=20Qnil,=0A=20=09=09=20=20=20=20=20=20=20= "scrollBarWidth",=20"ScrollBarWidth",=0A=20=09=09=20=20=20=20=20=20=20= RES_TYPE_NUMBER);=0A+=20=20x_default_parameter=20(f,=20parms,=20Qalpha,=20= Qnil,=0A+=09=09=20=20=20=20=20=20=20"alpha",=20"Alpha",=20= RES_TYPE_NUMBER);=0A=20=0A=20=20=20/*=20Dimensions,=20especially=20= FRAME_LINES=20(f),=20must=20be=20done=20via=20change_frame_size.=0A=20=20= =20=20=20=20Change=20will=20not=20be=20effected=20unless=20different=20= from=20the=20current=0A@@=20-5771,7=20+5773,8=20@@=0A=20=20=20= x_set_fringe_width,=0A=20=20=20x_set_wait_for_wm,=0A=20=20=20= x_set_fullscreen,=0A-=20=20x_set_font_backend=0A+=20=20= x_set_font_backend,=0A+=20=20x_set_alpha=0A=20};=0A=20=0A=20void=0Adiff=20= -Naur=20../emacs.orig/src/xterm.c=20../emacs/src/xterm.c=0A---=20= ../emacs.orig/src/xterm.c=092008-05-14=2003:50:26.000000000=20-0400=0A= +++=20../emacs/src/xterm.c=092008-05-14=2023:12:20.000000000=20-0400=0A= @@=20-457,6=20+457,67=20@@=0A=20=20=20return=200;=0A=20}=0A=20=0A= +#define=20OPAQUE=20=200xffffffff=0A+#define=20OPACITY=20= "_NET_WM_WINDOW_OPACITY"=0A+=0A+void=0A+x_set_frame_alpha=20(f)=0A+=20=20= =20=20=20struct=20frame=20*f;=0A+{=0A+=20=20struct=20x_display_info=20= *dpyinfo=20=3D=20FRAME_X_DISPLAY_INFO=20(f);=0A+=20=20Display=20*dpy=20=3D= =20FRAME_X_DISPLAY=20(f);=0A+=20=20Window=20win=20=3D=20= FRAME_OUTER_WINDOW=20(f);=0A+=20=20if=20(FRAME_X_DISPLAY_INFO=20= (f)->root_window=20!=3D=20FRAME_X_OUTPUT=20(f)->parent_desc)=0A+=20=20=20= =20/*=20Since=20the=20WM=20decoration=20lies=20under=20the=20= FRAME_OUTER_WINDOW,=0A+=20=20=20=20=20=20=20we=20must=20treat=20the=20= former=20instead=20of=20the=20latter.=20*/=0A+=20=20=20=20win=20=3D=20= FRAME_X_OUTPUT(f)->parent_desc;=0A+=0A+=20=20double=20alpha=20=3D=201.0,=20= alpha_min=20=3D=201.0;=0A+=0A+=20=20if=20(dpyinfo->x_highlight_frame=20= =3D=3D=20f)=0A+=20=20=20=20alpha=20=3D=20f->alpha[0];=0A+=20=20else=0A+=20= =20=20=20alpha=20=3D=20f->alpha[1];=0A+=0A+=20=20if=20(FLOATP=20= (Vframe_alpha_lower_limit))=0A+=20=20=20=20alpha_min=20=3D=20XFLOAT_DATA=20= (Vframe_alpha_lower_limit);=0A+=20=20else=20if=20(INTEGERP=20= (Vframe_alpha_lower_limit))=0A+=20=20=20=20alpha_min=20=3D=20(XINT=20= (Vframe_alpha_lower_limit))=20/=20100.0;=0A+=0A+=20=20if=20(alpha=20<=20= 0.0=20||=201.0=20<=20alpha)=0A+=20=20=20=20alpha=20=3D=201.0;=0A+=20=20= else=20if=20(0.0=20<=3D=20alpha=20&&=20alpha=20<=20alpha_min=20&&=20= alpha_min=20<=3D=201.0)=0A+=20=20=20=20alpha=20=3D=20alpha_min;=0A+=0A+=20= =20unsigned=20int=20opac=20=3D=20(unsigned=20int)(alpha=20*=20OPAQUE);=0A= +=0A+=20=20/*=20return=20unless=20necessary=20*/=0A+=20=20{=0A+=20=20=20=20= unsigned=20char=20*data;=0A+=20=20=20=20Atom=20actual;=0A+=20=20=20=20= int=20format;=0A+=20=20=20=20unsigned=20long=20n,=20left;=0A+=0A+=20=20=20= =20XGetWindowProperty(dpy,=20win,=20XInternAtom(dpy,=20OPACITY,=20= False),=0A+=09=09=20=20=20=20=20=20=200L,=201L,=20False,=20XA_CARDINAL,=20= &actual,=20&format,=20&n,=20&left,=0A+=09=09=20=20=20=20=20=20=20= (unsigned=20char=20**)=20&data);=0A+=20=20=20=20if=20(data=20!=3D=20= None)=0A+=20=20=20=20=20=20if=20(*(unsigned=20int=20*)data=20=3D=3D=20= opac)=0A+=09{=0A+=09=20=20XFree=20((void=20*)=20data);=0A+=09=20=20= return;=0A+=09}=0A+=20=20=20=20=20=20else=0A+=20=20=20=20=20=20=20{=0A+=09= =20=20XFree=20((void=20*)=20data);=0A+=20=20=20=20=20=20=20}=0A+=20=20}=0A= +=0A+=20=20XChangeProperty=20(dpy,=20win,=20XInternAtom=20(dpy,=20= OPACITY,=20False),=0A+=09=09=20=20=20XA_CARDINAL,=2032,=20= PropModeReplace,=0A+=09=09=20=20=20(unsigned=20char=20*)=20&opac,=201L);=0A= +=20=20XSync=20(dpy,=20False);=0A+}=0A=20=0A=20=0C=0A=20= /***********************************************************************=0A= @@=20-3171,6=20+3232,7=20@@=0A=20=09=09=20=20=20=20= f->output_data.x->border_pixel);=0A=20=20=20UNBLOCK_INPUT;=0A=20=20=20= x_update_cursor=20(f,=201);=0A+=20=20x_set_frame_alpha=20(f);=0A=20}=0A=20= =0A=20static=20void=0A@@=20-3186,6=20+3248,7=20@@=0A=20=09=09=09=20=20= f->output_data.x->border_tile);=0A=20=20=20UNBLOCK_INPUT;=0A=20=20=20= x_update_cursor=20(f,=201);=0A+=20=20x_set_frame_alpha=20(f);=0A=20}=0A=20= =0A=20/*=20The=20focus=20has=20changed.=20=20Update=20the=20frames=20as=20= necessary=20to=20reflect=0A= --Boundary_(ID_kohKSWo+WUGYTSpTxR4egg) Content-type: text/plain; charset=US-ASCII; format=flowed Content-transfer-encoding: 7BIT --Boundary_(ID_kohKSWo+WUGYTSpTxR4egg)--