[Goodies-commits] r1977 - in notification-daemon-xfce/trunk: . po src themes themes/bubble themes/standard

Nick Schermer nick at xfce.org
Wed Sep 6 13:35:40 CEST 2006


Author: nick
Date: 2006-09-06 11:35:36 +0000 (Wed, 06 Sep 2006)
New Revision: 1977

Added:
   notification-daemon-xfce/trunk/AUTHORS
   notification-daemon-xfce/trunk/COPYING
   notification-daemon-xfce/trunk/ChangeLog
   notification-daemon-xfce/trunk/INSTALL
   notification-daemon-xfce/trunk/Makefile.am
   notification-daemon-xfce/trunk/NEWS
   notification-daemon-xfce/trunk/README
   notification-daemon-xfce/trunk/autogen.sh
   notification-daemon-xfce/trunk/configure.in.in
   notification-daemon-xfce/trunk/org.freedesktop.Notifications.service.in
   notification-daemon-xfce/trunk/po/
   notification-daemon-xfce/trunk/po/ChangeLog
   notification-daemon-xfce/trunk/po/LINGUAS
   notification-daemon-xfce/trunk/po/POTFILES.in
   notification-daemon-xfce/trunk/src/
   notification-daemon-xfce/trunk/src/Makefile.am
   notification-daemon-xfce/trunk/src/daemon.c
   notification-daemon-xfce/trunk/src/daemon.h
   notification-daemon-xfce/trunk/src/engines.c
   notification-daemon-xfce/trunk/src/engines.h
   notification-daemon-xfce/trunk/src/notificationdaemon.xml
   notification-daemon-xfce/trunk/themes/
   notification-daemon-xfce/trunk/themes/Makefile.am
   notification-daemon-xfce/trunk/themes/bubble/
   notification-daemon-xfce/trunk/themes/bubble/Makefile.am
   notification-daemon-xfce/trunk/themes/bubble/eggnotificationbubblewidget.c
   notification-daemon-xfce/trunk/themes/bubble/eggnotificationbubblewidget.h
   notification-daemon-xfce/trunk/themes/bubble/theme.c
   notification-daemon-xfce/trunk/themes/standard/
   notification-daemon-xfce/trunk/themes/standard/Makefile.am
   notification-daemon-xfce/trunk/themes/standard/theme.c
Log:
* Initial import of the notifications daemon


Added: notification-daemon-xfce/trunk/AUTHORS
===================================================================
--- notification-daemon-xfce/trunk/AUTHORS	                        (rev 0)
+++ notification-daemon-xfce/trunk/AUTHORS	2006-09-06 11:35:36 UTC (rev 1977)
@@ -0,0 +1,9 @@
+Authors:
+	Christian Hammond <chipx86 at chipx86.com>
+	John (J5) Palmieri  <johnp at redhat.com>
+
+Xfce port:
+	Nick Schermer <nick at xfce.org>
+
+Contributors:
+	Rodney Dawes <dobey at novell.com>

Added: notification-daemon-xfce/trunk/COPYING
===================================================================
--- notification-daemon-xfce/trunk/COPYING	                        (rev 0)
+++ notification-daemon-xfce/trunk/COPYING	2006-09-06 11:35:36 UTC (rev 1977)
@@ -0,0 +1,340 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    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-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year  name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.

Added: notification-daemon-xfce/trunk/ChangeLog
===================================================================
--- notification-daemon-xfce/trunk/ChangeLog	                        (rev 0)
+++ notification-daemon-xfce/trunk/ChangeLog	2006-09-06 11:35:36 UTC (rev 1977)
@@ -0,0 +1,692 @@
+==================== 0.3.5 ====================
+
+Wed Apr 26 01:44:17 PDT 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* data/Makefile.am:
+	A data/org.freedesktop.Notifications.service.in:
+	D data/notification-daemon.service.in:
+	* configure.ac:
+	  - Rename notification-daemon.service to
+	    org.freedesktop.Notifications.service.
+
+Wed Apr 26 01:32:17 PDT 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* NEWS:
+	* configure.ac:
+	  - Bump the version to 0.3.5.
+
+Sun Apr 23 16:30:28 PDT 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	* src/engines.c:
+	* src/engines.h:
+	* themes/standard/theme.c:
+	* NEWS:
+	  - Fixed a bug where a notification would duplicate its actions when
+	    updated. This closes bug #30.
+
+Sun Apr 23 15:48:14 PDT 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* themes/standard/theme.c:
+	  - Use cairo to render the countdown timer if using gtk 2.8.0+. This
+	    makes the countdown timer all antialiased and pretty.
+
+Fri Apr 21 17:17:40 PDT 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	  - Fix the scaling of different icon sizes. I was using a MAX when
+	    I should have used a MIN. Now small icons display as small, and
+	    larger icons are scaled down to 48x48.
+
+Fri Apr 21 16:42:46 PDT 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	  - Patch by M.S. to fix the problem where icons were being clipped in
+	    notifications if the text didn't wrap enough lines. This fixes
+	    bug #21.
+
+Fri Apr 21 16:33:56 PDT 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	  - Fix notifications no longer expiring due to the fix for bug #22.
+	    The logic is now a bit smarter and more hacky. But it works. And
+	    really, if it didn't, would I be committing this? Yes, probably.
+
+Fri Apr 21 15:54:01 PDT 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	* NEWS:
+	  - Fix notifications with a timeout >= 2147484ms expiring in less
+	    than a second. This fixes bug #22.
+
+Fri Apr 21 15:21:45 PDT 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/engines.c:
+	* themes/Makefile.am:
+	* themes/standard/theme.c:
+	* NEWS:
+	* configure.ac:
+	  - Add two new required theme functions, theme_check_init (which
+	    determines if the theme is compatible with the version of
+	    notification-daemon) and get_theme_info (which returns info on the
+	    theme).
+	  - Disabled the Bubble theme for this release. It's the source of too
+	    many bugs.
+
+Tue Apr 11 22:54:13 PDT 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* themes/bubble/eggnotificationbubblewidget.c:
+	  - Patch by Rodney Dawes to fix closing of notifications using the
+	    bubble theme when clicked. This closes bug #39.
+
+Tue Apr 11 22:50:22 PDT 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	  - Patch by Rodney Dawes to fix usage of GtkIconTheme. This closes
+	    bug #38.
+
+==================== 0.3.4 ====================
+
+Sat Feb 04 20:18:54 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* configure.ac:
+	* NEWS:
+	  - Add info to the NEWS.
+	  - Bump the version to 0.3.4.
+
+Sat Feb 04 20:01:09 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* configure.ac:
+	  - Fix make distcheck.
+
+Sat Feb 04 19:48:49 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	D themes/standard/bgbox.c:
+	D themes/standard/bgbox.h:
+	* themes/standard/Makefile.am:
+	* themes/standard/theme.c:
+	  - Get rid of bgbox.[ch]. We don't use it anymore.
+
+Sat Feb 04 16:39:00 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	* themes/bubble/eggnotificationbubblewidget.c:
+	  - Attempt to fix button ordering in the Bubble widget. The structure
+	    of the widget is a bit jumbled, so there may be side-effects with
+	    the alignment.
+
+Sat Feb 04 16:23:30 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* themes/bubble/theme.c:
+	  - Fixed a crash when clicking an action in the bubble theme.
+
+Sat Feb 04 15:56:28 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	* themes/bubble/theme.c:
+	  - Ensure that the notification window is always realized before we
+	    start operating on its GdkWindow. This fixes bug #10.
+
+Sat Feb 04 13:15:29 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* themes/standard/theme.c:
+	  - Ensure that the labels in the action buttons are aligned correctly.
+
+Sat Feb 04 13:11:25 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/engines.c:
+	* themes/standard/theme.c:
+	  - Make more theme functions optional. Fall back to defaults in cases
+	    like destroying, showing, or hiding notifications.
+
+Sat Feb 04 13:08:02 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	* src/engines.c:
+	* src/engines.h:
+	* themes/standard/theme.c:
+	  - Make the timer ticks passed to the theme engine more precise.
+
+Sat Feb 04 12:44:32 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* themes/standard/theme.c:
+	  - Change the stripe width to 30. Images align a lot nicer now.
+
+Sat Feb 04 12:38:22 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* themes/standard/theme.c:
+	  - Use the theme colors to draw the low and normal urgency stripes.
+	    Low is the style's nomral BG state. Normal is the selected state.
+	    Critical is custom. We hard-code it red. Eventually, I'd like all
+	    this to change when the themeable gtk colors are supported.
+
+Sat Feb 04 12:28:24 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* themes/standard/theme.c:
+	  - Improve the alignment and the color of the countdown.
+
+Sat Feb 04 12:24:32 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	* src/engines.c:
+	* src/engines.h:
+	* themes/standard/theme.c:
+	  - Add a pie-based countdown timer to notifications containing actions,
+	    so that the user knows how long they have until the notification
+	    simply expires.
+
+Sat Feb 04 02:04:35 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* themes/standard/theme.c:
+	  - Color the stripe based on the urgency level.
+
+Sat Feb 04 01:48:50 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	  - Check notification expiration every 100ms instead of every 500ms.
+
+Sat Feb 04 01:26:41 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* themes/standard/theme.c:
+	  - Use the action key to look up an icon theme stock icon. If one
+	    exists, display it next to the name.
+
+Sat Feb 04 01:07:02 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* themes/standard/theme.c:
+	  - Change the actions to use right-aligned small text buttons. This
+	    makes it a bit more clear as to what these really are.
+
+Sat Feb 04 00:54:34 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* themes/standard/theme.c:
+	  - Hide the content box containing the body, actions and icon when
+	    all of those are invisible (unset). This allows the whole
+	    notification to be very short when there's just a summary, instead
+	    of having useless, ugly extra vertical whitespace.
+
+Sat Feb 04 00:37:55 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* themes/standard/bgbox.c:
+	* themes/standard/bgbox.h:
+	* themes/standard/theme.c:
+	  - Make some changes to the Standard theme in order to bring it a
+	    bit closer to the style used in the December GNOME mockups. The
+	    mockups had some nice stylistic and usability ideas that were
+	    worth looking into.
+
+Wed Feb 01 19:17:09 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* themes/bubble/Makefile.am:
+	* themes/standard/Makefile.am:
+	  - Patch by Rodney Dawes to install the theme engines as unversioned
+	    libraries instead of versioned libraries.
+
+Sun Jan 29 13:03:09 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	* src/engines.c:
+	* themes/standard/theme.c:
+	  - Patch by Michael Vogt and modified a bit by me to add a close
+	    button to notifications. This is similar to the one used in Ubuntu
+	    Dapper, with a small placement change and functionality change: the
+	    notification no longer emits the ActionInvoked for the default action
+	    when closed. This closes ticket #8.
+	  - Moved data freeing for the standard theme and for theme engine
+	    unreffing out of the close functions and into a callback specified
+	    through g_object_set_data_full().
+	  - The daemon now listens for when notification windows are destroyed,
+	    and reacts appropriately, instead of crashing.
+
+Sun Jan 29 12:12:43 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* configure.ac:
+	  - Fix a couple missing commas in the list of package modules. Also
+	    take the time to clean this up a bit and put each module on its own
+	    line, and put the required versions into their own variables.
+	  - Bump the version to 0.3.3.90.
+
+==================== 0.3.3 ====================
+
+Wed Jan 25 00:29:59 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* ChangeLog:
+	* NEWS:
+	* configure.ac:
+	  - Bump the version to 0.3.3. Prepare for release.
+
+Wed Jan 25 00:21:49 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	  - When using icontheme icons, use the size closest to 48x48. However,
+	    if the closest image is smaller, use the small image instead of
+	    scaling up. If it's bigger, scale down to 48x48.
+
+Wed Jan 25 00:01:56 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	* configure.ac:
+	  - Don't pop up a notification if a window is full screen or if the
+	    screensaver is active. This closes bug #4.
+
+Tue Jan 24 00:18:18 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/Makefile.am:
+	* themes/bubble/Makefile.am:
+	* themes/standard/Makefile.am:
+	* NEWS:
+	* configure.ac:
+	  - Install and check for engines in
+	    $(libdir)/notification-daemon-1.0/engines, as opposed to
+	    $(libdir)/notification-daemon/engines. This fixes bug #3.
+
+==================== 0.3.2 ====================
+
+Mon Jan 23 00:39:34 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	  - We support v0.9 of the Desktop Notifications spec. Make sure we
+	    return that in GetServerInformation.
+
+Mon Jan 23 00:38:18 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* configure.ac:
+	* NEWS:
+	  - Add release news and bump the version up to 0.3.2.
+
+Mon Jan 23 00:33:31 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/notificationdaemon.xml:
+	  - Get rid of the GetServerInfo function. I thought I added this for
+	    backward-compatibility, but I was wrong -- everyone was really using
+	    the correct function.
+
+Mon Jan 23 00:27:53 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* data/Makefile.am:
+	A po/ChangeLog:
+	* src/Makefile.am:
+	D src/notifydaemon-dbus-glue.h:
+	* Makefile.am:
+	* configure.ac:
+	  - make distcheck is now happy.
+
+Sun Jan 22 23:54:53 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	  - Add back working support for default actions. These were being
+	    displayed as standard actions. Now they're once again emitted when
+	    the notification is clicked.
+
+Sun Jan 22 23:51:17 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* data/Makefile.am:
+	A data/notification-daemon.service.in:
+	D notification-daemon.service.in:
+	* INSTALL:
+	* Makefile.am:
+	* configure.ac:
+	  - Move notification-daemon.service.in to data/.
+
+Sun Jan 22 23:38:31 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	  - Fix several bugs (placement and possible crashers) in notification
+	    replacement.
+
+Sun Jan 22 23:31:36 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* themes/standard/theme.c:
+	  - Hook the actions back up again. Switching to the BgBox widget broke
+	    this.
+
+Sun Jan 22 23:02:37 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* themes/standard/theme.c:
+	  - Remove now dead code.
+
+Sun Jan 22 22:28:39 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* themes/standard/theme.c:
+	  - Draw the border of the notification window correctly under all tested
+	    cases.
+
+Sun Jan 22 20:02:58 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* themes/standard/theme.c:
+	  - The arrow will now point down if there's not enough room for it
+	    to point up (such as if an icon on the bottom panel is the source for
+	    the arrow).
+
+Sun Jan 22 18:59:57 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	* themes/standard/theme.c:
+	  - Be super cool when it comes to arrow placement near the left and right
+	    of the screen. The next couple of changes will add to the super
+	    coolness of all of this.
+
+Sun Jan 22 15:13:08 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* themes/standard/Makefile.am:
+	A themes/standard/bgbox.c:
+	A themes/standard/bgbox.h:
+	* themes/standard/theme.c:
+	  - Added a BgBox widget to the standard theme. This is based off of
+	    libview's BaseBGBox widget. It's being used for the themeing of the
+	    standard theme, instead of hard-coding white.
+
+Sun Jan 22 13:27:29 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	* themes/bubble/eggnotificationbubblewidget.c:
+	* themes/bubble/eggnotificationbubblewidget.h:
+	* themes/standard/theme.c:
+	* autogen.sh:
+	  - Patch by Rodney Dawes to fix a problem with keeping a pointer to
+	    the hints table in the themes. We no longer store the whole table,
+	    but rather only the parts of it we care about. This fixes a crash.
+	  - This patch also updates the required automake version to 1.9, to
+	    be compatible with the new intltool and to use a more recent
+	    gnome-common.
+
+Sun Jan 22 13:23:51 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	* src/daemon.h:
+	* src/notificationdaemon.xml:
+	  - Rearrange some parameters to match the spec.
+
+Fri Jan 20 00:22:38 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	  - Respect the user's work area (the area inside the panels and stuff)
+	    when displaying notifications.
+
+Fri Jan 20 00:15:04 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	  - Small code cleanups.
+
+Fri Jan 20 00:09:12 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	  - Add a little hack to prevent the notification from closing when a
+	    link is clicked.
+
+Fri Jan 20 00:01:04 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	  - Remove the debug messages. We shouldn't need these anymore, as the
+	    base stuff is working.
+
+Thu Jan 19 23:59:42 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	* src/engines.c:
+	* src/engines.h:
+	* themes/standard/theme.c:
+	  - Add proper support for actions.
+	  - Remove the action_invoked parameter to create_notification(), since
+	    we're already passing it to add_notification_action.
+
+Thu Jan 19 23:44:31 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	* src/engines.c:
+	* src/engines.h:
+	* themes/standard/theme.c:
+	  - Pass a couple of callbacks to the theme engine's
+	    create_notification() function: action_invoked and url_clicked.
+	  - Move the URL clicking callback to daemon.c from the standard engine.
+	    The standard engine now calls the passed url_clicked function.
+
+Thu Jan 19 23:33:46 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* themes/standard/theme.c:
+	  - Sexy new separator. Well, it's better than "|" anyway.
+
+Thu Jan 19 23:23:55 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	* themes/standard/theme.c:
+	  - Add the beginnings of action support.
+
+Thu Jan 19 22:34:16 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* data/Makefile.am:
+	  - NO! Install the schema always!
+
+Thu Jan 19 10:18:09 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	  - Simplify a small piece of logic.
+
+Thu Jan 19 02:37:31 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	* src/daemon.h:
+	* src/engines.c:
+	  - Reorganize the code styles to match the style of the rest of Galago
+	    and of the previous libnotify.
+
+Thu Jan 19 01:36:16 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* themes/standard/theme.c:
+	  - Add back support for hyperlinks in the standard engine.
+
+Sun Jan 15 17:51:27 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	* src/daemon.h:
+	* src/notificationdaemon.xml:
+	  - Add back GetCapabilities and GetServerInformation.
+
+Sun Jan 15 16:07:00 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	A data/Makefile.am:
+	A data/notification-daemon.schemas.in:
+	A po/POTFILES.in:
+	* src/daemon.c:
+	* src/daemon.h:
+	* src/engines.c:
+	* src/Makefile.am:
+	* Makefile.am:
+	* autogen.sh:
+	* configure.ac:
+	  - Added GConf support. The theme can now be set through gconf-editor.
+
+Sun Jan 15 14:49:49 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/engines.c:
+	* src/engines.h:
+	  - Save the engine used in the resulting notification window's
+	    object data. Use that engine for all future operations on that
+	    notification.
+	  - Handle ref counting on notification engines so that they'll be
+	    properly when the time comes. As of right now, this won't happen.
+
+Fri Jan 13 11:44:00 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/engines.c:
+	* src/engines.h:
+	* themes/bubble/eggnotificationbubblewidget.c:
+	* themes/bubble/eggnotificationbubblewidget.h:
+	* themes/bubble/theme.c:
+	* themes/standard/theme.c:
+	  - Patch by Rodney Dawes to add support for passing hints to the
+	    notification engines. This will allow engines to theme based on
+	    urgency levels and other such data.
+
+Thu Jan 12 11:06:27 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	  - Listen to the button-release-event signal instead of "clicked" for
+	    notifications.
+
+	* themes/standard/theme.c:
+	  - Another shot at setting the window shape every time. I've read that
+	    there's some gtk 2.8 bug regarding this. Anyhow, in order to
+	    guarantee it, I'm always setting the shape in the expose handler.
+	    Even doing it only once or twice in the expose handler causes issues,
+	    but setting it every time works. We need a better way...
+
+Thu Jan 12 00:57:22 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* themes/standard/theme.c:
+	  - Make sure we shape the window correctly every time we generate the
+	    arrow so that we don't leave artifacts.
+
+Thu Jan 12 00:10:18 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/engines.c:
+	A themes/standard/Makefile.am:
+	A themes/standard/theme.c:
+	* themes/Makefile.am:
+	* configure.ac:
+	  - Add the beginnings of the "standard" theme. This is now the default.
+	    It's not complete. Many things are still missing. Theme selection
+	    will be added later.
+
+Wed Jan 11 01:51:12 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/Makefile.am:
+	* src/daemon.c:
+	D src/eggnotificationbubblewidget.c:
+	D src/eggnotificationbubblewidget.h:
+	A src/engines.c:
+	A src/engines.h:
+	A themes/bubble/Makefile.am:
+	A themes/bubble/eggnotificationbubblewidget.c:
+	A themes/bubble/eggnotificationbubblewidget.h:
+	A themes/bubble/theme.c:
+	A themes/Makefile.am:
+	* Makefile.am:
+	* configure.ac:
+	  - Big change. We're moving to a theme engine model for displaying
+	    notifications. This is something I've wanted for a long time. For now,
+	    the "bubble" theme, as I call it (which we can definitely change) is
+	    the default. We'll make modules configurable by the theme and/or by
+	    the user later. Make sure you do a make install in themes!
+
+Tue Jan 10 23:56:01 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/Makefile.am:
+	A src/daemon.c:
+	A src/daemon.h:
+	A src/notificationdaemon.xml:
+	D src/notifydaemon.c:
+	D src/notifydaemon.h:
+	D src/notifydaemon.xml:
+	* Makefile.am:
+	* autogen.sh:
+	* configure.ac:
+	A notification-daemon.service.in:
+	D notify-daemon.service.in:
+	  - Rename from notify-daemon to notification-daemon. I've received a
+	    number of questions and some complaints about the name change,
+	    some of which are packaging concerns, some upgrade concerns, and
+	    just general confusion and "Why?" As this is the "Desktop
+	    Notifications" project, and due to reasons expressed to me from
+	    others, I feel it's best to revert the name.
+
+Tue Jan 10 23:32:55 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/eggnotificationbubblewidget.c:
+	* src/notifydaemon.c:
+	* configure.ac:
+	  - Although it's a small hack, add support back for D-BUS 0.36+.
+
+Tue Jan 10 22:57:51 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/eggnotificationbubblewidget.c:
+	  - Fix another case of C99 usage.
+
+2006-01-03  John (J5) Palmieri  <johnp at redhat.com>
+
+	* src/eggnotificationbubblewidget.h (struct _DrawingPipeline):
+	Added intermediate pipeline for graphics rendering
+
+	* src/eggnotificationbubblewidget.c 
+	(_stencil_bubble*): These methods now take care of prerendering
+	the graphics to the pipeline and calculating the x, y offset of
+	the arrow
+	(struct DrawingInstruction): intermediate drawing primitive
+	(_drawing_instruction_*): New internal methods for manipulating
+	drawing instructions
+	(_edge_line_to, _close_path): internal convinience methods for
+	drawing skewed lines attached by rounded corners (i.e. you can
+	draw a box and specify the radius of each corner)
+	(egg_notification_bubble_widget_set_pos): prerender the bubble here
+	to get arrow offsets
+	(draw_bubble_widget): Take out all calculations from this expose
+	handler and simply render the precalculated pipeline
+
+==================== 0.3.1 ====================
+
+2005-12-14  John (J5) Palmieri  <johnp at redhat.com>
+
+	* Release 0.3.1
+
+	* src/Makefile.am: fix for building in a seperate build directory
+
+	* configure.ac: Require D-Bus >= 0.60
+
+2005-12-12  John (J5) Palmieri  <johnp at redhat.com>
+
+	* src/eggnotificationbubblewidget.c (size_request_handler): removed
+	(egg_notification_bubble_widget_init): initialize draw_arrow to FALSE
+	(_populate_window): Move adding widgets to the table to the 
+	_layout_window method
+	(draw_bubble_widget): now can draw bubble without the arrow
+	(egg_notification_bubble_widget_set_draw_arrow): New method for setting
+	whether or not we should draw the arrow
+
+	* src/notifydaemon.c (_notify_daemon_add_bubble_to_poptart_stack): new
+	method which is used for adding bubbles without x, y coordinates to the
+	"poptart" stack
+	(_remove_bubble_from_poptart_stack): removes a bubble from the stack
+	and repositions the rest of the stack
+	(notify_daemon_notify_handler): add bubble to poptart stack if no
+	no x, y location given
+
+2005-12-09  John (J5) Palmieri  <johnp at redhat.com>
+
+	* src/eggnotificationbubblewidget.c (_layout_window): Add buttons for
+	actions
+	(draw_bubble_widget): close the cairo path so courner caps work
+	(egg_notification_bubble_widget_create_button): new method to create
+	a button and add it to the bubble
+	(egg_notification_bubble_widget_clear_buttons): new method for clearing
+	up all the buttons in the bubble
+	
+	* src/notifydaemon.xml: make the Notify method async so we can get the
+	sender
+
+	* src/notifydaemon.c (_emit_action_invoked_signal):  Emits the dbus 
+	signal when one of the action buttons is clicked
+	(_emit_closed_signal): emits a Closed signal over the bus when the
+	bubble is closed
+	(_close_notification): call _emit_closed_signal
+	(_notification_daemon_handle_bubble_widget_action): new method - iternal
+	callback we hook up to the buttons' "clicked" signal
+	(notify_daemon_notify_handler): change to an async method
+	store the unique name of the sender that called us
+	setup buttons if actions have been added 
+	
+2005-11-22  John (J5) Palmieri  <johnp at redhat.com>
+
+	* src/eggnotificationbubblewidget.c: Add a more stylized bubble
+	and render in both composite and shaped window mode
+
+2005-11-15  John (J5) Palmieri  <johnp at redhat.com>
+	
+	* Change refrences from notification to notify
+
+2005-11-10  John (J5) Palmieri  <johnp at redhat.com>
+
+	* Makefile.am: remove Doxyfile.in ref 
+
+2005-11-10  John (J5) Palmieri  <johnp at redhat.com>
+
+	* Initial checkin of the next generation notification daemon

Added: notification-daemon-xfce/trunk/INSTALL
===================================================================
--- notification-daemon-xfce/trunk/INSTALL	                        (rev 0)
+++ notification-daemon-xfce/trunk/INSTALL	2006-09-06 11:35:36 UTC (rev 1977)
@@ -0,0 +1,236 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
+Software Foundation, Inc.
+
+This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+These are generic installation instructions.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+   It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring.  (Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.)
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+   The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'.  You only need
+`configure.ac' if you want to change it or regenerate `configure' using
+a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.  If you're
+     using `csh' on an old version of System V, you might need to type
+     `sh ./configure' instead to prevent `csh' from trying to execute
+     `configure' itself.
+
+     Running `configure' takes awhile.  While running, it prints some
+     messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+Compilers and Options
+=====================
+
+Some systems require unusual options for compilation or linking that the
+`configure' script does not know about.  Run `./configure --help' for
+details on some of the pertinent environment variables.
+
+   You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here
+is an example:
+
+     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
+
+   *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   If you have to use a `make' that does not support the `VPATH'
+variable, you have to compile the package for one architecture at a
+time in the source code directory.  After you have installed the
+package for one architecture, use `make distclean' before reconfiguring
+for another architecture.
+
+Installation Names
+==================
+
+By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc.  You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PREFIX'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+give `configure' the option `--exec-prefix=PREFIX', the package will
+use PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+There may be some features `configure' cannot figure out automatically,
+but needs to determine by the type of machine the package will run on.
+Usually, assuming the package is built to be run on the _same_
+architectures, `configure' can figure that out, but if it prints a
+message saying it cannot guess the machine type, give it the
+`--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+     CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+     OS KERNEL-OS
+
+   See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+   If you are _building_ compiler tools for cross-compiling, you should
+use the `--target=TYPE' option to select the type of system they will
+produce code for.
+
+   If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+If you want to set default values for `configure' scripts to share, you
+can create a site shell script called `config.site' that gives default
+values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+Variables not defined in a site shell script can be set in the
+environment passed to `configure'.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'.  For example:
+
+     ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).  Here is a another example:
+
+     /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
+configuration-related scripts to be executed by `/bin/bash'.
+
+`configure' Invocation
+======================
+
+`configure' recognizes the following options to control how it operates.
+
+`--help'
+`-h'
+     Print a summary of the options to `configure', and exit.
+
+`--version'
+`-V'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`--cache-file=FILE'
+     Enable the cache: use and save the results of the tests in FILE,
+     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     disable caching.
+
+`--config-cache'
+`-C'
+     Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`configure' also accepts some other, not widely useful, options.  Run
+`configure --help' for more details.
+

Added: notification-daemon-xfce/trunk/Makefile.am
===================================================================
--- notification-daemon-xfce/trunk/Makefile.am	                        (rev 0)
+++ notification-daemon-xfce/trunk/Makefile.am	2006-09-06 11:35:36 UTC (rev 1977)
@@ -0,0 +1,36 @@
+# $Id$
+
+SUBDIRS = 								\
+	po								\
+	src								\
+	themes
+
+AUTOMAKE_OPTIONS =							\
+	1.8								\
+	dist-bzip2
+
+distclean-local:
+	rm -rf *.spec *.cache *~
+
+rpm: dist
+	rpmbuild -ta $(PACKAGE)-$(VERSION).tar.gz
+	@rm -f $(PACKAGE)-$(VERSION).tar.gz
+
+servicedir = $(datadir)/dbus-1/services
+service_in_files = org.freedesktop.Notifications.service
+service_DATA = $(service_in_files:.service.in=.service)
+
+%.service: %.service.in
+	sed -e "s,\@libexecdir\@,$(libexecdir),g" < $< > $@
+
+EXTRA_DIST =								\
+	intltool-extract.in						\
+	intltool-merge.in						\
+	intltool-update.in						\
+	$(service_in_files)
+
+DISTCLEANFILES =							\
+	intltool-extract						\
+	intltool-merge 							\
+	intltool-update							\
+	$(service_DATA)


Property changes on: notification-daemon-xfce/trunk/Makefile.am
___________________________________________________________________
Name: svn:keywords
   + Id

Added: notification-daemon-xfce/trunk/NEWS
===================================================================
--- notification-daemon-xfce/trunk/NEWS	                        (rev 0)
+++ notification-daemon-xfce/trunk/NEWS	2006-09-06 11:35:36 UTC (rev 1977)
@@ -0,0 +1,102 @@
+version 0.3.5 (26-April-2006):
+	* Add three new required theme functions:
+	  - theme_check_init - determines if the theme is compatible with the
+	    running version of notification-daemon.
+	  - get_theme_info - returns info on the theme.
+	  - clear_notification_actions - Clears the notification action buttons
+	    on the window.
+	* Disabled the Bubble theme for this release. It's the source of too
+	  many bugs.
+	* Fix the scaling of different icon sizes. Now small icons display as
+	  small, and larger icons are scaled down to 48x48.
+	* Fixed a problem where icons were being clipped in notifications.
+	  Patch by M.S. (Bug #21)
+	* Fixed incorrect usage of GtkIconTheme. (Bug #38)
+	* Fixed notifications with a timeout of 2147484ms or longer expiring
+	  in less than a second. (Bug #22)
+	* Fixed a bug where a notification would duplicate its actions when
+	  updated. (Bug #30)
+	* The Standard theme's countdown timer is now rendered using Cairo when
+	  compiled against Gtk 2.8.0 or higher. This improves the timer by making
+	  it antialiased.
+	* Renamed notification-daemon.service to
+	  org.freedesktop.Notifications.service.
+
+version 0.3.4 (4-February-2006):
+	* Added a Close button to notifications. This closed ticket #8. Thanks
+	  to Michael Vogt for the basis of this patch.
+	* Fixed a few bugs (including crashes) involving the freeing of
+	  memory when notifications and theme enginers are destroyed.
+	* Fixed the theme engines to be installed as unversioned libraries.
+	  Thanks to Rodney Dawes for this patch.
+	* Fixed a bug where the notification window was not realized, causing
+	  a crash. This fixes bug #10.
+	* Fixed a crash in the Bubble theme when clicking an action.
+	* Fixed action ordering in the Bubble theme.
+	* Made the destroy_notification, show_notification, hide_notification,
+	  and set_notification_hints theme engine functions optional.
+	* Added set_notification_timeout and notification_tick theme engine
+	  functions.
+	* Made several improvements to the Standard theme:
+	  - The left-hand color stripe has been made smaller and now reflects
+	    the urgency level set.
+	  - Added a pie-based countdown timer for notifications containing
+	    actions. This allows the user to see how long they have to react to
+	    a notification.
+	  - Converted the action links into buttons. These are now left-aligned
+	    and make a reasonable attempt to find an appropriate stock icon.
+	  - Allow the notification to be very short when no icons, body text or
+	    actions are specified.
+
+version 0.3.3 (25-January-2006):
+	* Install and check for engines in
+	  $(libdir)/notification-daemon-1.0/engines, as opposed to
+	  $(libdir)/notification-daemon/engines.
+	* Notifications no longer appear over full screen windows or
+	  screensavers.
+	* When using icontheme icons, the icon with a size closest to 48x48
+	  is used. If the icon is smaller than 48x48, the icon is left unscaled,
+	  but if it's larger, it's scaled down.
+
+version 0.3.2 (23-January-2006):
+	* Renamed the program back to notification-daemon.
+	* Reverted the default look back to the notification-daemon 0.2.x look,
+	  but with improvements, such as flexible arrow positioning and cleaner
+	  action separators.
+	* Updated to match the notification spec correctly.
+	* Added the beginnings of theme support. The look from
+	  notification-daemon v0.3.1 can be set in a GConf key, though it is
+	  not yet fully functional.
+	* Added back action support.
+	* Added back support for D-BUS 0.36 and higher.
+	* Added back the GetCapabilities and GetServerInformation calls.
+	* Added back suppor for markup and hyperlinks in the new theme.
+	* Fix several cases of C99 usage, and other compiler problems.
+	* Fixed a bug where the desktop work area (the area excluding panels)
+	  wasn't being taken into consideration when positioning notifications.
+	* Fixed several crash bugs.
+
+version 0.3.1:
+	* First release of the notify daemon which supports the new 0.3.x protocol
+	* Users of the older notification-daemon must make sure they uninstall it
+	  as it will try to catch messages ment for the notify-daemon
+
+version 0.2.4 (6-November-2005):
+	* Support clicking on hyperlinks.
+
+version 0.2.3 (6-November-2005):
+	* Depends on libsexy for the URL label.
+
+version 0.2.2 (10-August-2005):
+	* Fixed several run-time issues on PPC and AMD64 (Martin Pitt)
+	* Notifications that are created at the same time will disappear at
+	  the same time.
+	* Notifications that don't expire until the user clicks on them will
+	  no longer block notifications that do expire.
+
+version 0.2.1 (28-July-2005):
+	* Fixed hint support for D-BUS 0.3x.
+	* Fixed a compile issue with GCC 4.0.
+
+version 0.2.0 (28-July-2005):
+	* Initial public release.

Added: notification-daemon-xfce/trunk/README
===================================================================
--- notification-daemon-xfce/trunk/README	                        (rev 0)
+++ notification-daemon-xfce/trunk/README	2006-09-06 11:35:36 UTC (rev 1977)
@@ -0,0 +1,12 @@
+Notification-daemon-xfce is a port of Gnome's notification-daemon
+for the Xfce desktop. It depends on the following packages:
+  * gtk >= 2.6.0
+  * libxfce4util >= 4.3.90
+  * libxfcegui4 >= 4.3.90
+  * dbus >= 0.36
+  * libsexy >= 0.1.3
+The Xfce version also uses xfce4-dev-tools for creating the make files.
+
+More information about the origional version of the
+notification-daemon can be found here:
+  http://www.galago-project.org

Added: notification-daemon-xfce/trunk/autogen.sh
===================================================================
--- notification-daemon-xfce/trunk/autogen.sh	                        (rev 0)
+++ notification-daemon-xfce/trunk/autogen.sh	2006-09-06 11:35:36 UTC (rev 1977)
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# $Id$
+#
+# Copyright (c) 2002-2006
+#         The Thunar development team. All rights reserved.
+#
+# Written for Thunar by Benedikt Meurer <benny at xfce.org>.
+#
+
+(type xdt-autogen) >/dev/null 2>&1 || {
+  cat >&2 <<EOF
+autogen.sh: You don't seem to have the Xfce development tools installed on
+            your system, which are required to build this software.
+            Please install the xfce4-dev-tools package first, it is available
+            from http://www.xfce.org/.
+EOF
+  exit 1
+}
+
+# verify that po/LINGUAS is present
+(test -f po/LINGUAS) >/dev/null 2>&1 || {
+  cat >&2 <<EOF
+autogen.sh: The file po/LINGUAS could not be found. Please check your snapshot
+            or try to checkout again.
+EOF
+  exit 1
+}
+
+# substitute revision and linguas
+linguas=`sed -e '/^#/d' po/LINGUAS`
+revision=`LC_ALL=C svn info $0 | awk '/^Revision: / {printf "%05d\n", $2}'`
+sed -e "s/@LINGUAS@/${linguas}/g" \
+    -e "s/@REVISION@/${revision}/g" \
+    < "configure.in.in" > "configure.in"
+
+exec xdt-autogen $@
+
+# vi:set ts=2 sw=2 et ai:


Property changes on: notification-daemon-xfce/trunk/autogen.sh
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:keywords
   + Id

Added: notification-daemon-xfce/trunk/configure.in.in
===================================================================
--- notification-daemon-xfce/trunk/configure.in.in	                        (rev 0)
+++ notification-daemon-xfce/trunk/configure.in.in	2006-09-06 11:35:36 UTC (rev 1977)
@@ -0,0 +1,67 @@
+dnl $Id$
+dnl
+dnl Copyright 2006 Christian Hammond
+dnl Makefiles for Xfce created by Nick Schermer <nick at xfce.org>
+dnl
+
+dnl version info
+m4_define([notification_daemon_major_version], [0])
+m4_define([notification_daemon_minor_version], [3])
+m4_define([notification_daemon_micro_version], [5])
+
+m4_define([notification_daemon_version], [notification_daemon_major_version().notification_daemon_minor_version().notification_daemon_micro_version()])
+
+dnl init autoconf
+AC_INIT([notification_daemon], [notification_daemon_version], [galago-devel at lists.freedesktop.org])
+AC_PREREQ([2.50])
+
+dnl init automake
+NOTIFICATION_DAEMON_VERSION=notification_daemon_version
+AM_INIT_AUTOMAKE([notification_daemon], [$NOTIFICATION_DAEMON_VERSION])
+AM_CONFIG_HEADER([config.h])
+AM_MAINTAINER_MODE
+
+dnl check for basic programs
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_LIBTOOL
+AC_PROG_INTLTOOL()
+
+dnl Version information
+NOTIFICATION_DAEMON_MAJOR_VERSION=notification_daemon_major_version()
+NOTIFICATION_DAEMON_MINOR_VERSION=notification_daemon_minor_version()
+NOTIFICATION_DAEMON_MICRO_VERSION=notification_daemon_micro_version()
+AC_DEFINE_UNQUOTED(NOTIFICATION_DAEMON_MAJOR_VERSION, $NOTIFICATION_DAEMON_MAJOR_VERSION, [Major])
+AC_DEFINE_UNQUOTED(NOTIFICATION_DAEMON_MINOR_VERSION, $NOTIFICATION_DAEMON_MINOR_VERSION, [Minor])
+AC_DEFINE_UNQUOTED(NOTIFICATION_DAEMON_MICRO_VERSION, $NOTIFICATION_DAEMON_MICRO_VERSION, [Micro])
+
+dnl check for standard header files
+AC_HEADER_STDC
+
+dnl Check for i18n support
+XDT_I18N([@LINGUAS@])
+
+dnl Check for X11 installed
+XDT_CHECK_LIBX11_REQUIRE
+XDT_CHECK_LIBSM
+
+dnl required
+XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.6.0])
+XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.6.0])
+XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.3.90])
+XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.3.90])
+XDT_CHECK_PACKAGE([DBUS_GLIB], [dbus-glib-1], [0.36])
+XDT_CHECK_PACKAGE([DBUS], [dbus-1], [0.36])
+XDT_CHECK_PACKAGE([LIBSEXY], [libsexy], [0.1.3])
+
+dnl check for debugging support
+XDT_FEATURE_DEBUG()
+
+AC_OUTPUT([
+Makefile
+po/Makefile.in
+src/Makefile
+themes/Makefile
+themes/bubble/Makefile
+themes/standard/Makefile
+])


Property changes on: notification-daemon-xfce/trunk/configure.in.in
___________________________________________________________________
Name: svn:keywords
   + Id

Added: notification-daemon-xfce/trunk/org.freedesktop.Notifications.service.in
===================================================================
--- notification-daemon-xfce/trunk/org.freedesktop.Notifications.service.in	                        (rev 0)
+++ notification-daemon-xfce/trunk/org.freedesktop.Notifications.service.in	2006-09-06 11:35:36 UTC (rev 1977)
@@ -0,0 +1,3 @@
+[D-BUS Service]
+Name=org.freedesktop.Notifications
+Exec=@libexecdir@/notification-daemon

Added: notification-daemon-xfce/trunk/po/ChangeLog
===================================================================

Added: notification-daemon-xfce/trunk/po/LINGUAS
===================================================================
--- notification-daemon-xfce/trunk/po/LINGUAS	                        (rev 0)
+++ notification-daemon-xfce/trunk/po/LINGUAS	2006-09-06 11:35:36 UTC (rev 1977)
@@ -0,0 +1,2 @@
+# set of available languages (in alphabetic order)
+

Added: notification-daemon-xfce/trunk/po/POTFILES.in
===================================================================
--- notification-daemon-xfce/trunk/po/POTFILES.in	                        (rev 0)
+++ notification-daemon-xfce/trunk/po/POTFILES.in	2006-09-06 11:35:36 UTC (rev 1977)
@@ -0,0 +1 @@
+

Added: notification-daemon-xfce/trunk/src/Makefile.am
===================================================================
--- notification-daemon-xfce/trunk/src/Makefile.am	                        (rev 0)
+++ notification-daemon-xfce/trunk/src/Makefile.am	2006-09-06 11:35:36 UTC (rev 1977)
@@ -0,0 +1,40 @@
+# $Id$
+
+libexec_PROGRAMS =							\
+	notification-daemon
+
+notification_daemon_SOURCES =						\
+	engines.c							\
+	engines.h							\
+	daemon.c							\
+	daemon.h
+
+notification_daemon_LDADD =						\
+	$(GTK_LIBS)							\
+	$(LIBXFCEGUI4_LIBS)						\
+	$(LIBXFCE4UTIL_LIBS)						\
+	$(DBUS_LIBS)							\
+	$(DBUS_GLIB_LIBS)
+
+BUILT_SOURCES = 							\
+	notificationdaemon-dbus-glue.h
+
+notificationdaemon-dbus-glue.h: notificationdaemon.xml
+	dbus-binding-tool --mode=glib-server 				\
+		$(srcdir)/notificationdaemon.xml > notificationdaemon-dbus-glue.h
+
+INCLUDES =								\
+	-I$(top_srcdir)							\
+	-DDBUS_API_SUBJECT_TO_CHANGE 					\
+	$(GTK_CFLAGS)							\
+	$(LIBXFCEGUI4_CFLAGS)						\
+	$(LIBXFCE$UTIL_CFLAGS)						\
+	$(DBUS_CFLAGS)							\
+	$(DBUS_GLIB_CFLAGS)						\
+	-DENGINES_DIR=\"$(libdir)/notification-daemon-1.0/engines\"
+
+EXTRA_DIST = 								\
+	notificationdaemon.xml
+
+DISTCLEANFILES = 							\
+	notificationdaemon-dbus-glue.h


Property changes on: notification-daemon-xfce/trunk/src/Makefile.am
___________________________________________________________________
Name: svn:keywords
   + Id

Added: notification-daemon-xfce/trunk/src/daemon.c
===================================================================
--- notification-daemon-xfce/trunk/src/daemon.c	                        (rev 0)
+++ notification-daemon-xfce/trunk/src/daemon.c	2006-09-06 11:35:36 UTC (rev 1977)
@@ -0,0 +1,1099 @@
+/* $Id$
+ *
+ * Copyright (C) 2006 Christian Hammond <chipx86 at chipx86.com>
+ * Copyright (C) 2005 John (J5) Palmieri <johnp at redhat.com>
+ * Copyright (C) 2006 Nick Schermer <nick at xfce.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, 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-1307, USA.
+ */
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <stdio.h>
+
+#include <dbus/dbus.h>
+#include <dbus/dbus-glib.h>
+#include <glib.h>
+#include <glib-object.h>
+#include <gtk/gtk.h>
+
+#include <X11/Xproto.h>
+
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/Xatom.h>
+#include <gdk/gdkx.h>
+
+#include <libxfcegui4/libxfcegui4.h>
+
+#include "daemon.h"
+#include "engines.h"
+#include "notificationdaemon-dbus-glue.h"
+
+#define IMAGE_SIZE 48
+
+struct _NotifyTimeout
+{
+	GTimeVal expiration;
+	gboolean has_timeout;
+	guint id;
+
+	GtkWindow *nw;
+};
+
+typedef struct _NotifyTimeout NotifyTimeout;
+
+struct _NotifyDaemonPrivate
+{
+	guint next_id;
+	guint timeout_source;
+	GHashTable *notification_hash;
+	GSList *poptart_stack;
+	gboolean url_clicked_lock;
+};
+
+/* static GConfClient *gconf_client = NULL; */
+
+#define CHECK_DBUS_VERSION(major, minor) \
+	(DBUS_MAJOR_VER > (major) || \
+	 (DBUS_MAJOR_VER == (major) && DBUS_MINOR_VER >= (minor)))
+
+#if !CHECK_DBUS_VERSION(0, 60)
+/* This is a hack that will go away in time. For now, it's fairly safe. */
+struct _DBusGMethodInvocation
+{
+	DBusGConnection *connection;
+	DBusGMessage *message;
+	const DBusGObjectInfo *object;
+	const DBusGMethodInfo *method;
+};
+#endif /* D-BUS < 0.60 */
+
+static void notify_daemon_finalize(GObject *object);
+static void _close_notification(NotifyDaemon *daemon, guint id,
+								gboolean hide_notification);
+static void _emit_closed_signal(GObject *notify_widget);
+static void _action_invoked_cb(GtkWindow *nw, const char *key);
+
+G_DEFINE_TYPE(NotifyDaemon, notify_daemon, G_TYPE_OBJECT);
+
+static void
+notify_daemon_class_init(NotifyDaemonClass *daemon_class)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS(daemon_class);
+
+	object_class->finalize = notify_daemon_finalize;
+
+	g_type_class_add_private(daemon_class, sizeof(NotifyDaemonPrivate));
+}
+
+static void
+_notify_timeout_destroy(NotifyTimeout *nt)
+{
+	gtk_widget_destroy(GTK_WIDGET(nt->nw));
+	g_free(nt);
+}
+
+static void
+notify_daemon_init(NotifyDaemon *daemon)
+{
+	daemon->priv = G_TYPE_INSTANCE_GET_PRIVATE(daemon, NOTIFY_TYPE_DAEMON,
+											   NotifyDaemonPrivate);
+
+	daemon->priv->next_id = 1;
+	daemon->priv->timeout_source = 0;
+	daemon->priv->notification_hash =
+		g_hash_table_new_full(g_int_hash, g_int_equal, g_free,
+							  (GDestroyNotify)_notify_timeout_destroy);
+}
+
+static void
+notify_daemon_finalize(GObject *object)
+{
+	NotifyDaemon *daemon;
+	GObjectClass *parent_class;
+
+	daemon = NOTIFY_DAEMON(object);
+
+	g_hash_table_destroy(daemon->priv->notification_hash);
+	g_slist_free(daemon->priv->poptart_stack);
+
+	parent_class = G_OBJECT_CLASS(notify_daemon_parent_class);
+
+	if (parent_class->finalize != NULL)
+		parent_class->finalize(object);
+}
+
+NotifyDaemon *
+notify_daemon_new(void)
+{
+	return g_object_new(NOTIFY_TYPE_DAEMON, NULL);
+}
+
+static void
+_action_invoked_cb(GtkWindow *nw, const char *key)
+{
+	NotifyDaemon *daemon = g_object_get_data(G_OBJECT(nw), "_notify_daemon");
+	DBusConnection *con;
+	DBusError error;
+
+	dbus_error_init(&error);
+
+	con = dbus_bus_get(DBUS_BUS_SESSION, &error);
+
+	if (con == NULL)
+	{
+		g_warning("Error sending ActionInvoked signal: %s", error.message);
+		dbus_error_free(&error);
+	}
+	else
+	{
+		DBusMessage *message;
+		gchar *dest;
+		guint id;
+
+		message = dbus_message_new_signal("/org/freedesktop/Notifications",
+										  "org.freedesktop.Notifications",
+										  "ActionInvoked");
+
+		dest = g_object_get_data(G_OBJECT(nw), "_notify_sender");
+		id = GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(nw), "_notify_id"));
+
+		g_assert(dest != NULL);
+
+		dbus_message_set_destination(message, dest);
+		dbus_message_append_args(message,
+								 DBUS_TYPE_UINT32, &id,
+								 DBUS_TYPE_STRING, &key,
+								 DBUS_TYPE_INVALID);
+
+		dbus_connection_send(con, message, NULL);
+
+		dbus_message_unref(message);
+		dbus_connection_unref(con);
+	}
+
+	_close_notification(
+		daemon,
+		GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(nw), "_notify_id")),
+		TRUE);
+}
+
+static void
+_emit_closed_signal(GObject *notify_widget)
+{
+	DBusConnection *con;
+	DBusError error;
+
+	dbus_error_init(&error);
+
+	con = dbus_bus_get(DBUS_BUS_SESSION, &error);
+
+	if (con == NULL)
+	{
+		g_warning("Error sending Close signal: %s", error.message);
+		dbus_error_free(&error);
+	}
+	else
+	{
+		DBusMessage *message;
+		gchar *dest;
+		guint id;
+
+		message = dbus_message_new_signal("/org/freedesktop/Notifications",
+										  "org.freedesktop.Notifications",
+										  "NotificationClosed");
+
+		dest = g_object_get_data(notify_widget, "_notify_sender");
+		id = GPOINTER_TO_UINT(g_object_get_data(notify_widget, "_notify_id"));
+
+		g_assert(dest != NULL);
+
+		dbus_message_set_destination(message, dest);
+		dbus_message_append_args(message,
+								 DBUS_TYPE_UINT32, &id,
+								 DBUS_TYPE_INVALID);
+
+		dbus_connection_send(con, message, NULL);
+
+		dbus_message_unref(message);
+		dbus_connection_unref(con);
+	}
+}
+
+static void
+_close_notification(NotifyDaemon *daemon, guint id, gboolean hide_notification)
+{
+	NotifyDaemonPrivate *priv = daemon->priv;
+	NotifyTimeout *nt;
+
+	nt = (NotifyTimeout *)g_hash_table_lookup(priv->notification_hash, &id);
+
+	if (nt != NULL)
+	{
+		_emit_closed_signal(G_OBJECT(nt->nw));
+
+		if (hide_notification)
+			theme_hide_notification(nt->nw);
+
+		g_hash_table_remove(priv->notification_hash, &id);
+	}
+}
+
+static void
+_notification_destroyed_cb(GtkWindow *nw, NotifyDaemon *daemon)
+{
+	_close_notification(
+		daemon,
+		GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(nw), "_notify_id")),
+		FALSE);
+}
+
+static gboolean
+_is_expired(gpointer key, gpointer value, gpointer data)
+{
+	NotifyTimeout *nt = (NotifyTimeout *)value;
+	gboolean *phas_more_timeouts = (gboolean *)data;
+	time_t now_time;
+	time_t expiration_time;
+	GTimeVal now;
+
+	if (!nt->has_timeout)
+		return FALSE;
+
+	g_get_current_time(&now);
+
+	expiration_time = (nt->expiration.tv_sec * 1000) +
+	                  (nt->expiration.tv_usec / 1000);
+	now_time = (now.tv_sec * 1000) + (now.tv_usec / 1000);
+
+	if (now_time > expiration_time)
+	{
+		theme_notification_tick(nt->nw, 0);
+		_emit_closed_signal(G_OBJECT(nt->nw));
+		return TRUE;
+	}
+	else
+		theme_notification_tick(nt->nw, expiration_time - now_time);
+
+	*phas_more_timeouts = TRUE;
+
+	return FALSE;
+}
+
+static gboolean
+_check_expiration(gpointer data)
+{
+	NotifyDaemon *daemon = (NotifyDaemon *)data;
+	gboolean has_more_timeouts = FALSE;
+
+	g_hash_table_foreach_remove(daemon->priv->notification_hash,
+								_is_expired, (gpointer)&has_more_timeouts);
+
+	if (!has_more_timeouts)
+		daemon->priv->timeout_source = 0;
+
+	return has_more_timeouts;
+}
+
+static void
+_calculate_timeout(NotifyDaemon *daemon, NotifyTimeout *nt, int timeout)
+{
+	if (timeout == 0)
+		nt->has_timeout = FALSE;
+	else
+	{
+		glong usec;
+
+		nt->has_timeout = TRUE;
+
+		if (timeout == -1)
+			timeout = NOTIFY_DAEMON_DEFAULT_TIMEOUT;
+
+		theme_set_notification_timeout(nt->nw, timeout);
+
+		usec = timeout * 1000;	/* convert from msec to usec */
+
+		/*
+		 * If it's less than 0, wrap around back to MAXLONG.
+		 * g_time_val_add() requires a glong, and anything larger than
+		 * MAXLONG will be treated as a negative value.
+		 */
+		if (usec < 0)
+			usec = G_MAXLONG;
+
+		g_get_current_time(&nt->expiration);
+		g_time_val_add(&nt->expiration, usec);
+
+		if (daemon->priv->timeout_source == 0)
+		{
+			daemon->priv->timeout_source = g_timeout_add(100,
+														 _check_expiration,
+														 daemon);
+		}
+	}
+}
+
+static guint
+_store_notification(NotifyDaemon *daemon, GtkWindow *nw, int timeout)
+{
+	NotifyDaemonPrivate *priv = daemon->priv;
+	NotifyTimeout *nt;
+	guint id = 0;
+
+	do
+	{
+		id = priv->next_id;
+
+		if (id != UINT_MAX)
+			priv->next_id++;
+		else
+			priv->next_id = 1;
+
+		if (g_hash_table_lookup(priv->notification_hash, &id) != NULL)
+			id = 0;
+
+	} while (id == 0);
+
+	nt = g_new0(NotifyTimeout, 1);
+	nt->id = id;
+	nt->nw = nw;
+
+	_calculate_timeout(daemon, nt, timeout);
+
+	g_hash_table_insert(priv->notification_hash,
+						g_memdup(&id, sizeof(guint)), nt);
+
+	return id;
+}
+
+static gboolean
+_notify_daemon_process_icon_data(NotifyDaemon *daemon, GtkWindow *nw,
+								 GValue *icon_data)
+{
+	const guchar *data = NULL;
+	gboolean has_alpha;
+	int bits_per_sample;
+	int width;
+	int height;
+	int rowstride;
+	int n_channels;
+	gsize expected_len;
+	GdkPixbuf *pixbuf;
+	GValueArray *image_struct;
+	GValue *value;
+	GArray *tmp_array;
+
+	if (!G_VALUE_HOLDS(icon_data, G_TYPE_VALUE_ARRAY))
+	{
+		g_warning("_notify_daemon_process_icon_data expected a "
+				  "GValue of type GValueArray");
+		return FALSE;
+	}
+
+	image_struct = (GValueArray *)g_value_get_boxed(icon_data);
+	value = g_value_array_get_nth(image_struct, 0);
+
+	if (value == NULL)
+	{
+		g_warning("_notify_daemon_process_icon_data expected position "
+				  "0 of the GValueArray to exist");
+		return FALSE;
+	}
+
+	if (!G_VALUE_HOLDS(value, G_TYPE_INT))
+	{
+		g_warning("_notify_daemon_process_icon_data expected "
+				  "position 0 of the GValueArray to be of type int");
+		return FALSE;
+	}
+
+	width = g_value_get_int(value);
+	value = g_value_array_get_nth(image_struct, 1);
+
+	if (value == NULL)
+	{
+		g_warning("_notify_daemon_process_icon_data expected "
+				  "position 1 of the GValueArray to exist");
+		return FALSE;
+	}
+
+	if (!G_VALUE_HOLDS(value, G_TYPE_INT))
+	{
+		g_warning("_notify_daemon_process_icon_data expected "
+				  "position 1 of the GValueArray to be of type int");
+		return FALSE;
+	}
+
+	height = g_value_get_int(value);
+	value = g_value_array_get_nth(image_struct, 2);
+
+	if (value == NULL)
+	{
+		g_warning("_notify_daemon_process_icon_data expected "
+				  "position 2 of the GValueArray to exist");
+		return FALSE;
+	}
+
+	if (!G_VALUE_HOLDS(value, G_TYPE_INT))
+	{
+		g_warning("_notify_daemon_process_icon_data expected "
+				  "position 2 of the GValueArray to be of type int");
+		return FALSE;
+	}
+
+	rowstride = g_value_get_int(value);
+	value = g_value_array_get_nth(image_struct, 3);
+
+	if (value == NULL)
+	{
+		g_warning("_notify_daemon_process_icon_data expected "
+				  "position 3 of the GValueArray to exist");
+		return FALSE;
+	}
+
+	if (!G_VALUE_HOLDS(value, G_TYPE_BOOLEAN))
+	{
+		g_warning("_notify_daemon_process_icon_data expected "
+				  "position 3 of the GValueArray to be of type gboolean");
+		return FALSE;
+	}
+
+	has_alpha = g_value_get_boolean(value);
+	value = g_value_array_get_nth(image_struct, 4);
+
+	if (value == NULL)
+	{
+		g_warning("_notify_daemon_process_icon_data expected "
+				  "position 4 of the GValueArray to exist");
+		return FALSE;
+	}
+
+	if (!G_VALUE_HOLDS(value, G_TYPE_INT))
+	{
+		g_warning("_notify_daemon_process_icon_data expected "
+				  "position 4 of the GValueArray to be of type int");
+		return FALSE;
+	}
+
+	bits_per_sample = g_value_get_int(value);
+	value = g_value_array_get_nth(image_struct, 5);
+
+	if (value == NULL)
+	{
+		g_warning("_notify_daemon_process_icon_data expected "
+				  "position 5 of the GValueArray to exist");
+		return FALSE;
+	}
+
+	if (!G_VALUE_HOLDS(value, G_TYPE_INT))
+	{
+		g_warning("_notify_daemon_process_icon_data expected "
+				  "position 5 of the GValueArray to be of type int");
+		return FALSE;
+	}
+
+	n_channels = g_value_get_int(value);
+	value = g_value_array_get_nth(image_struct, 6);
+
+	if (value == NULL)
+	{
+		g_warning("_notify_daemon_process_icon_data expected "
+				  "position 6 of the GValueArray to exist");
+		return FALSE;
+	}
+
+	if (!G_VALUE_HOLDS(value,
+					   dbus_g_type_get_collection("GArray", G_TYPE_UCHAR)))
+	{
+		g_warning("_notify_daemon_process_icon_data expected "
+				  "position 6 of the GValueArray to be of type GArray");
+		return FALSE;
+	}
+
+	tmp_array = (GArray *)g_value_get_boxed(value);
+	expected_len = (height - 1) * rowstride + width *
+	               ((n_channels * bits_per_sample + 7) / 8);
+
+	if (expected_len != tmp_array->len)
+	{
+		g_warning("_notify_daemon_process_icon_data expected image "
+				  "data to be of length %i but got a length of %i",
+				  expected_len, tmp_array->len);
+		return FALSE;
+	}
+
+	data = (guchar *)g_memdup(tmp_array->data, tmp_array->len);
+	pixbuf = gdk_pixbuf_new_from_data(data, GDK_COLORSPACE_RGB, has_alpha,
+									  bits_per_sample, width, height,
+									  rowstride,
+									  (GdkPixbufDestroyNotify)g_free,
+									  NULL);
+	theme_set_notification_icon(nw, pixbuf);
+	g_object_unref(G_OBJECT(pixbuf));
+
+	return TRUE;
+}
+
+static void
+window_clicked_cb(GtkWindow *nw, GdkEventButton *button, NotifyDaemon *daemon)
+{
+	if (daemon->priv->url_clicked_lock)
+	{
+		daemon->priv->url_clicked_lock = FALSE;
+		return;
+	}
+
+	_action_invoked_cb(nw, "default");
+
+	_close_notification(
+		daemon,
+		GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(nw), "_notify_id")),
+		TRUE);
+}
+
+static gboolean
+get_work_area(GtkWidget *nw, GdkRectangle *rect)
+{
+	Atom workarea = XInternAtom(GDK_DISPLAY(), "_NET_WORKAREA", True);
+	Atom type;
+	Window win;
+	int format;
+	gulong num, leftovers;
+	gulong max_len = 4 * 32;
+	guchar *ret_workarea;
+	long *workareas;
+	int result;
+	GdkScreen *screen;
+	int disp_screen;
+
+	gtk_widget_realize(nw);
+	screen = gdk_drawable_get_screen(GDK_DRAWABLE(nw->window));
+	disp_screen = GDK_SCREEN_XNUMBER(screen);
+
+	/* Defaults in case of error */
+	rect->x = 0;
+	rect->y = 0;
+	rect->width = gdk_screen_get_width(screen);
+	rect->height = gdk_screen_get_height(screen);
+
+	if (workarea == None)
+		return FALSE;
+
+	win = XRootWindow(GDK_DISPLAY(), disp_screen);
+	result = XGetWindowProperty(GDK_DISPLAY(), win, workarea, 0,
+								max_len, False, AnyPropertyType,
+								&type, &format, &num, &leftovers,
+								&ret_workarea);
+
+	if (result != Success || type == None || format == 0 || leftovers ||
+		num % 4)
+	{
+		return FALSE;
+	}
+
+	workareas = (long *)ret_workarea;
+	rect->x      = workareas[disp_screen * 4];
+	rect->y      = workareas[disp_screen * 4 + 1];
+	rect->width  = workareas[disp_screen * 4 + 2];
+	rect->height = workareas[disp_screen * 4 + 3];
+
+	XFree(ret_workarea);
+
+	return TRUE;
+}
+
+static void
+_remove_bubble_from_poptart_stack(GtkWindow *nw, NotifyDaemon *daemon)
+{
+	NotifyDaemonPrivate *priv = daemon->priv;
+	GdkRectangle workarea;
+	GSList *remove_link = NULL;
+	GSList *link;
+	gint x, y;
+
+	get_work_area(GTK_WIDGET(nw), &workarea);
+
+	y = workarea.y + workarea.height;
+	x = 0;
+
+	for (link = priv->poptart_stack; link != NULL; link = link->next)
+	{
+		GtkWindow *nw2 = link->data;
+		GtkRequisition req;
+
+		if (nw2 != nw)
+		{
+			gtk_widget_size_request(GTK_WIDGET(nw2), &req);
+
+			x = workarea.x + workarea.width - req.width;
+			y = y - req.height;
+
+			theme_move_notification(nw2, x, y);
+		}
+		else
+		{
+			remove_link = link;
+		}
+	}
+
+	if (remove_link)
+	{
+		priv->poptart_stack = g_slist_remove_link(priv->poptart_stack,
+												  remove_link);
+	}
+}
+
+static void
+_notify_daemon_add_bubble_to_poptart_stack(NotifyDaemon *daemon,
+										   GtkWindow *nw,
+										   gboolean new_notification)
+{
+	NotifyDaemonPrivate *priv = daemon->priv;
+	GtkRequisition req;
+	GdkRectangle workarea;
+	GSList *link;
+	gint x, y;
+
+	gtk_widget_size_request(GTK_WIDGET(nw), &req);
+
+	get_work_area(GTK_WIDGET(nw), &workarea);
+
+	x = workarea.x + workarea.width - req.width;
+	y = workarea.y + workarea.height - req.height;
+
+	theme_move_notification(nw, x, y);
+
+	for (link = priv->poptart_stack; link != NULL; link = link->next)
+	{
+		GtkWindow *nw2 = GTK_WINDOW(link->data);
+
+		if (nw2 != nw)
+		{
+			gtk_widget_size_request(GTK_WIDGET(nw2), &req);
+			x = workarea.x + workarea.width - req.width;
+			y = y - req.height;
+			theme_move_notification(nw2, x, y);
+		}
+	}
+
+	if (new_notification)
+	{
+		g_signal_connect(G_OBJECT(nw), "destroy",
+						 G_CALLBACK(_remove_bubble_from_poptart_stack),
+						 daemon);
+		priv->poptart_stack = g_slist_prepend(priv->poptart_stack, nw);
+	}
+}
+
+static void
+url_clicked_cb(GtkWindow *nw, const char *url)
+{
+	NotifyDaemon *daemon = g_object_get_data(G_OBJECT(nw), "_notify_daemon");
+	char *escaped_url;
+	char *cmd = NULL;
+
+	/* Somewhat of a hack.. */
+	daemon->priv->url_clicked_lock = TRUE;
+
+	escaped_url = g_shell_quote(url);
+
+	/*
+	 * We can't actually check for GNOME_DESKTOP_SESSION_ID, because it's
+	 * not in the environment for this program :(
+	 */
+	if (/*g_getenv("GNOME_DESKTOP_SESSION_ID") != NULL &&*/
+		g_find_program_in_path("gnome-open") != NULL)
+	{
+		cmd = g_strdup_printf("gnome-open %s", escaped_url);
+	}
+	else if (g_find_program_in_path("mozilla-firefox") != NULL)
+	{
+		cmd = g_strdup_printf("mozilla-firefox %s", escaped_url);
+	}
+	else if (g_find_program_in_path("firefox") != NULL)
+	{
+		cmd = g_strdup_printf("firefox %s", escaped_url);
+	}
+	else if (g_find_program_in_path("mozilla") != NULL)
+	{
+		cmd = g_strdup_printf("mozilla %s", escaped_url);
+	}
+	else
+	{
+		g_warning("Unable to find a browser.");
+	}
+
+	g_free(escaped_url);
+
+	if (cmd != NULL)
+	{
+		g_spawn_command_line_async(cmd, NULL);
+		g_free(cmd);
+	}
+}
+
+static gboolean
+screensaver_active(GtkWidget *nw)
+{
+	GdkDisplay *display = gdk_drawable_get_display(GDK_DRAWABLE(nw->window));
+	Atom type;
+	int format;
+	unsigned long nitems, bytes_after;
+	unsigned char *temp_data;
+	gboolean active = FALSE;
+	Atom XA_BLANK = gdk_x11_get_xatom_by_name_for_display(display, "BLANK");
+	Atom XA_LOCK = gdk_x11_get_xatom_by_name_for_display(display, "LOCK");
+
+	/* Check for a screensaver first. */
+	if (XGetWindowProperty(
+		GDK_DISPLAY_XDISPLAY(display),
+		GDK_ROOT_WINDOW(),
+		gdk_x11_get_xatom_by_name_for_display(display, "_SCREENSAVER_STATUS"),
+		0, G_MAXLONG, False, XA_INTEGER, &type, &format, &nitems,
+		&bytes_after, &temp_data) == Success &&
+		type && temp_data != NULL)
+	{
+		CARD32 *data = (CARD32 *)temp_data;
+
+		active = (type == XA_INTEGER && nitems >= 3 &&
+				  (time_t)data[1] > (time_t)666000000L &&
+				  (data[0] == XA_BLANK || data[0] == XA_LOCK));
+	}
+
+	if (temp_data != NULL)
+		free(temp_data);
+
+	return active;
+}
+
+static gboolean
+fullscreen_window_exists(GtkWidget *nw)
+{
+	NetkScreen *netk_screen;
+	GList *l;
+
+	netk_screen = netk_screen_get(GDK_SCREEN_XNUMBER(
+		gdk_drawable_get_screen(GDK_DRAWABLE(GTK_WIDGET(nw)->window))));
+	netk_screen_force_update(netk_screen);
+
+	for (l = netk_screen_get_windows_stacked(netk_screen);
+		 l != NULL;
+		 l = l->next)
+	{
+		NetkWindow *netk_win = (NetkWindow *)l->data;
+
+		if (netk_window_is_fullscreen(netk_win))
+		{
+			/*
+			 * Sanity check if the window is _really_ fullscreen to
+			 * work around a bug in netk that doesn't get all
+			 * unfullscreen events.
+			 */
+			int sw = netk_screen_get_width(netk_screen);
+			int sh = netk_screen_get_height(netk_screen);
+			int x, y, w, h;
+
+			netk_window_get_geometry(netk_win, &x, &y, &w, &h);
+
+			if (sw == w && sh == h)
+				return TRUE;
+		}
+	}
+
+	return FALSE;
+}
+
+gboolean
+notify_daemon_notify_handler(NotifyDaemon *daemon,
+							 const gchar *app_name,
+							 guint id,
+							 const gchar *icon,
+							 const gchar *summary,
+							 const gchar *body,
+							 gchar **actions,
+							 GHashTable *hints,
+							 int timeout, DBusGMethodInvocation *context)
+{
+	NotifyDaemonPrivate *priv = daemon->priv;
+	NotifyTimeout *nt = NULL;
+	GtkWindow *nw = NULL;
+	GValue *data;
+	gboolean use_pos_data = FALSE;
+	gboolean new_notification = FALSE;
+	gint x = 0;
+	gint y = 0;
+	guint return_id;
+	gchar *sender;
+	gint i;
+
+	if (id > 0)
+	{
+		nt = (NotifyTimeout *)g_hash_table_lookup(priv->notification_hash,
+												  &id);
+
+		if (nt != NULL)
+			nw = nt->nw;
+	}
+
+	if (nw == NULL)
+	{
+		nw = theme_create_notification(url_clicked_cb);
+		g_object_set_data(G_OBJECT(nw), "_notify_daemon", daemon);
+		gtk_widget_realize(GTK_WIDGET(nw));
+		new_notification = TRUE;
+
+		g_signal_connect(G_OBJECT(nw), "button-release-event",
+						 G_CALLBACK(window_clicked_cb), daemon);
+		g_signal_connect(G_OBJECT(nw), "destroy",
+						 G_CALLBACK(_notification_destroyed_cb), daemon);
+	}
+	else
+	{
+		theme_clear_notification_actions(nw);
+	}
+
+	theme_set_notification_text(nw, summary, body);
+	theme_set_notification_hints(nw, hints);
+
+	/*
+	 *XXX This needs to handle file URIs and all that.
+	 */
+
+	/* deal with x, and y hints */
+	if ((data = (GValue *)g_hash_table_lookup(hints, "x")) != NULL)
+	{
+		x = g_value_get_int(data);
+
+		if ((data = (GValue *)g_hash_table_lookup(hints, "y")) != NULL)
+		{
+			y = g_value_get_int(data);
+			use_pos_data = TRUE;
+		}
+	}
+
+	/* set up action buttons */
+	for (i = 0; actions[i] != NULL; i += 2)
+	{
+		gchar *l = actions[i + 1];
+
+		if (l == NULL)
+		{
+			g_warning("Label not found for action %s. "
+					  "The protocol specifies that a label must "
+					  "follow an action in the actions array", actions[i]);
+
+			break;
+		}
+
+		if (strcasecmp(actions[i], "default"))
+		{
+			theme_add_notification_action(nw, l, actions[i],
+										  G_CALLBACK(_action_invoked_cb));
+		}
+	}
+
+	/* check for icon_data if icon == "" */
+	if (*icon == '\0')
+	{
+		data = (GValue *)g_hash_table_lookup(hints, "icon_data");
+
+		if (data)
+			_notify_daemon_process_icon_data(daemon, nw, data);
+	}
+	else
+	{
+		GdkPixbuf *pixbuf = NULL;
+
+		if (!strncmp(icon, "file://", 7) || *icon == '/')
+		{
+			if (!strncmp(icon, "file://", 7))
+				icon += 7;
+
+			/* Load file */
+			pixbuf = gdk_pixbuf_new_from_file(icon, NULL);
+		}
+		else
+		{
+			/* Load icon theme icon */
+			GtkIconTheme *theme = gtk_icon_theme_get_default();
+			GtkIconInfo *icon_info =
+				gtk_icon_theme_lookup_icon(theme, icon, IMAGE_SIZE,
+										   GTK_ICON_LOOKUP_USE_BUILTIN);
+
+			if (icon_info != NULL)
+			{
+				pixbuf = gtk_icon_theme_load_icon(
+					theme, icon,
+					MIN(IMAGE_SIZE, gtk_icon_info_get_base_size(icon_info)),
+					GTK_ICON_LOOKUP_USE_BUILTIN, NULL);
+
+				gtk_icon_info_free(icon_info);
+			}
+
+			if (pixbuf == NULL)
+			{
+				/* Well... maybe this is a file afterall. */
+				pixbuf = gdk_pixbuf_new_from_file(icon, NULL);
+			}
+		}
+
+		if (pixbuf != NULL)
+		{
+			theme_set_notification_icon(nw, pixbuf);
+			g_object_unref(G_OBJECT(pixbuf));
+		}
+	}
+
+	if (use_pos_data)
+	{
+		/*
+		 * Typically, the theme engine will set its own position based on
+		 * the arrow X, Y hints. However, in case, move the notification to
+		 * that position.
+		 */
+		theme_set_notification_arrow(nw, TRUE, x, y);
+		theme_move_notification(nw, x, y);
+	}
+	else
+	{
+		theme_set_notification_arrow(nw, FALSE, 0, 0);
+		_notify_daemon_add_bubble_to_poptart_stack(daemon, nw,
+												   new_notification);
+	}
+
+	if (!screensaver_active(GTK_WIDGET(nw)) &&
+		!fullscreen_window_exists(GTK_WIDGET(nw)))
+	{
+		theme_show_notification(nw);
+	}
+
+	return_id = (id == 0 ? _store_notification(daemon, nw, timeout) : id);
+
+#if CHECK_DBUS_VERSION(0, 60)
+	sender = dbus_g_method_get_sender(context);
+#else
+	sender = g_strdup(dbus_message_get_sender(
+		dbus_g_message_get_message(context->message)));
+#endif
+
+	g_object_set_data(G_OBJECT(nw), "_notify_id",
+					  GUINT_TO_POINTER(return_id));
+	g_object_set_data_full(G_OBJECT(nw), "_notify_sender", sender,
+						   (GDestroyNotify)g_free);
+
+	if (nt)
+		_calculate_timeout(daemon, nt, timeout);
+
+	dbus_g_method_return(context, return_id);
+
+	return TRUE;
+}
+
+gboolean
+notify_daemon_close_notification_handler(NotifyDaemon *daemon,
+										 guint id, GError ** error)
+{
+	_close_notification(daemon, id, TRUE);
+
+	return TRUE;
+}
+
+gboolean
+notify_daemon_get_capabilities(NotifyDaemon *daemon, char ***caps)
+{
+	*caps = g_new0(char *, 6);
+
+	(*caps)[0] = g_strdup("actions");
+	(*caps)[1] = g_strdup("body");
+	(*caps)[2] = g_strdup("body-hyperlinks");
+	(*caps)[3] = g_strdup("body-markup");
+	(*caps)[4] = g_strdup("icon-static");
+	(*caps)[5] = NULL;
+
+	return TRUE;
+}
+
+gboolean
+notify_daemon_get_server_information(NotifyDaemon *daemon,
+									 char **out_name,
+									 char **out_vendor,
+									 char **out_version,
+									 char **out_spec_ver)
+{
+	*out_name     = g_strdup("Notification Daemon");
+	*out_vendor   = g_strdup("Galago Project");
+	*out_version  = g_strdup(VERSION);
+	*out_spec_ver = g_strdup("0.9");
+
+	return TRUE;
+}
+
+int
+main(int argc, char **argv)
+{
+	NotifyDaemon *daemon;
+	DBusGConnection *connection;
+	DBusGProxy *bus_proxy;
+	GError *error;
+	guint request_name_result;
+
+	g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);
+
+	gtk_init(&argc, &argv);
+
+	error = NULL;
+	connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
+
+	if (connection == NULL)
+	{
+		g_printerr("Failed to open connection to bus: %s\n",
+				   error->message);
+		g_error_free(error);
+		exit(1);
+	}
+
+	dbus_g_object_type_install_info(NOTIFY_TYPE_DAEMON,
+									&dbus_glib__object_info);
+
+	bus_proxy = dbus_g_proxy_new_for_name(connection,
+										  "org.freedesktop.DBus",
+										  "/org/freedesktop/DBus",
+										  "org.freedesktop.DBus");
+
+	if (!dbus_g_proxy_call(bus_proxy, "RequestName", &error,
+						   G_TYPE_STRING, "org.freedesktop.Notifications",
+						   G_TYPE_UINT, 0,
+						   G_TYPE_INVALID,
+						   G_TYPE_UINT, &request_name_result,
+						   G_TYPE_INVALID))
+	{
+		g_error("Could not aquire name: %s", error->message);
+	}
+
+	daemon = notify_daemon_new();
+
+	dbus_g_connection_register_g_object(connection,
+										"/org/freedesktop/Notifications",
+										G_OBJECT(daemon));
+
+	gtk_main();
+
+	return 0;
+}


Property changes on: notification-daemon-xfce/trunk/src/daemon.c
___________________________________________________________________
Name: svn:keywords
   + Id

Added: notification-daemon-xfce/trunk/src/daemon.h
===================================================================
--- notification-daemon-xfce/trunk/src/daemon.h	                        (rev 0)
+++ notification-daemon-xfce/trunk/src/daemon.h	2006-09-06 11:35:36 UTC (rev 1977)
@@ -0,0 +1,99 @@
+/* $Id$
+ *
+ * Copyright (C) 2006 Christian Hammond <chipx86 at chipx86.com>
+ * Copyright (C) 2005 John (J5) Palmieri <johnp at redhat.com>
+ *
+ * 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, 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-1307, USA.
+ */
+
+#ifndef NOTIFY_DAEMON_H
+#define NOTIFY_DAEMON_H
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include <dbus/dbus-glib.h>
+#include <dbus/dbus-glib-lowlevel.h>
+
+G_BEGIN_DECLS
+
+#define NOTIFY_TYPE_DAEMON (notify_daemon_get_type())
+#define NOTIFY_DAEMON(obj) \
+	(G_TYPE_CHECK_INSTANCE_CAST ((obj), NOTIFY_TYPE_DAEMON, NotifyDaemon))
+#define NOTIFY_DAEMON_CLASS(klass) \
+	(G_TYPE_CHECK_CLASS_CAST ((klass), NOTIFY_TYPE_DAEMON, NotifyDaemonClass))
+#define NOTIFY_IS_DAEMON(obj) \
+	(G_TYPE_CHECK_INSTANCE_TYPE ((obj), NOTIFY_TYPE_DAEMON))
+#define NOTIFY_IS_DAEMON_CLASS(klass) \
+	(G_TYPE_CHECK_CLASS_TYPE ((klass), NOTIFY_TYPE_DAEMON))
+#define NOTIFY_DAEMON_GET_CLASS(obj) \
+	(G_TYPE_INSTANCE_GET_CLASS((obj), NOTIFY_TYPE_DAEMON, NotifyDaemonClass))
+
+#define NOTIFY_DAEMON_DEFAULT_TIMEOUT 7000
+
+typedef struct _NotifyDaemon        NotifyDaemon;
+typedef struct _NotifyDaemonClass   NotifyDaemonClass;
+typedef struct _NotifyDaemonPrivate NotifyDaemonPrivate;
+
+struct _NotifyDaemon
+{
+	GObject parent;
+
+	/*< private > */
+	NotifyDaemonPrivate *priv;
+};
+
+struct _NotifyDaemonClass
+{
+	GObjectClass parent_class;
+};
+
+enum _NotifyDaemonError
+{
+	NOTIFY_DAEMON_ERROR_GENERIC = 0,
+};
+
+GType notify_daemon_get_type(void);
+
+NotifyDaemon *notify_daemon_new(void)
+	G_GNUC_MALLOC;
+
+gboolean notify_daemon_notify_handler(NotifyDaemon *daemon,
+									  const gchar *app_name,
+									  guint id,
+									  const gchar *icon,
+									  const gchar *summary,
+									  const gchar *body,
+									  gchar **actions,
+									  GHashTable *hints,
+									  int timeout,
+									  DBusGMethodInvocation *context);
+
+gboolean notify_daemon_close_notification_handler(NotifyDaemon *daemon,
+												  guint id, GError **error);
+
+gboolean notify_daemon_get_capabilities(NotifyDaemon *daemon,
+										char ***out_caps);
+
+gboolean notify_daemon_get_server_information(NotifyDaemon *daemon,
+											  char **out_name,
+											  char **out_vendor,
+											  char **out_version,
+											  char **out_spec_ver);
+
+G_END_DECLS
+
+#endif /* NOTIFY_DAEMON_H */


Property changes on: notification-daemon-xfce/trunk/src/daemon.h
___________________________________________________________________
Name: svn:keywords
   + Id

Added: notification-daemon-xfce/trunk/src/engines.c
===================================================================
--- notification-daemon-xfce/trunk/src/engines.c	                        (rev 0)
+++ notification-daemon-xfce/trunk/src/engines.c	2006-09-06 11:35:36 UTC (rev 1977)
@@ -0,0 +1,307 @@
+/* $Id$
+ *
+ * Copyright (C) 2006 Christian Hammond <chipx86 at chipx86.com>
+ * Copyright (C) 2005 John (J5) Palmieri <johnp at redhat.com>
+ * Copyright (C) 2006 Nick Schermer <nick at xfce.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, 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-1307, USA.
+ */
+
+#include "config.h"
+
+#include <libxfce4util/libxfce4util.h>
+#include "daemon.h"
+#include "engines.h"
+
+typedef struct
+{
+	GModule *module;
+	guint ref_count;
+
+	gboolean (*theme_check_init)(unsigned int major_ver,
+								 unsigned int minor_ver,
+								 unsigned int micro_ver);
+	void (*get_theme_info)(char **theme_name, char **theme_ver,
+						   char **author, char **homepage);
+	GtkWindow *(*create_notification)(UrlClickedCb url_clicked_cb);
+	void (*destroy_notification)(GtkWindow *nw);
+	void (*show_notification)(GtkWindow *nw);
+	void (*hide_notification)(GtkWindow *nw);
+	void (*set_notification_hints)(GtkWindow *nw, GHashTable *hints);
+	void (*set_notification_text)(GtkWindow *nw, const char *summary,
+								  const char *body);
+	void (*set_notification_icon)(GtkWindow *nw, GdkPixbuf *pixbuf);
+	void (*set_notification_arrow)(GtkWindow *nw, gboolean visible,
+								   int x, int y);
+	void (*add_notification_action)(GtkWindow *nw, const char *label,
+									const char *key, GCallback cb);
+	void (*clear_notification_actions)(GtkWindow *nw);
+	void (*move_notification)(GtkWindow *nw, int x, int y);
+	void (*set_notification_timeout)(GtkWindow *nw, glong timeout);
+	void (*notification_tick)(GtkWindow *nw, glong timeout);
+
+} ThemeEngine;
+
+static ThemeEngine *active_engine = NULL;
+
+static ThemeEngine *
+load_theme_engine(const char *name)
+{
+	ThemeEngine *engine;
+	char *filename;
+	char *path;
+
+	filename = g_strdup_printf("lib%s.so", name);
+	path = g_build_filename(ENGINES_DIR, filename, NULL);
+	g_free(filename);
+
+	engine = g_new0(ThemeEngine, 1);
+	engine->ref_count = 1;
+	engine->module = g_module_open(path, G_MODULE_BIND_LAZY);
+
+	g_free(path);
+
+	if (engine->module == NULL)
+		goto error;
+
+#define BIND_REQUIRED_FUNC(name) \
+	if (!g_module_symbol(engine->module, #name, (gpointer *)&engine->name)) \
+	{ \
+		/* Too harsh! Fall back to default. */ \
+		g_error("Theme doesn't provide the required function '%s'", #name); \
+		goto error; \
+	}
+
+#define BIND_OPTIONAL_FUNC(name) \
+	g_module_symbol(engine->module, #name, (gpointer *)&engine->name);
+
+	BIND_REQUIRED_FUNC(theme_check_init);
+	BIND_REQUIRED_FUNC(get_theme_info);
+	BIND_REQUIRED_FUNC(create_notification);
+	BIND_REQUIRED_FUNC(set_notification_text);
+	BIND_REQUIRED_FUNC(set_notification_icon);
+	BIND_REQUIRED_FUNC(set_notification_arrow);
+	BIND_REQUIRED_FUNC(add_notification_action);
+	BIND_REQUIRED_FUNC(clear_notification_actions);
+	BIND_REQUIRED_FUNC(move_notification);
+
+	BIND_OPTIONAL_FUNC(destroy_notification);
+	BIND_OPTIONAL_FUNC(show_notification);
+	BIND_OPTIONAL_FUNC(hide_notification);
+	BIND_OPTIONAL_FUNC(set_notification_timeout);
+	BIND_OPTIONAL_FUNC(set_notification_hints);
+	BIND_OPTIONAL_FUNC(notification_tick);
+
+	if (!engine->theme_check_init(NOTIFICATION_DAEMON_MAJOR_VERSION,
+								  NOTIFICATION_DAEMON_MINOR_VERSION,
+								  NOTIFICATION_DAEMON_MICRO_VERSION))
+	{
+		g_error("Theme doesn't work with this version of notification-daemon");
+		goto error;
+	}
+
+	return engine;
+
+error:
+	if (engine->module != NULL && !g_module_close(engine->module))
+		g_warning("%s: %s", filename, g_module_error());
+
+	g_free(engine);
+	return NULL;
+}
+
+static void
+destroy_engine(ThemeEngine *engine)
+{
+	g_assert(engine->ref_count == 0);
+
+	if (active_engine == engine)
+		active_engine = NULL;
+
+	g_module_close(engine->module);
+	g_free(engine);
+}
+
+static ThemeEngine *
+get_theme_engine(void)
+{
+	if (active_engine == NULL)
+	{
+	        gchar *enginename;
+		const gchar *value;
+		gchar *file;
+	        XfceRc *rc;
+
+	        file = xfce_resource_save_location (XFCE_RESOURCE_CONFIG, "xfce4/notify/notify.rc", TRUE);
+
+		if (file)
+		{
+		    rc = xfce_rc_simple_open (file, FALSE);
+		    g_free (file);
+
+		    value = xfce_rc_read_entry (rc, "engine_name", "standard");
+		    enginename = g_strdup (value);
+
+		    xfce_rc_close (rc);
+		}
+
+		if (enginename == NULL)
+		{
+			active_engine = load_theme_engine("standard");
+			g_assert(active_engine != NULL);
+		}
+		else
+		{
+			active_engine = load_theme_engine(enginename);
+
+			if (active_engine == NULL)
+			{
+				g_warning("Unable to load theme engine '%s'", enginename);
+				active_engine = load_theme_engine("standard");
+			}
+
+			g_free(enginename);
+
+			g_assert(active_engine != NULL);
+		}
+	}
+
+	return active_engine;
+}
+
+static void
+theme_engine_unref(ThemeEngine *engine)
+{
+	engine->ref_count--;
+
+	if (engine->ref_count == 0)
+		destroy_engine(engine);
+}
+
+GtkWindow *
+theme_create_notification(UrlClickedCb url_clicked_cb)
+{
+	ThemeEngine *engine = get_theme_engine();
+	GtkWindow *nw = engine->create_notification(url_clicked_cb);
+	g_object_set_data_full(G_OBJECT(nw), "_theme_engine", engine,
+						   (GDestroyNotify)theme_engine_unref);
+	engine->ref_count++;
+	return nw;
+}
+
+void
+theme_destroy_notification(GtkWindow *nw)
+{
+	ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
+
+	if (engine->destroy_notification != NULL)
+		engine->destroy_notification(nw);
+	else
+		gtk_widget_destroy(GTK_WIDGET(nw));
+}
+
+void
+theme_show_notification(GtkWindow *nw)
+{
+	ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
+
+	if (engine->show_notification != NULL)
+		engine->show_notification(nw);
+	else
+		gtk_widget_show(GTK_WIDGET(nw));
+}
+
+void
+theme_hide_notification(GtkWindow *nw)
+{
+	ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
+
+	if (engine->hide_notification != NULL)
+		engine->hide_notification(nw);
+	else
+		gtk_widget_hide(GTK_WIDGET(nw));
+}
+
+void
+theme_set_notification_hints(GtkWindow *nw, GHashTable *hints)
+{
+	ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
+
+	if (engine->set_notification_hints != NULL)
+		engine->set_notification_hints(nw, hints);
+}
+
+void
+theme_set_notification_timeout(GtkWindow *nw, glong timeout)
+{
+	ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
+
+	if (engine->set_notification_timeout != NULL)
+		engine->set_notification_timeout(nw, timeout);
+}
+
+void
+theme_notification_tick(GtkWindow *nw, glong remaining)
+{
+	ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
+
+	if (engine->notification_tick != NULL)
+		engine->notification_tick(nw, remaining);
+}
+
+void
+theme_set_notification_text(GtkWindow *nw, const char *summary,
+							const char *body)
+{
+	ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
+	engine->set_notification_text(nw, summary, body);
+}
+
+void
+theme_set_notification_icon(GtkWindow *nw, GdkPixbuf *pixbuf)
+{
+	ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
+	engine->set_notification_icon(nw, pixbuf);
+}
+
+void
+theme_set_notification_arrow(GtkWindow *nw, gboolean visible, int x, int y)
+{
+	ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
+	engine->set_notification_arrow(nw, visible, x, y);
+}
+
+void
+theme_add_notification_action(GtkWindow *nw, const char *label,
+							  const char *key, GCallback cb)
+{
+	ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
+	engine->add_notification_action(nw, label, key, cb);
+}
+
+void
+theme_clear_notification_actions(GtkWindow *nw)
+{
+	ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
+	engine->clear_notification_actions(nw);
+}
+
+void
+theme_move_notification(GtkWindow *nw, int x, int y)
+{
+	ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
+	engine->move_notification(nw, x, y);
+}


Property changes on: notification-daemon-xfce/trunk/src/engines.c
___________________________________________________________________
Name: svn:keywords
   + Id

Added: notification-daemon-xfce/trunk/src/engines.h
===================================================================
--- notification-daemon-xfce/trunk/src/engines.h	                        (rev 0)
+++ notification-daemon-xfce/trunk/src/engines.h	2006-09-06 11:35:36 UTC (rev 1977)
@@ -0,0 +1,46 @@
+/* $Id$
+ *
+ * Copyright (C) 2006 Christian Hammond <chipx86 at chipx86.com>
+ * Copyright (C) 2005 John (J5) Palmieri <johnp at redhat.com>
+ *
+ * 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, 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-1307, USA.
+ */
+
+#ifndef _ENGINES_H_
+#define _ENGINES_H_
+
+#include <gtk/gtk.h>
+
+typedef void (*UrlClickedCb)(GtkWindow *nw, const char *url);
+
+GtkWindow *theme_create_notification(UrlClickedCb url_clicked_cb);
+void theme_destroy_notification(GtkWindow *nw);
+void theme_show_notification(GtkWindow *nw);
+void theme_hide_notification(GtkWindow *nw);
+void theme_set_notification_hints(GtkWindow *nw, GHashTable *hints);
+void theme_set_notification_timeout(GtkWindow *nw, glong timeout);
+void theme_notification_tick(GtkWindow *nw, glong remaining);
+void theme_set_notification_text(GtkWindow *nw, const char *summary,
+								 const char *body);
+void theme_set_notification_icon(GtkWindow *nw, GdkPixbuf *pixbuf);
+void theme_set_notification_arrow(GtkWindow *nw, gboolean visible,
+								  int x, int y);
+void theme_add_notification_action(GtkWindow *nw, const char *label,
+								   const char *key, GCallback cb);
+void theme_clear_notification_actions(GtkWindow *nw);
+void theme_move_notification(GtkWindow *nw, int x, int y);
+
+#endif /* _ENGINES_H_ */


Property changes on: notification-daemon-xfce/trunk/src/engines.h
___________________________________________________________________
Name: svn:keywords
   + Id

Added: notification-daemon-xfce/trunk/src/notificationdaemon.xml
===================================================================
--- notification-daemon-xfce/trunk/src/notificationdaemon.xml	                        (rev 0)
+++ notification-daemon-xfce/trunk/src/notificationdaemon.xml	2006-09-06 11:35:36 UTC (rev 1977)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<node name="/org/freedesktop/Notifications">
+
+  <interface name="org.freedesktop.Notifications">
+    <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="NotifyDaemon"/>
+    <method name="Notify">
+      <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="notify_daemon_notify_handler"/>
+      <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+      <arg type="s" name="app_name" direction="in" />
+      <arg type="u" name="id" direction="in" />
+      <arg type="s" name="icon" direction="in" />
+      <arg type="s" name="summary" direction="in" />
+      <arg type="s" name="body" direction="in" />
+      <arg type="as" name="actions" direction="in" />
+      <arg type="a{sv}" name="hints" direction="in" />
+      <arg type="i" name="timeout" direction="in" />
+      <arg type="u" name="return_id" direction="out" />
+    </method>
+
+    <method name="CloseNotification">
+      <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="notify_daemon_close_notification_handler"/>
+      <arg type="u" name="id" direction="in" />
+    </method>
+
+    <method name="GetCapabilities">
+      <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="notify_daemon_get_capabilities"/>
+      <arg type="as" name="return_caps" direction="out"/>
+    </method>
+
+    <method name="GetServerInformation">
+      <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="notify_daemon_get_server_information"/>
+      <arg type="s" name="return_name" direction="out"/>
+      <arg type="s" name="return_vendor" direction="out"/>
+      <arg type="s" name="return_version" direction="out"/>
+      <arg type="s" name="return_spec_version" direction="out"/>
+    </method>
+
+  </interface>
+</node>

Added: notification-daemon-xfce/trunk/themes/Makefile.am
===================================================================
--- notification-daemon-xfce/trunk/themes/Makefile.am	                        (rev 0)
+++ notification-daemon-xfce/trunk/themes/Makefile.am	2006-09-06 11:35:36 UTC (rev 1977)
@@ -0,0 +1,8 @@
+# $Id$
+
+SUBDIRS = 								\
+	standard
+
+DIST_SUBDIRS = 								\
+	$(SUBDIRS)							\
+	bubble


Property changes on: notification-daemon-xfce/trunk/themes/Makefile.am
___________________________________________________________________
Name: svn:keywords
   + Id

Added: notification-daemon-xfce/trunk/themes/bubble/Makefile.am
===================================================================
--- notification-daemon-xfce/trunk/themes/bubble/Makefile.am	                        (rev 0)
+++ notification-daemon-xfce/trunk/themes/bubble/Makefile.am	2006-09-06 11:35:36 UTC (rev 1977)
@@ -0,0 +1,20 @@
+# $Id$
+
+enginedir = $(libdir)/notification-daemon-1.0/engines
+
+engine_LTLIBRARIES = 							\
+	libbubble.la
+
+noinst_HEADERS = 							\
+	eggnotificationbubblewidget.h
+
+libbubble_la_SOURCES = 							\
+	eggnotificationbubblewidget.c 					\
+	theme.c
+
+libbubble_la_LDFLAGS = 							\
+	-module								\
+	-avoid-version
+
+INCLUDES =								\
+	$(GTK_CFLAGS)


Property changes on: notification-daemon-xfce/trunk/themes/bubble/Makefile.am
___________________________________________________________________
Name: svn:keywords
   + Id

Added: notification-daemon-xfce/trunk/themes/bubble/eggnotificationbubblewidget.c
===================================================================
--- notification-daemon-xfce/trunk/themes/bubble/eggnotificationbubblewidget.c	                        (rev 0)
+++ notification-daemon-xfce/trunk/themes/bubble/eggnotificationbubblewidget.c	2006-09-06 11:35:36 UTC (rev 1977)
@@ -0,0 +1,1214 @@
+/* $Id$
+ *
+ * Copyright (C) 2005 Colin Walters <walters at verbum.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <math.h>
+
+#include <gtk/gtk.h>
+#include "eggnotificationbubblewidget.h"
+
+#define BORDER_SIZE 30
+#define BORDER_LINE_WIDTH 2
+#define CURVE_LENGTH 25
+#define TRIANGLE_START 45
+#define TRIANGLE_WIDTH 60
+#define TEXT_WIDTH_THRESHOLD 100
+
+
+static void egg_notification_bubble_widget_class_init        (EggNotificationBubbleWidgetClass *klass);
+static void egg_notification_bubble_widget_init              (EggNotificationBubbleWidget      *bubble_widget);
+static void egg_notification_bubble_widget_finalize          (GObject        *object);
+static void egg_notification_bubble_widget_event_handler     (GtkWidget   *widget,
+                                                              GdkEvent    *event,
+                                                              gpointer     user_data);
+static gboolean egg_notification_bubble_widget_expose        (GtkWidget *widget,
+                                                              GdkEventExpose *event);
+
+static gboolean egg_notification_bubble_widget_body_label_expose_handler (GtkWidget *widget,
+                                                                          GdkEventExpose *event,
+                                                                          EggNotificationBubbleWidget *bw);
+
+static void egg_notification_bubble_widget_context_changed_handler (EggNotificationBubbleWidget      *bubble_widget);
+
+static void egg_notification_bubble_widget_realize           (GtkWidget *widget);
+
+static void egg_notification_bubble_widget_screen_changed    (GtkWidget *widget,
+                                                              GdkScreen *old_screen);
+
+static void _populate_window (EggNotificationBubbleWidget *bubble_widget);
+static void draw_bubble_widget (EggNotificationBubbleWidget *bubble_widget);
+static void _stencil_bubble (EggNotificationBubbleWidget *bw);
+
+
+static GtkWindowClass *parent_class;
+
+#define BEVEL_ALPHA_LIGHT  0.2
+#define BEVEL_ALPHA_MEDIUM 0.5
+#define BEVEL_ALPHA_DARK   0.8
+
+enum
+{
+  DRAW_MOVE  = 0,
+  DRAW_LINE  = 1,
+  DRAW_CAP   = 2,
+  DRAW_CLOSE = 3
+};
+
+typedef struct _DrawingInstruction
+{
+  gint type;
+
+  gint end_x, end_y;
+  gint corner_x, corner_y;
+} DrawingInstruction;
+
+enum
+{
+    ORIENT_TOP    = 0,
+    ORIENT_BOTTOM = 1,
+    ORIENT_LEFT   = 2,
+    ORIENT_RIGHT  = 3
+};
+
+enum {
+    TRIANGLE_LEFT = 0,
+    TRIANGLE_RIGHT = 1
+};
+
+enum
+{
+	NOTIFICATION_CLICKED,
+	LAST_SIGNAL
+};
+
+static guint egg_notification_bubble_widget_signals[LAST_SIGNAL] = { 0 };
+
+GType
+egg_notification_bubble_widget_get_type (void)
+{
+  static GType bubble_widget_type = 0;
+
+  if (!bubble_widget_type)
+    {
+      static const GTypeInfo bubble_widget_info =
+      {
+	sizeof (EggNotificationBubbleWidgetClass),
+	NULL,		/* base_init */
+	NULL,		/* base_finalize */
+	(GClassInitFunc) egg_notification_bubble_widget_class_init,
+	NULL,		/* class_finalize */
+	NULL,		/* class_data */
+	sizeof (EggNotificationBubbleWidget),
+	0,		/* n_preallocs */
+	(GInstanceInitFunc) egg_notification_bubble_widget_init,
+      };
+
+      bubble_widget_type = g_type_register_static (GTK_TYPE_WINDOW, "EggNotificationBubbleWidget",
+					      &bubble_widget_info, 0);
+    }
+
+  return bubble_widget_type;
+}
+
+static void
+egg_notification_bubble_widget_class_init (EggNotificationBubbleWidgetClass *class)
+{
+  GObjectClass *object_class;
+  GtkWidgetClass *widget_class;
+
+  object_class = (GObjectClass *) class;
+  widget_class = (GtkWidgetClass *) class;
+
+  parent_class = g_type_class_peek_parent (class);
+
+  object_class->finalize = egg_notification_bubble_widget_finalize;
+  widget_class->expose_event = egg_notification_bubble_widget_expose;
+  widget_class->realize = egg_notification_bubble_widget_realize;
+  widget_class->screen_changed = egg_notification_bubble_widget_screen_changed;
+
+  egg_notification_bubble_widget_signals[NOTIFICATION_CLICKED] =
+    g_signal_new ("clicked",
+		  EGG_TYPE_NOTIFICATION_BUBBLE_WIDGET,
+		  G_SIGNAL_RUN_LAST,
+		  G_STRUCT_OFFSET (EggNotificationBubbleWidgetClass, clicked),
+		  NULL, NULL,
+		  g_cclosure_marshal_VOID__VOID,
+		  G_TYPE_NONE,
+		  0);
+}
+
+static void
+egg_notification_bubble_widget_init (EggNotificationBubbleWidget *bubble_widget)
+{
+  GtkWindow *win;
+
+  win = GTK_WINDOW (bubble_widget);
+
+  bubble_widget->can_composite = FALSE;
+
+  egg_notification_bubble_widget_screen_changed (GTK_WIDGET (bubble_widget),
+                                                 NULL);
+
+  bubble_widget->dp.is_clear = TRUE;
+  bubble_widget->dp.pipeline = NULL;
+  bubble_widget->draw_arrow = FALSE;
+
+  _populate_window (bubble_widget);
+
+}
+
+static void
+egg_notification_bubble_widget_finalize (GObject *object)
+{
+  EggNotificationBubbleWidget *bubble_widget = EGG_NOTIFICATION_BUBBLE_WIDGET (object);
+
+  g_return_if_fail (bubble_widget != NULL);
+
+  if (G_OBJECT_CLASS (parent_class)->finalize)
+    G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+static void
+_layout_window (EggNotificationBubbleWidget *bubble_widget,
+                int alignment)
+{
+  if (bubble_widget->draw_arrow)
+    gtk_container_set_border_width (GTK_CONTAINER (bubble_widget), BORDER_SIZE + 5);
+  else
+    gtk_container_set_border_width (GTK_CONTAINER (bubble_widget), 10);
+
+  if (gtk_widget_get_parent (bubble_widget->icon))
+    gtk_container_remove (GTK_CONTAINER (bubble_widget->table),
+                          bubble_widget->icon);
+
+  if (gtk_widget_get_parent (bubble_widget->bubble_widget_header_label))
+    gtk_container_remove (GTK_CONTAINER (bubble_widget->table),
+                          bubble_widget->bubble_widget_header_label);
+
+  if (gtk_widget_get_parent (bubble_widget->bubble_widget_body_label))
+    gtk_container_remove (GTK_CONTAINER (bubble_widget->table),
+                          bubble_widget->bubble_widget_body_label);
+
+  if (bubble_widget->button_hbox != NULL &&
+        gtk_widget_get_parent (bubble_widget->button_hbox) != NULL)
+    gtk_container_remove (GTK_CONTAINER (bubble_widget->table),
+                        bubble_widget->button_hbox);
+
+  if (alignment == TRIANGLE_LEFT)
+    {
+      gtk_table_attach (GTK_TABLE (bubble_widget->table),
+                        bubble_widget->icon,
+                        0, 1, 1, 2,
+                        GTK_FILL, GTK_FILL,
+                        0, 0);
+
+      gtk_table_attach (GTK_TABLE (bubble_widget->table),
+                        bubble_widget->bubble_widget_header_label,
+                        1, 2, 0, 1,
+                        GTK_FILL, GTK_FILL,
+                        0, 0);
+
+      gtk_table_attach (GTK_TABLE (bubble_widget->table),
+                        bubble_widget->bubble_widget_body_label,
+                        1, 2, 1, 2,
+                        GTK_FILL, GTK_FILL,
+                        0, 0);
+    }
+  else
+    {
+      gtk_table_attach (GTK_TABLE (bubble_widget->table),
+                        bubble_widget->icon,
+                        1, 2, 1, 2,
+                        GTK_FILL, GTK_FILL,
+                        0, 0);
+
+      gtk_table_attach (GTK_TABLE (bubble_widget->table),
+                        bubble_widget->bubble_widget_header_label,
+                        0, 1, 0, 1,
+                        GTK_FILL, GTK_FILL,
+                        0, 0);
+
+      gtk_table_attach (GTK_TABLE (bubble_widget->table),
+                        bubble_widget->bubble_widget_body_label,
+                        0, 1, 1, 2,
+                        GTK_FILL, GTK_FILL,
+                        0, 0);
+
+    }
+
+    if (bubble_widget->button_hbox != NULL)
+      {
+        GtkWidget *alignment = gtk_alignment_new(1.0, 0.5, 0, 0);
+        gtk_widget_show(alignment);
+        gtk_table_attach (GTK_TABLE (bubble_widget->table),
+                          alignment,
+                          0, 2, 2, 3,
+                          GTK_FILL, GTK_FILL,
+                          0, 0);
+
+        gtk_container_add(GTK_CONTAINER(alignment), bubble_widget->button_hbox);
+      }
+
+    gtk_widget_show_all (bubble_widget->table);
+}
+
+static void
+_drawing_instruction_internal_add (GList **pipeline,
+                                   guint type,
+                                   gint end_x, gint end_y,
+                                   gint corner_x, gint corner_y)
+{
+  DrawingInstruction *di;
+
+  di = g_new0 (DrawingInstruction, 1);
+  di->type = type;
+  di->end_x = end_x;
+  di->end_y = end_y;
+  di->corner_x = corner_x;
+  di->corner_y = corner_y;
+
+  *pipeline = g_list_append (*pipeline, di);
+}
+
+static void
+_drawing_instruction_move (GList **pipeline,
+                           gint x, gint y)
+{
+  _drawing_instruction_internal_add (pipeline, DRAW_MOVE, x, y, 0, 0);
+}
+
+static void
+_drawing_instruction_line (GList **pipeline,
+                           gint x, gint y)
+{
+  _drawing_instruction_internal_add (pipeline, DRAW_LINE, x, y, 0, 0);
+}
+
+static void
+_drawing_instruction_cap  (GList **pipeline,
+                           gint x, gint y,
+                           gint corner_x, gint corner_y)
+{
+  _drawing_instruction_internal_add (pipeline, DRAW_CAP, x, y, corner_x, corner_y);
+}
+
+static void
+_drawing_instruction_close  (GList **pipeline)
+{
+  _drawing_instruction_internal_add (pipeline, DRAW_CLOSE, 0, 0, 0, 0);
+}
+
+/* given a distance from start point x1, y1
+   calculate the point dist units away */
+static GdkPoint
+_calc_point_on_line (x1, y1, x2, y2, dist)
+{
+  GdkPoint result;
+  gint dx, dy;
+  gdouble d, vx, vy;
+
+  dx = x2 - x1;
+  dy = y2 - y1;
+
+  d = sqrt (dx * dx + dy * dy);
+  vx = dx / d;
+  vy = dy / d;
+
+  result.x = x1 + dist * vx;
+  result.y = y1 + dist * vy;
+
+  return result;
+}
+
+static void
+_edge_line_to (EggNotificationBubbleWidget *bw,
+               gint x, gint y,
+               gint corner_radius)
+{
+  if (bw->dp.is_clear == TRUE)
+    {
+      bw->dp.start_x = x;
+      bw->dp.start_y = y;
+      bw->dp.start_corner_radius = corner_radius;
+      bw->dp.is_clear = FALSE;
+    }
+  else
+    {
+      GdkPoint start_p;
+      GdkPoint end_p;
+
+      start_p = _calc_point_on_line (bw->dp.last_x,
+                                     bw->dp.last_y,
+                                     x,
+                                     y,
+                                     bw->dp.last_corner_radius);
+      end_p = _calc_point_on_line (x,
+                                   y,
+                                   bw->dp.last_x,
+                                   bw->dp.last_y,
+                                   corner_radius);
+
+      if (bw->dp.last_x == bw->dp.start_x &&
+          bw->dp.last_y == bw->dp.start_y)
+        _drawing_instruction_move (&bw->dp.pipeline, start_p.x, start_p.y);
+      else
+        _drawing_instruction_cap (&bw->dp.pipeline,
+                                  start_p.x,
+                                  start_p.y,
+                                  bw->dp.last_x,
+                                  bw->dp.last_y);
+
+      _drawing_instruction_line (&bw->dp.pipeline, end_p.x, end_p.y);
+
+    }
+
+  bw->dp.last_x = x;
+  bw->dp.last_y = y;
+  bw->dp.last_corner_radius = corner_radius;
+}
+
+static void
+_close_path (EggNotificationBubbleWidget *bw)
+{
+  GdkPoint start_p;
+  GdkPoint end_p;
+  DrawingInstruction *di;
+
+  start_p = _calc_point_on_line (bw->dp.last_x,
+                                 bw->dp.last_y,
+                                 bw->dp.start_x,
+                                 bw->dp.start_y,
+                                 bw->dp.last_corner_radius);
+
+  end_p = _calc_point_on_line (bw->dp.start_x,
+                               bw->dp.start_y,
+                               bw->dp.last_x,
+                               bw->dp.last_y,
+                               bw->dp.start_corner_radius);
+
+
+  _drawing_instruction_cap (&bw->dp.pipeline,
+                             start_p.x,
+                             start_p.y,
+                             bw->dp.last_x,
+                             bw->dp.last_y);
+
+  _drawing_instruction_line (&bw->dp.pipeline,
+                             end_p.x,
+                             end_p.y);
+
+  di = (DrawingInstruction *) bw->dp.pipeline->data;
+  _drawing_instruction_cap (&bw->dp.pipeline,
+                             di->end_x,
+                             di->end_y,
+                             bw->dp.start_x,
+                             bw->dp.start_y);
+
+  _drawing_instruction_close (&bw->dp.pipeline);
+
+}
+
+static void
+_drawing_instruction_draw (DrawingInstruction *di, cairo_t *cr)
+{
+  switch (di->type)
+    {
+      case DRAW_MOVE:
+        cairo_move_to (cr, di->end_x, di->end_y);
+        break;
+      case DRAW_LINE:
+        cairo_line_to (cr, di->end_x, di->end_y);
+      break;
+      case DRAW_CAP:
+        cairo_curve_to (cr,
+                        di->corner_x, di->corner_y,
+                        di->corner_x, di->corner_y,
+                        di->end_x, di->end_y);
+      break;
+      case DRAW_CLOSE:
+        cairo_close_path (cr);
+      break;
+    }
+}
+
+static void
+_drawing_pipeline_clear (EggNotificationBubbleWidget *bw)
+{
+  bw->dp.is_clear = TRUE;
+
+  g_list_foreach (bw->dp.pipeline, (GFunc) g_free, NULL);
+  g_list_free (bw->dp.pipeline);
+  bw->dp.pipeline = NULL;
+}
+
+static void
+_populate_window (EggNotificationBubbleWidget *bubble_widget)
+{
+  GtkWidget *widget;
+
+  g_return_if_fail (EGG_IS_NOTIFICATION_BUBBLE_WIDGET (bubble_widget));
+
+  widget = GTK_WIDGET (bubble_widget);
+
+  gtk_widget_add_events (widget, GDK_BUTTON_RELEASE_MASK);
+  gtk_widget_set_app_paintable (widget, TRUE);
+  gtk_window_set_resizable (GTK_WINDOW (bubble_widget), FALSE);
+
+  bubble_widget->bubble_widget_header_label = gtk_label_new (NULL);
+
+  //use placeholder so we can use pango/cairo to draw body
+  bubble_widget->bubble_widget_body_label = gtk_frame_new("");
+  gtk_frame_set_shadow_type (GTK_FRAME (bubble_widget->bubble_widget_body_label), GTK_SHADOW_NONE);
+  bubble_widget->icon = gtk_image_new_from_stock (GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_BUTTON);
+  gtk_widget_ref (bubble_widget->bubble_widget_header_label);
+  gtk_widget_ref (bubble_widget->bubble_widget_body_label);
+  gtk_widget_ref (bubble_widget->icon);
+
+  gtk_label_set_line_wrap (GTK_LABEL (bubble_widget->bubble_widget_header_label), TRUE);
+  gtk_misc_set_alignment (GTK_MISC (bubble_widget->bubble_widget_header_label), 0.0, 0.0);
+
+  gtk_misc_set_alignment (GTK_MISC (bubble_widget->icon), 0.0, 0.0);
+  gtk_widget_show (bubble_widget->icon);
+  gtk_widget_show (bubble_widget->bubble_widget_header_label);
+  gtk_widget_show (bubble_widget->bubble_widget_body_label);
+
+  bubble_widget->table = gtk_table_new (3, 2, FALSE);
+  gtk_table_set_col_spacings (GTK_TABLE (bubble_widget->table), 5);
+  gtk_table_set_row_spacings (GTK_TABLE (bubble_widget->table), 5);
+
+  gtk_container_add (GTK_CONTAINER (bubble_widget), bubble_widget->table);
+
+  bubble_widget->body_layout = pango_layout_new (
+                                 gtk_widget_get_pango_context (
+                                   GTK_WIDGET (bubble_widget)));
+
+  /* do a fake layout for now so we can calculate
+     height and width */
+  _layout_window (bubble_widget, TRIANGLE_RIGHT);
+
+  g_signal_connect (bubble_widget, "style-set",
+                    G_CALLBACK (egg_notification_bubble_widget_context_changed_handler),
+                    NULL);
+
+  g_signal_connect (bubble_widget, "direction-changed",
+                    G_CALLBACK (egg_notification_bubble_widget_context_changed_handler),
+                    NULL);
+
+  g_signal_connect_after (bubble_widget, "event-after",
+                          G_CALLBACK (egg_notification_bubble_widget_event_handler),
+                          bubble_widget);
+
+  g_signal_connect (bubble_widget->bubble_widget_body_label, "expose-event",
+                    G_CALLBACK (egg_notification_bubble_widget_body_label_expose_handler),
+                    bubble_widget);
+}
+
+static void
+_destroy_pixmap_data_func (guchar *pixels,
+                           gpointer data)
+{
+  g_free (pixels);
+}
+
+void
+egg_notification_bubble_widget_set_icon_from_data (EggNotificationBubbleWidget *bubble_widget,
+                                                   const guchar *data,
+                                                   gboolean has_alpha,
+                                                   int bits_per_sample,
+                                                   int width,
+                                                   int height,
+                                                   int rowstride)
+{
+  GdkPixbuf *pixbuf;
+
+  pixbuf = gdk_pixbuf_new_from_data (data,
+                                     GDK_COLORSPACE_RGB,
+                                     has_alpha,
+                                     bits_per_sample,
+                                     width,
+                                     height,
+                                     rowstride,
+                                     _destroy_pixmap_data_func,
+                                     NULL);
+
+  gtk_image_set_from_pixbuf (GTK_IMAGE (bubble_widget->icon), pixbuf);
+  gdk_pixbuf_unref (pixbuf);
+}
+
+static void
+_calculate_pango_layout_from_aspect (PangoLayout *layout,
+                                     const char *text,
+                                     double factor)
+{
+  gint len;
+  gint w, h;
+  double x;
+
+  len = strlen (text);
+  pango_layout_set_width(layout, -1);
+  pango_layout_set_markup(layout, text, len);
+
+  pango_layout_get_pixel_size (layout, &w, &h);
+
+  if (w > TEXT_WIDTH_THRESHOLD)
+    {
+      double f;
+
+      pango_layout_get_size (layout, &w, &h);
+
+      x = sqrt (factor * w / h);
+      if (x == 0)
+        x = 1;
+
+      f = (double) w / x;
+
+      w = (gint) (f + 0.5);
+
+      pango_layout_set_width(layout, w);
+    }
+}
+
+void
+egg_notification_bubble_widget_set (EggNotificationBubbleWidget *bubble_widget,
+			     const gchar *bubble_widget_header_text,
+                             const gchar *icon,
+			     const gchar *bubble_widget_body_text)
+{
+  gchar *markupquoted;
+  gchar *markuptext;
+  gint w, h;
+
+  g_return_if_fail (EGG_IS_NOTIFICATION_BUBBLE_WIDGET (bubble_widget));
+
+  g_free (bubble_widget->bubble_widget_header_text);
+  g_free (bubble_widget->bubble_widget_body_text);
+  bubble_widget->bubble_widget_header_text = g_strdup (bubble_widget_header_text);
+  bubble_widget->bubble_widget_body_text = g_strdup (bubble_widget_body_text);
+
+  if (icon != NULL && strcmp (icon, "") != 0)
+    {
+      if (g_str_has_prefix (icon, "file://"))
+        {
+          gchar *icon_path = (gchar *) icon + (7 * sizeof (gchar));
+          gtk_image_set_from_file (GTK_IMAGE (bubble_widget->icon), icon_path);
+        }
+      else
+        {
+          gtk_image_set_from_icon_name (GTK_IMAGE (bubble_widget->icon), icon, GTK_ICON_SIZE_DIALOG);
+        }
+    }
+
+  markupquoted = g_markup_escape_text (bubble_widget->bubble_widget_header_text, -1);
+  markuptext = g_strdup_printf ("<span size=\"larger\" weight=\"ultrabold\">%s</span>", markupquoted);
+  gtk_label_set_markup (GTK_LABEL (bubble_widget->bubble_widget_header_label), markuptext);
+  g_free (markuptext);
+  g_free (markupquoted);
+
+  _calculate_pango_layout_from_aspect (bubble_widget->body_layout,
+                                       bubble_widget->bubble_widget_body_text,
+                                       0.25);
+
+  pango_layout_get_pixel_size (bubble_widget->body_layout, &w, &h);
+  gtk_widget_set_size_request (bubble_widget->bubble_widget_body_label, w, h);
+
+}
+
+
+void
+egg_notification_bubble_widget_set_pos (EggNotificationBubbleWidget   *bubble_widget,
+                                 gint x, gint y)
+{
+  GdkScreen *screen;
+  gint monitor_num;
+  GdkRectangle monitor;
+
+  bubble_widget->x = x;
+  bubble_widget->y = y;
+
+  screen = gtk_window_get_screen (GTK_WINDOW(bubble_widget));
+  monitor_num = gdk_screen_get_monitor_at_point (screen, x, y);
+  gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
+
+  /* TODO: This is wrong - if elements are added before
+           set_pos is called the layout become wrong */
+  if (x < (monitor.x + monitor.width) / 2)
+      _layout_window (bubble_widget, TRIANGLE_LEFT);
+  else
+      _layout_window (bubble_widget, TRIANGLE_RIGHT);
+
+  _stencil_bubble (bubble_widget);
+
+  gtk_window_move (GTK_WINDOW (bubble_widget),
+                   x - bubble_widget->offset_x,
+                   y - bubble_widget->offset_y);
+}
+
+static void
+egg_notification_bubble_widget_realize (GtkWidget *widget)
+{
+  GtkWidgetClass *widget_parent_class;
+
+  widget_parent_class = (GtkWidgetClass *)parent_class;
+  if (widget_parent_class->realize)
+    widget_parent_class->realize (widget);
+
+  draw_bubble_widget (EGG_NOTIFICATION_BUBBLE_WIDGET(widget));
+}
+
+static void
+egg_notification_bubble_widget_screen_changed (GtkWidget *widget,
+                                               GdkScreen *old_screen)
+{
+  GtkWidgetClass *widget_parent_class;
+  EggNotificationBubbleWidget *bw;
+  GdkScreen *screen;
+  GdkColormap *colormap;
+  gboolean can_composite;
+
+  bw = EGG_NOTIFICATION_BUBBLE_WIDGET (widget);
+
+  widget_parent_class = (GtkWidgetClass *)parent_class;
+  if (widget_parent_class->screen_changed)
+    widget_parent_class->screen_changed (widget, old_screen);
+
+  can_composite = TRUE;
+
+  screen = gtk_widget_get_screen (widget);
+  colormap = gdk_screen_get_rgba_colormap (screen);
+
+  if (!colormap)
+    {
+      colormap = gdk_screen_get_rgb_colormap (screen);
+      can_composite = FALSE;
+    }
+
+  gtk_widget_set_colormap (widget, colormap);
+
+  bw->can_composite = can_composite;
+}
+
+
+static gboolean
+egg_notification_bubble_widget_body_label_expose_handler (GtkWidget *widget,
+                                                          GdkEventExpose *event,
+                                                          EggNotificationBubbleWidget *bw)
+{
+  cairo_t *cr;
+  cr = gdk_cairo_create (GTK_WIDGET(bw)->window);
+
+  cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
+
+  cairo_set_source_rgba (cr, bw->body_text_color.red,
+                             bw->body_text_color.green,
+                             bw->body_text_color.blue,
+                             0.60);
+  cairo_move_to (cr, event->area.x, event->area.y);
+
+  pango_cairo_layout_path (cr, bw->body_layout);
+
+  cairo_fill (cr);
+  cairo_destroy (cr);
+
+  return TRUE;
+}
+
+static gboolean
+egg_notification_bubble_widget_expose (GtkWidget *widget, GdkEventExpose *event)
+{
+  GtkWidgetClass *widget_parent_class;
+  EggNotificationBubbleWidget *bw;
+
+  bw = EGG_NOTIFICATION_BUBBLE_WIDGET (widget);
+
+  draw_bubble_widget (bw);
+
+  widget_parent_class = (GtkWidgetClass *)parent_class;
+  if (widget_parent_class->expose_event)
+    widget_parent_class->expose_event (widget, event);
+
+  return TRUE;
+}
+
+static void
+_stencil_bubble_top_right (EggNotificationBubbleWidget *bw,
+                           GdkRectangle *rect)
+{
+  GdkPoint triangle[3];
+
+  triangle[0].y = rect->y;
+  triangle[0].x = rect->x + rect->width - (TRIANGLE_START + TRIANGLE_WIDTH);
+  triangle[2].x = triangle[0].x + TRIANGLE_WIDTH;
+  triangle[2].y = rect->y;
+  triangle[1].x = (triangle[2].x - triangle[0].x) / 2 + triangle[0].x;
+  triangle[1].y = rect->y - BORDER_SIZE + 5;
+
+
+  bw->offset_x = triangle[1].x;
+  bw->offset_y = triangle[1].y;
+
+  _edge_line_to (bw, triangle[0].x, triangle[0].y, 0);
+  _edge_line_to (bw, triangle[1].x, triangle[1].y, 0);
+  _edge_line_to (bw, triangle[2].x, triangle[2].y, 0);
+
+  _edge_line_to (bw, rect->x + rect->width, rect->y, CURVE_LENGTH);
+  _edge_line_to (bw, rect->x + rect->width, rect->y + rect->height, CURVE_LENGTH);
+
+  _edge_line_to (bw, rect->x, rect->y + rect->height + BORDER_SIZE - 5, CURVE_LENGTH);
+
+  _edge_line_to (bw, rect->x, rect->y, CURVE_LENGTH);
+
+  _close_path (bw);
+}
+
+static void
+_stencil_bubble_top_left  (EggNotificationBubbleWidget *bw,
+                           GdkRectangle *rect)
+{
+  GdkPoint triangle[3];
+
+  triangle[0].x = rect->x + TRIANGLE_START;
+  triangle[0].y = rect->y;
+  triangle[2].x = triangle[0].x + TRIANGLE_WIDTH;
+  triangle[2].y = rect->y;
+  triangle[1].x = (triangle[2].x - triangle[0].x) / 2 + triangle[0].x;
+  triangle[1].y = rect->y - BORDER_SIZE + 5;
+
+  bw->offset_x = triangle[1].x;
+  bw->offset_y = triangle[1].y;
+
+  _edge_line_to (bw, triangle[0].x, triangle[0].y, 0);
+  _edge_line_to (bw, triangle[1].x, triangle[1].y, 0);
+  _edge_line_to (bw, triangle[2].x, triangle[2].y, 0);
+
+  _edge_line_to (bw, rect->x + rect->width, rect->y, CURVE_LENGTH);
+  _edge_line_to (bw, rect->x + rect->width, rect->y + rect->height + BORDER_SIZE - 5, CURVE_LENGTH);
+
+  _edge_line_to (bw, rect->x, rect->y + rect->height, CURVE_LENGTH);
+
+  _edge_line_to (bw, rect->x, rect->y, CURVE_LENGTH);
+
+  _close_path (bw);
+
+}
+
+static void
+_stencil_bubble_bottom_right (EggNotificationBubbleWidget *bw,
+                              GdkRectangle *rect)
+{
+  GdkPoint triangle[3];
+
+  triangle[2].x = rect->x + rect->width - TRIANGLE_START;
+  triangle[2].y = rect->y + rect->height;
+
+  triangle[0].x = triangle[2].x - TRIANGLE_WIDTH;
+  triangle[0].y = rect->y + rect->height;
+  triangle[1].x = (triangle[2].x - triangle[0].x) / 2 + triangle[0].x;
+  triangle[1].y = rect->y + rect->height +  BORDER_SIZE - 5;
+
+  bw->offset_x = triangle[1].x;
+  bw->offset_y = triangle[1].y;
+
+  _edge_line_to (bw, triangle[2].x, triangle[2].y, 0);
+  _edge_line_to (bw, triangle[1].x, triangle[1].y, 0);
+  _edge_line_to (bw, triangle[0].x, triangle[0].y, 0);
+
+
+  _edge_line_to (bw, rect->x, rect->y + rect->height, CURVE_LENGTH);
+  _edge_line_to (bw, rect->x, rect->y - BORDER_SIZE + 5, CURVE_LENGTH);
+  _edge_line_to (bw, rect->x + rect->width, rect->y, CURVE_LENGTH);
+  _edge_line_to (bw, rect->x + rect->width, rect->y + rect->height, CURVE_LENGTH);
+
+  _close_path (bw);
+}
+
+static void
+_stencil_bubble_bottom_left  (EggNotificationBubbleWidget *bw,
+                              GdkRectangle *rect)
+{
+  GdkPoint triangle[3];
+
+  triangle[0].x = rect->x + TRIANGLE_START;
+  triangle[0].y = rect->y + rect->height;
+  triangle[2].x = triangle[0].x + TRIANGLE_WIDTH;
+  triangle[2].y = rect->y + rect->height;
+  triangle[1].x = (triangle[2].x - triangle[0].x) / 2 + triangle[0].x;
+  triangle[1].y = rect->y + rect->height + BORDER_SIZE - 5;
+
+  bw->offset_x = triangle[1].x;
+  bw->offset_y = triangle[1].y;
+
+  _edge_line_to (bw, triangle[2].x, triangle[2].y, 0);
+  _edge_line_to (bw, triangle[1].x, triangle[1].y, 0);
+  _edge_line_to (bw, triangle[0].x, triangle[0].y, 0);
+
+  _edge_line_to (bw, rect->x, rect->y + rect->height, CURVE_LENGTH);
+  _edge_line_to (bw, rect->x, rect->y, CURVE_LENGTH);
+  _edge_line_to (bw, rect->x + rect->width, rect->y - BORDER_SIZE + 5, CURVE_LENGTH);
+  _edge_line_to (bw, rect->x + rect->width, rect->y + rect->height, CURVE_LENGTH);
+
+  _close_path (bw);
+}
+
+static void
+_stencil_bubble_no_arrow (EggNotificationBubbleWidget *bw,
+                          GdkRectangle *rect)
+{
+  bw->offset_x = 0;
+  bw->offset_y = 0;
+
+  _edge_line_to (bw, rect->x + rect->width, rect->y, CURVE_LENGTH);
+  _edge_line_to (bw, rect->x + rect->width, rect->y + rect->height, CURVE_LENGTH);
+
+  _edge_line_to (bw, rect->x, rect->y + rect->height, CURVE_LENGTH);
+
+  _edge_line_to (bw, rect->x, rect->y, CURVE_LENGTH);
+
+  _close_path (bw);
+
+}
+
+static void
+_stencil_bubble (EggNotificationBubbleWidget *bw)
+{
+  GdkRectangle rect;
+  GtkRequisition req;
+  gint rect_border;
+
+  gtk_widget_size_request (GTK_WIDGET (bw), &req);
+
+  if (bw->draw_arrow)
+    rect_border = BORDER_SIZE - BORDER_LINE_WIDTH;
+  else
+    rect_border = BORDER_LINE_WIDTH;
+
+  rect.x = rect_border;
+  rect.y = rect_border;
+  rect.width = req.width - (rect_border * 2);
+  rect.height = req.height - (rect_border * 2);
+
+  _drawing_pipeline_clear (bw);
+
+  if (bw->draw_arrow)
+    {
+      GdkScreen *screen;
+      GdkRectangle monitor;
+      gint monitor_num;
+      gint orient;
+      gint orient_triangle;
+      gint x, y;
+
+      x = bw->x;
+      y = bw->y;
+      screen = gtk_window_get_screen (GTK_WINDOW(bw));
+      monitor_num = gdk_screen_get_monitor_at_point (screen, x, y);
+      gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
+
+      /* TODO: draw corner cases */
+      if (x < (monitor.x + monitor.width) / 2)
+        orient_triangle = TRIANGLE_LEFT;
+      else
+        orient_triangle = TRIANGLE_RIGHT;
+
+      orient = ORIENT_TOP;
+
+      if ((y + req.height) > monitor.y + monitor.height)
+        orient = ORIENT_BOTTOM;
+
+      if (orient == ORIENT_TOP)
+        {
+          if (orient_triangle == TRIANGLE_RIGHT)
+            _stencil_bubble_top_right (bw, &rect);
+          else if (orient_triangle == TRIANGLE_LEFT)
+            _stencil_bubble_top_left (bw, &rect);
+        }
+      else if (orient == ORIENT_BOTTOM)
+        {
+          if (orient_triangle == TRIANGLE_RIGHT)
+            _stencil_bubble_bottom_right (bw, &rect);
+          else if (orient_triangle == TRIANGLE_LEFT)
+            _stencil_bubble_bottom_left (bw, &rect);
+        }
+    }
+  else
+    _stencil_bubble_no_arrow (bw, &rect);
+}
+
+static GdkColor
+_blend_colors (GdkColor color1, GdkColor color2, gdouble factor)
+{
+  GdkColor result;
+  gint channel_intensity;
+
+  channel_intensity = color1.red * factor + color2.red * (1 - factor);
+  result.red = CLAMP (channel_intensity, 0, 65535);
+
+  channel_intensity = color1.green * factor + color2.green * (1 - factor);
+  result.green = CLAMP (channel_intensity, 0, 65535);
+
+  channel_intensity = color1.blue * factor + color2.blue * (1 - factor);
+  result.blue = CLAMP (channel_intensity, 0, 65535);
+
+  result.pixel = 0xFF; /* This is never really used. */
+
+  return result;
+}
+
+static void
+_calculate_colors_from_style (EggNotificationBubbleWidget *bw)
+{
+  GtkStyle *style;
+  GtkWidget *widget;
+  GdkColor header_text_color;
+  GdkColor body_text_color;
+  GdkColor bg_end_gradient;
+  GdkColor border_color;
+  GdkColor bg_start_gradient;
+
+  widget = GTK_WIDGET (bw);
+
+  gtk_widget_ensure_style (widget);
+  style = widget->style;
+
+  header_text_color = style->text[GTK_STATE_NORMAL];
+  body_text_color = style->text[GTK_STATE_NORMAL];
+  bg_start_gradient = style->base[GTK_STATE_NORMAL];
+  bg_end_gradient = style->bg[GTK_STATE_SELECTED];
+  border_color = style->mid[GTK_STATE_NORMAL];
+
+  bg_end_gradient = _blend_colors (bg_start_gradient, bg_end_gradient, 0.25);
+
+  bw->header_text_color = header_text_color;
+  bw->body_text_color = body_text_color;
+  bw->bg_start_gradient = bg_start_gradient;
+  bw->bg_end_gradient = bg_end_gradient;
+  bw->border_color = border_color;
+}
+
+
+static void
+draw_bubble_widget (EggNotificationBubbleWidget *bubble_widget)
+{
+  GtkRequisition requisition;
+  gint w, h;
+  cairo_pattern_t *pat;
+  GdkPixmap *mask;
+  GdkPoint arrow_pos;
+
+  GtkWidget *widget;
+  cairo_t *cairo_context;
+  cairo_t *mask_cr;
+  gboolean can_composite;
+
+  mask_cr = NULL;
+  mask = NULL;
+
+  arrow_pos.x = 0;
+  arrow_pos.y = 0;
+
+  widget = GTK_WIDGET(bubble_widget);
+  cairo_context = gdk_cairo_create (widget->window);
+
+  can_composite = bubble_widget->can_composite;
+
+  _calculate_colors_from_style (bubble_widget);
+
+  gtk_widget_size_request (widget, &requisition);
+  w = requisition.width;
+  h = requisition.height;
+
+  if (!can_composite)
+    {
+      mask = gdk_pixmap_new (NULL, w, h, 1);
+      mask_cr = gdk_cairo_create ((GdkDrawable *) mask);
+    }
+
+  g_list_foreach (bubble_widget->dp.pipeline, (GFunc) _drawing_instruction_draw, cairo_context);
+  if (!can_composite)
+    g_list_foreach (bubble_widget->dp.pipeline, (GFunc) _drawing_instruction_draw, mask_cr);
+
+  if (can_composite)
+    cairo_set_source_rgba (cairo_context, 1, 1, 1, 0);
+  else
+    cairo_set_source_rgba (cairo_context,
+                           bubble_widget->border_color.red / 65535.0,
+                           bubble_widget->border_color.green / 65535.0,
+                           bubble_widget->border_color.blue / 65535.0, 1);
+
+  cairo_set_operator (cairo_context, CAIRO_OPERATOR_SOURCE);
+  cairo_paint (cairo_context);
+
+  cairo_set_operator (cairo_context, CAIRO_OPERATOR_OVER);
+
+  pat = cairo_pattern_create_linear (0.0, 0.0,  0.0, h);
+  //cairo_pattern_add_color_stop_rgba (pat, 1, 0.59, 0.76, 0.93, 1);
+  cairo_pattern_add_color_stop_rgba (pat, 0,
+                                     bubble_widget->bg_start_gradient.red /
+                                     65535.0,
+                                     bubble_widget->bg_start_gradient.green /
+                                     65535.0,
+                                     bubble_widget->bg_start_gradient.blue /
+                                     65535.0, 1);
+
+  cairo_pattern_add_color_stop_rgba (pat, 1,
+                                     bubble_widget->bg_end_gradient.red /
+                                     65535.0,
+                                     bubble_widget->bg_end_gradient.green /
+                                     65535.0,
+                                     bubble_widget->bg_end_gradient.blue /
+                                     65535.0, 1);
+
+  cairo_set_source (cairo_context, pat);
+  cairo_fill_preserve (cairo_context);
+  cairo_pattern_destroy (pat);
+
+  cairo_set_line_width (cairo_context, 3.5);
+  cairo_set_source_rgba (cairo_context, 0.43, 0.49, 0.55, 1);
+  cairo_stroke (cairo_context);
+
+  if (!can_composite)
+    {
+      cairo_set_operator (mask_cr, CAIRO_OPERATOR_CLEAR);
+      cairo_paint (mask_cr);
+
+      cairo_set_operator (mask_cr, CAIRO_OPERATOR_OVER);
+      cairo_set_line_width (mask_cr, 3.5);
+      cairo_set_source_rgba (mask_cr, 1, 1, 1, 1);
+      cairo_fill_preserve (mask_cr);
+      cairo_stroke (mask_cr);
+
+      gdk_window_shape_combine_mask (widget->window,
+                                     (GdkBitmap *) mask,
+                                     0,
+                                     0);
+      gdk_pixmap_unref (mask);
+      cairo_destroy (mask_cr);
+    }
+
+  cairo_destroy (cairo_context);
+
+  bubble_widget->active = TRUE;
+}
+
+void
+egg_notification_bubble_widget_show (EggNotificationBubbleWidget *bubble_widget)
+{
+  gtk_widget_show_all (GTK_WIDGET (bubble_widget));
+}
+
+void
+egg_notification_bubble_widget_hide (EggNotificationBubbleWidget *bubble_widget)
+{
+  if (bubble_widget)
+    gtk_widget_hide (GTK_WIDGET (bubble_widget));
+}
+
+EggNotificationBubbleWidget*
+egg_notification_bubble_widget_new (void)
+{
+  return g_object_new (EGG_TYPE_NOTIFICATION_BUBBLE_WIDGET,
+                       "type", GTK_WINDOW_POPUP,
+                       NULL);
+}
+
+static void
+egg_notification_bubble_widget_context_changed_handler (EggNotificationBubbleWidget *bubble_widget)
+{
+  pango_layout_context_changed (bubble_widget->body_layout);
+}
+
+
+static void
+egg_notification_bubble_widget_event_handler (GtkWidget *widget,
+				       GdkEvent  *event,
+				       gpointer user_data)
+{
+  EggNotificationBubbleWidget *bubble_widget;
+
+  bubble_widget = EGG_NOTIFICATION_BUBBLE_WIDGET (user_data);
+
+  switch (event->type)
+    {
+    case GDK_BUTTON_PRESS:
+      g_signal_emit (bubble_widget, egg_notification_bubble_widget_signals[NOTIFICATION_CLICKED], 0);
+      break;
+    default:
+      break;
+    }
+}
+
+GtkWidget *
+egg_notification_bubble_widget_create_button (EggNotificationBubbleWidget *bubble_widget,
+                                              const gchar *label)
+{
+  GtkWidget *b;
+  GtkWidget *l;
+  gchar *label_markup;
+
+  b = gtk_button_new ();
+  gtk_button_set_relief (GTK_BUTTON (b), GTK_RELIEF_NONE);
+  gtk_container_set_border_width (GTK_CONTAINER (b), 0);
+
+  label_markup = g_markup_printf_escaped ("<span weight=\"bold\" underline=\"single\" foreground=\"blue\">%s</span>", label);
+
+  l = gtk_label_new (label_markup);
+  gtk_label_set_use_markup (GTK_LABEL (l), TRUE);
+
+  g_free (label_markup);
+
+  gtk_container_add (GTK_CONTAINER (b), l);
+
+  gtk_widget_show_all (b);
+
+  if (bubble_widget->button_hbox == NULL)
+    bubble_widget->button_hbox = gtk_hbox_new (FALSE, 0);
+
+  gtk_box_pack_start(GTK_BOX (bubble_widget->button_hbox), b, FALSE, FALSE, 0);
+
+  return (b);
+}
+
+void
+egg_notification_bubble_widget_clear_buttons (EggNotificationBubbleWidget *bubble_widget)
+{
+  if (bubble_widget->button_hbox != NULL)
+    gtk_widget_destroy (bubble_widget->button_hbox);
+
+  bubble_widget->button_hbox = NULL;
+}
+
+void
+egg_notification_bubble_widget_set_draw_arrow (EggNotificationBubbleWidget *bubble_widget,
+                                               gboolean value)
+{
+  bubble_widget->draw_arrow = value;
+}
+
+void
+egg_notification_bubble_widget_set_hints (EggNotificationBubbleWidget *bubble_widget,
+					  GHashTable *hints)
+{
+  GValue *data;
+
+  data = g_hash_table_lookup (hints, "urgency");
+  if (data)
+    bubble_widget->urgency = g_value_get_uchar (data);
+}


Property changes on: notification-daemon-xfce/trunk/themes/bubble/eggnotificationbubblewidget.c
___________________________________________________________________
Name: svn:keywords
   + Id

Added: notification-daemon-xfce/trunk/themes/bubble/eggnotificationbubblewidget.h
===================================================================
--- notification-daemon-xfce/trunk/themes/bubble/eggnotificationbubblewidget.h	                        (rev 0)
+++ notification-daemon-xfce/trunk/themes/bubble/eggnotificationbubblewidget.h	2006-09-06 11:35:36 UTC (rev 1977)
@@ -0,0 +1,136 @@
+/* $Id$
+ *
+ * Copyright (C) 2005 Colin Walters <walters at verbum.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __EGG_NOTIFICATION_BUBBLE_WIDGET_H__
+#define __EGG_NOTIFICATION_BUBBLE_WIDGET_H__
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define EGG_TYPE_NOTIFICATION_BUBBLE_WIDGET                  (egg_notification_bubble_widget_get_type ())
+#define EGG_NOTIFICATION_BUBBLE_WIDGET(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_NOTIFICATION_BUBBLE_WIDGET, EggNotificationBubbleWidget))
+#define EGG_NOTIFICATION_BUBBLE_WIDGET_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_NOTIFICATION_BUBBLE_WIDGET, EggNotificationBubbleWidgetClass))
+#define EGG_IS_NOTIFICATION_BUBBLE_WIDGET(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_NOTIFICATION_BUBBLE_WIDGET))
+#define EGG_IS_NOTIFICATION_BUBBLE_WIDGET_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_NOTIFICATION_BUBBLE_WIDGET))
+#define EGG_NOTIFICATION_BUBBLE_WIDGET_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_NOTIFICATION_BUBBLE_WIDGET, EggNotificationBubbleWidgetClass))
+
+
+typedef struct _EggNotificationBubbleWidget	 EggNotificationBubbleWidget;
+typedef struct _EggNotificationBubbleWidgetClass EggNotificationBubbleWidgetClass;
+typedef struct _EggNotificationBubbleWidgetData	 EggNotificationBubbleWidgetData;
+
+struct _DrawingPipeline
+{
+  gint start_x;
+  gint start_y;
+  gint start_corner_radius;
+
+  gint last_x;
+  gint last_y;
+  gint last_corner_radius;
+
+  gboolean is_clear;
+
+  GList *pipeline;
+};
+
+struct _EggNotificationBubbleWidget
+{
+  GtkWindow parent_instance;
+
+  char *bubble_widget_header_text;
+  char *bubble_widget_body_text;
+  GtkWidget *icon;
+
+  gboolean active;
+  GtkWidget *table;
+  GtkWidget *bubble_widget_header_label;
+  GtkWidget *bubble_widget_body_label;
+  GtkWidget *button_hbox;
+  PangoLayout *body_layout;
+
+  gint x, y;
+  gint offset_x, offset_y;
+  gboolean can_composite;
+  gboolean draw_arrow;
+
+  GdkColor header_text_color;
+  GdkColor body_text_color;
+  GdkColor bg_start_gradient;
+  GdkColor bg_end_gradient;
+  GdkColor border_color;
+
+  /* The Urgency level of the notification */
+  guchar urgency;
+
+  /* drawing instructions */
+  struct _DrawingPipeline dp;
+};
+
+struct _EggNotificationBubbleWidgetClass
+{
+  GtkWindowClass parent_class;
+
+  void (*clicked) (void);
+
+  /* Padding for future expansion */
+  void (*_gtk_reserved1) (void);
+  void (*_gtk_reserved2) (void);
+  void (*_gtk_reserved3) (void);
+  void (*_gtk_reserved4) (void);
+};
+
+GType		 egg_notification_bubble_widget_get_type	   (void) G_GNUC_CONST;
+EggNotificationBubbleWidget*	 egg_notification_bubble_widget_new	   (void);
+
+void		 egg_notification_bubble_widget_set (EggNotificationBubbleWidget   *bubble_widget,
+					      const gchar	      *notification_header,
+					      const gchar             *icon,
+					      const gchar             *notification_body);
+
+void             egg_notification_bubble_widget_show (EggNotificationBubbleWidget *bubble_widget);
+void             egg_notification_bubble_widget_hide (EggNotificationBubbleWidget *bubble_widget);
+
+
+void             egg_notification_bubble_widget_set_pos (EggNotificationBubbleWidget   *bubble_widget,
+                                                         gint x, gint y);
+
+void             egg_notification_bubble_widget_set_icon_from_data (EggNotificationBubbleWidget   *bubble_widget,
+                                                                    const guchar                  *data,
+                                                                    gboolean                       has_alpha,
+                                                                    int                            bits_per_sample,
+                                                                    int                            width,
+                                                                    int                            height,
+                                                                    int                            rowstride);
+
+
+GtkWidget *      egg_notification_bubble_widget_create_button (EggNotificationBubbleWidget *bubble_widget,
+                                                               const gchar *label);
+
+void             egg_notification_bubble_widget_clear_buttons (EggNotificationBubbleWidget *bubble_widget);
+
+void             egg_notification_bubble_widget_set_draw_arrow (EggNotificationBubbleWidget *bubble_widget, gboolean value);
+
+void             egg_notification_bubble_widget_set_hints (EggNotificationBubbleWidget *bubble_widget, GHashTable *hints);
+
+G_END_DECLS
+
+#endif /* __EGG_NOTIFICATION_BUBBLE_WIDGET_H__ */


Property changes on: notification-daemon-xfce/trunk/themes/bubble/eggnotificationbubblewidget.h
___________________________________________________________________
Name: svn:keywords
   + Id

Added: notification-daemon-xfce/trunk/themes/bubble/theme.c
===================================================================
--- notification-daemon-xfce/trunk/themes/bubble/theme.c	                        (rev 0)
+++ notification-daemon-xfce/trunk/themes/bubble/theme.c	2006-09-06 11:35:36 UTC (rev 1977)
@@ -0,0 +1,98 @@
+/* $Id$
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <gtk/gtk.h>
+#include "eggnotificationbubblewidget.h"
+
+typedef void (*ActionInvokedCb)(GtkWindow *nw, const char *key);
+
+GtkWindow *
+create_notification(void)
+{
+	return GTK_WINDOW(egg_notification_bubble_widget_new());
+}
+
+void
+show_notification(GtkWindow *nw)
+{
+	egg_notification_bubble_widget_show(EGG_NOTIFICATION_BUBBLE_WIDGET(nw));
+}
+
+void
+hide_notification(GtkWindow *nw)
+{
+	egg_notification_bubble_widget_hide(EGG_NOTIFICATION_BUBBLE_WIDGET(nw));
+}
+
+void
+set_notification_hints(GtkWindow *nw, GHashTable *hints)
+{
+	egg_notification_bubble_widget_set_hints(
+		EGG_NOTIFICATION_BUBBLE_WIDGET(nw), hints);
+}
+
+void
+set_notification_text(GtkWindow *nw, const char *summary, const char *body)
+{
+	egg_notification_bubble_widget_set(EGG_NOTIFICATION_BUBBLE_WIDGET(nw),
+									   summary, NULL, body);
+}
+
+void
+set_notification_icon(GtkWindow *nw, GdkPixbuf *pixbuf)
+{
+	EggNotificationBubbleWidget *bubble = EGG_NOTIFICATION_BUBBLE_WIDGET(nw);
+
+	gtk_image_set_from_pixbuf(GTK_IMAGE(bubble->icon), pixbuf);
+}
+
+void
+set_notification_arrow(GtkWindow *nw, gboolean visible, int x, int y)
+{
+	egg_notification_bubble_widget_set_draw_arrow(
+		EGG_NOTIFICATION_BUBBLE_WIDGET(nw), visible);
+}
+
+static void
+action_clicked_cb(GtkWidget *w, ActionInvokedCb action_cb)
+{
+	GtkWindow *nw   = g_object_get_data(G_OBJECT(w), "_nw");
+	const char *key = g_object_get_data(G_OBJECT(w), "_action_key");
+
+	action_cb(nw, key);
+}
+
+void
+add_notification_action(GtkWindow *nw, const char *label, const char *key,
+						ActionInvokedCb cb)
+{
+	GtkWidget *b = egg_notification_bubble_widget_create_button(
+		EGG_NOTIFICATION_BUBBLE_WIDGET(nw), label);
+	g_object_set_data(G_OBJECT(b), "_nw", nw);
+	g_object_set_data_full(G_OBJECT(b), "_action_key", g_strdup(key), g_free);
+
+	g_signal_connect(G_OBJECT(b), "clicked",
+					 G_CALLBACK(action_clicked_cb), cb);
+}
+
+void
+move_notification(GtkWindow *nw, int x, int y)
+{
+	egg_notification_bubble_widget_set_pos(EGG_NOTIFICATION_BUBBLE_WIDGET(nw),
+										   x, y);
+}


Property changes on: notification-daemon-xfce/trunk/themes/bubble/theme.c
___________________________________________________________________
Name: svn:keywords
   + Id

Added: notification-daemon-xfce/trunk/themes/standard/Makefile.am
===================================================================
--- notification-daemon-xfce/trunk/themes/standard/Makefile.am	                        (rev 0)
+++ notification-daemon-xfce/trunk/themes/standard/Makefile.am	2006-09-06 11:35:36 UTC (rev 1977)
@@ -0,0 +1,21 @@
+# $Id$
+
+enginedir = $(libdir)/notification-daemon-1.0/engines
+
+engine_LTLIBRARIES =							\
+	libstandard.la
+
+libstandard_la_SOURCES = 						\
+	theme.c
+
+libstandard_la_LDFLAGS = 						\
+	-module								\
+	-avoid-version
+
+libstandard_la_LIBADD =							\
+	$(GTK_LIBS)							\
+	$(LIBSEXY_LIBS)
+
+INCLUDES = 								\
+	$(GTK_CFLAGS) 							\
+	$(LIBSEXY_CFLAGS)


Property changes on: notification-daemon-xfce/trunk/themes/standard/Makefile.am
___________________________________________________________________
Name: svn:keywords
   + Id

Added: notification-daemon-xfce/trunk/themes/standard/theme.c
===================================================================
--- notification-daemon-xfce/trunk/themes/standard/theme.c	                        (rev 0)
+++ notification-daemon-xfce/trunk/themes/standard/theme.c	2006-09-06 11:35:36 UTC (rev 1977)
@@ -0,0 +1,811 @@
+/* $Id$
+ *
+ * Copyright (C) 2006 Christian Hammond <chipx86 at chipx86.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+
+#include <gtk/gtk.h>
+#include <libsexy/sexy-url-label.h>
+
+typedef void (*ActionInvokedCb)(GtkWindow *nw, const char *key);
+typedef void (*UrlClickedCb)(GtkWindow *nw, const char *url);
+
+typedef struct
+{
+	GtkWidget *win;
+	GtkWidget *top_spacer;
+	GtkWidget *bottom_spacer;
+	GtkWidget *main_hbox;
+	GtkWidget *iconbox;
+	GtkWidget *icon;
+	GtkWidget *content_hbox;
+	GtkWidget *summary_label;
+	GtkWidget *body_label;
+	GtkWidget *actions_box;
+	GtkWidget *last_sep;
+	GtkWidget *stripe_spacer;
+	GtkWidget *pie_countdown;
+
+	gboolean has_arrow;
+
+	int point_x;
+	int point_y;
+
+	int drawn_arrow_begin_x;
+	int drawn_arrow_begin_y;
+	int drawn_arrow_middle_x;
+	int drawn_arrow_middle_y;
+	int drawn_arrow_end_x;
+	int drawn_arrow_end_y;
+
+	GdkGC *gc;
+	GdkPoint *border_points;
+	size_t num_border_points;
+	GdkRegion *window_region;
+
+	guchar urgency;
+	glong timeout;
+	glong remaining;
+
+	UrlClickedCb url_clicked;
+
+} WindowData;
+
+enum
+{
+	URGENCY_LOW,
+	URGENCY_NORMAL,
+	URGENCY_CRITICAL
+};
+
+#define WIDTH         300
+#define IMAGE_SIZE    32
+#define IMAGE_PADDING 10
+#define STRIPE_WIDTH  30
+#define PIE_RADIUS    12
+#define PIE_WIDTH     (2 * PIE_RADIUS)
+#define PIE_HEIGHT    (2 * PIE_RADIUS)
+#define BODY_X_OFFSET (IMAGE_SIZE + 8)
+#define DEFAULT_ARROW_OFFSET  (STRIPE_WIDTH + 2)
+#define DEFAULT_ARROW_HEIGHT  14
+#define DEFAULT_ARROW_WIDTH   28
+
+static void
+fill_background(GtkWidget *win, WindowData *windata)
+{
+	GtkStyle *style = gtk_widget_get_style(win);
+	GdkGC *gc = style->base_gc[GTK_STATE_NORMAL];
+
+	gdk_draw_rectangle(GDK_DRAWABLE(win->window), gc, TRUE,
+					   win->allocation.x, win->allocation.y,
+					   win->allocation.width, win->allocation.height);
+}
+
+static void
+draw_stripe(GtkWidget *win, WindowData *windata)
+{
+	GtkStyle *style = gtk_widget_get_style(win);
+	gboolean custom_gc = FALSE;
+	GdkColor color;
+	GdkGC *gc;
+
+	switch (windata->urgency)
+	{
+		case URGENCY_LOW: // LOW
+			gc = style->bg_gc[GTK_STATE_NORMAL];
+			break;
+
+		case URGENCY_CRITICAL: // CRITICAL
+			custom_gc = TRUE;
+			gc = gdk_gc_new(GDK_DRAWABLE(win->window));
+			gdk_color_parse("#CC0000", &color);
+			gdk_gc_set_rgb_fg_color(gc, &color);
+			break;
+
+		case URGENCY_NORMAL: // NORMAL
+		default:
+			gc = style->bg_gc[GTK_STATE_SELECTED];
+			break;
+	}
+
+
+	gdk_draw_rectangle(win->window, gc, TRUE,
+					   windata->main_hbox->allocation.x + 1,
+					   windata->main_hbox->allocation.y + 1,
+					   STRIPE_WIDTH,
+					   windata->main_hbox->allocation.height - 2);
+
+	if (custom_gc)
+		g_object_unref(G_OBJECT(gc));
+}
+
+static gboolean
+draw_border(GtkWidget *win, GdkEventExpose *event, WindowData *windata)
+{
+	int w, h;
+
+	fill_background(win, windata);
+
+	if (windata->gc == NULL)
+	{
+		GdkColor color;
+
+		windata->gc = gdk_gc_new(win->window);
+		gdk_color_parse("black", &color);
+		gdk_gc_set_rgb_fg_color(windata->gc, &color);
+	}
+
+	gdk_drawable_get_size(win->window, &w, &h);
+
+	if (windata->has_arrow)
+	{
+		gdk_draw_polygon(win->window, windata->gc, FALSE,
+						 windata->border_points, windata->num_border_points);
+		gdk_window_shape_combine_region(win->window, windata->window_region,
+										0, 0);
+	}
+	else
+	{
+		gdk_draw_rectangle(win->window, windata->gc, FALSE,
+						   0, 0, w - 1, h - 1);
+	}
+
+	draw_stripe(win, windata);
+
+	return FALSE;
+}
+
+static void
+destroy_windata(WindowData *windata)
+{
+	if (windata->gc != NULL)
+		g_object_unref(G_OBJECT(windata->gc));
+
+	if (windata->border_points != NULL)
+		g_free(windata->border_points);
+
+	if (windata->window_region != NULL)
+		gdk_region_destroy(windata->window_region);
+}
+
+static void
+update_content_hbox_visibility(WindowData *windata)
+{
+	/*
+	 * This is all a hack, but until we have a libview-style ContentBox,
+	 * it'll just have to do.
+	 */
+	if (GTK_WIDGET_VISIBLE(windata->icon) ||
+		GTK_WIDGET_VISIBLE(windata->body_label) ||
+		GTK_WIDGET_VISIBLE(windata->actions_box))
+	{
+		gtk_widget_show(windata->content_hbox);
+	}
+	else
+	{
+		gtk_widget_hide(windata->content_hbox);
+	}
+}
+
+GtkWindow *
+create_notification(UrlClickedCb url_clicked)
+{
+	GtkWidget *spacer;
+	GtkWidget *win;
+	GtkWidget *main_vbox;
+	GtkWidget *hbox;
+	GtkWidget *vbox;
+	GtkWidget *close_button;
+	GtkWidget *image;
+	GtkWidget *alignment;
+	WindowData *windata;
+
+	windata = g_new0(WindowData, 1);
+	windata->urgency = URGENCY_NORMAL;
+	windata->url_clicked = url_clicked;
+
+	win = gtk_window_new(GTK_WINDOW_POPUP);
+	windata->win = win;
+	gtk_widget_add_events(win, GDK_BUTTON_RELEASE_MASK);
+	gtk_widget_realize(win);
+	g_object_set_data_full(G_OBJECT(win), "windata", windata,
+						   (GDestroyNotify)destroy_windata);
+	gtk_widget_set_app_paintable(win, TRUE);
+
+	g_signal_connect(G_OBJECT(win), "expose-event",
+					 G_CALLBACK(draw_border), windata);
+
+	main_vbox = gtk_vbox_new(FALSE, 0);
+	gtk_widget_show(main_vbox);
+	gtk_container_add(GTK_CONTAINER(win), main_vbox);
+	gtk_container_set_border_width(GTK_CONTAINER(main_vbox), 1);
+
+	windata->top_spacer = gtk_image_new();
+	gtk_box_pack_start(GTK_BOX(main_vbox), windata->top_spacer,
+					   FALSE, FALSE, 0);
+	gtk_widget_set_size_request(windata->top_spacer, -1, DEFAULT_ARROW_HEIGHT);
+
+	windata->main_hbox = gtk_hbox_new(FALSE, 0);
+	gtk_widget_show(windata->main_hbox);
+	gtk_box_pack_start(GTK_BOX(main_vbox), windata->main_hbox,
+					   FALSE, FALSE, 0);
+
+	windata->bottom_spacer = gtk_image_new();
+	gtk_box_pack_start(GTK_BOX(main_vbox), windata->bottom_spacer,
+					   FALSE, FALSE, 0);
+	gtk_widget_set_size_request(windata->bottom_spacer, -1,
+								DEFAULT_ARROW_HEIGHT);
+
+	vbox = gtk_vbox_new(FALSE, 6);
+	gtk_widget_show(vbox);
+	gtk_box_pack_start(GTK_BOX(windata->main_hbox), vbox, TRUE, TRUE, 0);
+	gtk_container_set_border_width(GTK_CONTAINER(vbox), 10);
+
+	hbox = gtk_hbox_new(FALSE, 6);
+	gtk_widget_show(hbox);
+	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+
+	spacer = gtk_image_new();
+	gtk_widget_show(spacer);
+	gtk_box_pack_start(GTK_BOX(hbox), spacer, FALSE, FALSE, 0);
+	gtk_widget_set_size_request(spacer, STRIPE_WIDTH, -1);
+
+	windata->summary_label = gtk_label_new(NULL);
+	gtk_widget_show(windata->summary_label);
+	gtk_box_pack_start(GTK_BOX(hbox), windata->summary_label, TRUE, TRUE, 0);
+	gtk_misc_set_alignment(GTK_MISC(windata->summary_label), 0, 0);
+	gtk_label_set_line_wrap(GTK_LABEL(windata->summary_label), TRUE);
+
+	/* Add the close button */
+	close_button = gtk_button_new();
+	gtk_widget_show(close_button);
+	gtk_box_pack_start(GTK_BOX(hbox), close_button, FALSE, FALSE, 0);
+	gtk_button_set_relief(GTK_BUTTON(close_button), GTK_RELIEF_NONE);
+	gtk_container_set_border_width(GTK_CONTAINER(close_button), 0);
+	gtk_widget_set_size_request(close_button, 20, 20);
+	g_signal_connect_swapped(G_OBJECT(close_button), "clicked",
+							 G_CALLBACK(gtk_widget_destroy), win);
+
+	image = gtk_image_new_from_stock(GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU);
+	gtk_widget_show(image);
+	gtk_container_add(GTK_CONTAINER(close_button), image);
+
+	windata->content_hbox = gtk_hbox_new(FALSE, 6);
+	gtk_box_pack_start(GTK_BOX(vbox), windata->content_hbox, FALSE, FALSE, 0);
+
+	windata->iconbox = gtk_hbox_new(FALSE, 0);
+	gtk_widget_show(windata->iconbox);
+	gtk_box_pack_start(GTK_BOX(windata->content_hbox), windata->iconbox,
+					   FALSE, FALSE, 0);
+	gtk_widget_set_size_request(windata->iconbox, BODY_X_OFFSET, -1);
+
+	windata->icon = gtk_image_new();
+	gtk_box_pack_start(GTK_BOX(windata->iconbox), windata->icon,
+					   TRUE, TRUE, 0);
+	gtk_misc_set_alignment(GTK_MISC(windata->icon), 0.5, 0.0);
+
+	vbox = gtk_vbox_new(FALSE, 6);
+	gtk_widget_show(vbox);
+	gtk_box_pack_start(GTK_BOX(windata->content_hbox), vbox, TRUE, TRUE, 0);
+
+	windata->body_label = sexy_url_label_new();
+	gtk_box_pack_start(GTK_BOX(vbox), windata->body_label, TRUE, TRUE, 0);
+	gtk_misc_set_alignment(GTK_MISC(windata->body_label), 0, 0);
+	gtk_label_set_line_wrap(GTK_LABEL(windata->body_label), TRUE);
+	g_signal_connect_swapped(G_OBJECT(windata->body_label), "url_activated",
+							 G_CALLBACK(windata->url_clicked), win);
+
+	alignment = gtk_alignment_new(1, 0.5, 0, 0);
+	gtk_widget_show(alignment);
+	gtk_box_pack_start(GTK_BOX(vbox), alignment, FALSE, TRUE, 0);
+
+	windata->actions_box = gtk_hbox_new(FALSE, 6);
+	gtk_container_add(GTK_CONTAINER(alignment), windata->actions_box);
+
+	return GTK_WINDOW(win);
+}
+
+void
+set_notification_hints(GtkWindow *nw, GHashTable *hints)
+{
+	WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");
+	GValue *value;
+
+	g_assert(windata != NULL);
+
+	value = (GValue *)g_hash_table_lookup(hints, "urgency");
+
+	if (value)
+		windata->urgency = g_value_get_uchar(value);
+}
+
+void
+set_notification_timeout(GtkWindow *nw, glong timeout)
+{
+	WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");
+	g_assert(windata != NULL);
+
+	windata->timeout = timeout;
+}
+
+void
+notification_tick(GtkWindow *nw, glong remaining)
+{
+	WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");
+	windata->remaining = remaining;
+
+	if (windata->pie_countdown != NULL)
+	{
+		gtk_widget_queue_draw_area(windata->pie_countdown, 0, 0,
+								   PIE_WIDTH, PIE_HEIGHT);
+	}
+}
+
+void
+set_notification_text(GtkWindow *nw, const char *summary, const char *body)
+{
+	char *str;
+	WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");
+	g_assert(windata != NULL);
+
+	str = g_strdup_printf("<b><big>%s</big></b>", summary);
+	gtk_label_set_markup(GTK_LABEL(windata->summary_label), str);
+	g_free(str);
+
+	sexy_url_label_set_markup(SEXY_URL_LABEL(windata->body_label), body);
+
+	if (body == NULL || *body == '\0')
+		gtk_widget_hide(windata->body_label);
+	else
+		gtk_widget_show(windata->body_label);
+
+	update_content_hbox_visibility(windata);
+
+	gtk_widget_set_size_request(
+		((body != NULL && *body == '\0')
+		 ? windata->body_label : windata->summary_label),
+		WIDTH - (IMAGE_SIZE + IMAGE_PADDING) - 10,
+		-1);
+}
+
+void
+set_notification_icon(GtkWindow *nw, GdkPixbuf *pixbuf)
+{
+	WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");
+	g_assert(windata != NULL);
+
+	gtk_image_set_from_pixbuf(GTK_IMAGE(windata->icon), pixbuf);
+
+	if (pixbuf != NULL)
+	{
+		int pixbuf_width = gdk_pixbuf_get_width(pixbuf);
+
+		gtk_widget_show(windata->icon);
+		gtk_widget_set_size_request(windata->iconbox,
+									MAX(BODY_X_OFFSET, pixbuf_width), -1);
+	}
+	else
+	{
+		gtk_widget_hide(windata->icon);
+		gtk_widget_set_size_request(windata->iconbox, BODY_X_OFFSET, -1);
+	}
+
+	update_content_hbox_visibility(windata);
+}
+
+void
+set_notification_arrow(GtkWindow *nw, gboolean visible, int x, int y)
+{
+	WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");
+	g_assert(windata != NULL);
+
+	windata->has_arrow = visible;
+	windata->point_x = x;
+	windata->point_y = y;
+
+	if (!visible)
+	{
+		gtk_widget_hide(windata->top_spacer);
+		gtk_widget_hide(windata->bottom_spacer);
+	}
+}
+
+static gboolean
+countdown_expose_cb(GtkWidget *pie, GdkEventExpose *event,
+					WindowData *windata)
+{
+	GtkStyle *style = gtk_widget_get_style(windata->win);
+	GdkGC *bg_gc = style->base_gc[GTK_STATE_NORMAL];
+
+	gdk_draw_rectangle(GDK_DRAWABLE(pie->window), bg_gc, TRUE,
+					   0, 0, pie->allocation.width, pie->allocation.height);
+
+	if (windata->timeout > 0)
+	{
+		gdouble pct = (gdouble)windata->remaining / (gdouble)windata->timeout;
+
+#if GTK_CHECK_VERSION(2, 8, 0)
+		cairo_t *cr;
+
+		cr = gdk_cairo_create(GDK_DRAWABLE(windata->pie_countdown->window));
+		gdk_cairo_set_source_color(cr, &style->bg[GTK_STATE_ACTIVE]);
+
+		cairo_move_to(cr, PIE_RADIUS, PIE_RADIUS);
+		cairo_arc_negative(cr, PIE_RADIUS, PIE_RADIUS, PIE_RADIUS,
+						   -G_PI_2, -(pct * G_PI * 2) - G_PI_2);
+		cairo_line_to(cr, PIE_RADIUS, PIE_RADIUS);
+		cairo_fill(cr);
+#else
+		gdk_draw_arc(GDK_DRAWABLE(windata->pie_countdown->window),
+					 style->bg_gc[GTK_STATE_ACTIVE], TRUE,
+					 0, 0, PIE_WIDTH, PIE_HEIGHT,
+					 90 * 64, pct * 360.0 * 64.0);
+#endif
+	}
+
+	return TRUE;
+}
+
+static void
+action_clicked_cb(GtkWidget *w, GdkEventButton *event,
+				  ActionInvokedCb action_cb)
+{
+	GtkWindow *nw   = g_object_get_data(G_OBJECT(w), "_nw");
+	const char *key = g_object_get_data(G_OBJECT(w), "_action_key");
+
+	action_cb(nw, key);
+}
+
+void
+add_notification_action(GtkWindow *nw, const char *text, const char *key,
+						ActionInvokedCb cb)
+{
+	WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");
+	GtkWidget *label;
+	GtkWidget *button;
+	GtkWidget *hbox;
+	GdkPixbuf *pixbuf;
+	char *buf;
+
+	g_assert(windata != NULL);
+
+	if (!GTK_WIDGET_VISIBLE(windata->actions_box))
+	{
+		GtkWidget *alignment;
+
+		gtk_widget_show(windata->actions_box);
+		update_content_hbox_visibility(windata);
+
+		alignment = gtk_alignment_new(1, 0.5, 0, 0);
+		gtk_widget_show(alignment);
+		gtk_box_pack_end(GTK_BOX(windata->actions_box), alignment,
+						   FALSE, TRUE, 0);
+
+		windata->pie_countdown = gtk_drawing_area_new();
+		gtk_widget_show(windata->pie_countdown);
+		gtk_container_add(GTK_CONTAINER(alignment), windata->pie_countdown);
+		gtk_widget_set_size_request(windata->pie_countdown,
+									PIE_WIDTH, PIE_HEIGHT);
+		g_signal_connect(G_OBJECT(windata->pie_countdown), "expose_event",
+						 G_CALLBACK(countdown_expose_cb), windata);
+	}
+
+	button = gtk_button_new();
+	gtk_widget_show(button);
+	gtk_box_pack_start(GTK_BOX(windata->actions_box), button, FALSE, FALSE, 0);
+
+	hbox = gtk_hbox_new(FALSE, 6);
+	gtk_widget_show(hbox);
+	gtk_container_add(GTK_CONTAINER(button), hbox);
+
+	/* Try to be smart and find a suitable icon. */
+	buf = g_strdup_printf("stock_%s", key);
+	pixbuf = gtk_icon_theme_load_icon(
+		gtk_icon_theme_get_for_screen(
+			gdk_drawable_get_screen(GTK_WIDGET(nw)->window)),
+		buf, 16, GTK_ICON_LOOKUP_USE_BUILTIN, NULL);
+	g_free(buf);
+
+	if (pixbuf != NULL)
+	{
+		GtkWidget *image = gtk_image_new_from_pixbuf(pixbuf);
+		gtk_widget_show(image);
+		gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0);
+		gtk_misc_set_alignment(GTK_MISC(image), 0.5, 0.5);
+	}
+
+	label = gtk_label_new(NULL);
+	gtk_widget_show(label);
+	gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
+	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+	buf = g_strdup_printf("<small>%s</small>", text);
+	gtk_label_set_markup(GTK_LABEL(label), buf);
+	g_free(buf);
+
+	g_object_set_data(G_OBJECT(button), "_nw", nw);
+	g_object_set_data_full(G_OBJECT(button),
+						   "_action_key", g_strdup(key), g_free);
+	g_signal_connect(G_OBJECT(button), "button-release-event",
+					 G_CALLBACK(action_clicked_cb), cb);
+}
+
+void
+clear_notification_actions(GtkWindow *nw)
+{
+	WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");
+
+	windata->pie_countdown = NULL;
+
+	gtk_widget_hide(windata->actions_box);
+	gtk_container_foreach(GTK_CONTAINER(windata->actions_box),
+						  (GtkCallback)gtk_object_destroy, NULL);
+}
+
+#define ADD_POINT(_x, _y, shapeoffset_x, shapeoffset_y) \
+	G_STMT_START { \
+		windata->border_points[i].x = (_x); \
+		windata->border_points[i].y = (_y); \
+		shape_points[i].x = (_x) + (shapeoffset_x); \
+		shape_points[i].y = (_y) + (shapeoffset_y); \
+		i++;\
+	} G_STMT_END
+
+static void
+create_border_with_arrow(GtkWidget *nw, WindowData *windata)
+{
+	GtkRequisition req;
+	GtkArrowType arrow_type;
+	GdkScreen *screen;
+	int screen_width;
+	int screen_height;
+	int arrow_side1_width = DEFAULT_ARROW_WIDTH / 2;
+	int arrow_side2_width = DEFAULT_ARROW_WIDTH / 2;
+	int arrow_offset = DEFAULT_ARROW_OFFSET;
+	GdkPoint *shape_points;
+	int i = 0;
+
+	gtk_widget_realize(nw);
+	gtk_widget_size_request(nw, &req);
+
+	screen        = gdk_drawable_get_screen(GDK_DRAWABLE(nw->window));
+	screen_width  = gdk_screen_get_width(screen);
+	screen_height = gdk_screen_get_height(screen);
+
+	if (windata->border_points != NULL)
+		g_free(windata->border_points);
+
+	windata->num_border_points = 5;
+
+	if (windata->point_y + req.height + DEFAULT_ARROW_HEIGHT > screen_height)
+		arrow_type = GTK_ARROW_DOWN;
+	else
+		arrow_type = GTK_ARROW_UP;
+
+	/* Handle the offset and such */
+	switch (arrow_type)
+	{
+		case GTK_ARROW_UP:
+		case GTK_ARROW_DOWN:
+			if (windata->point_x < arrow_side1_width)
+			{
+				arrow_side1_width = 0;
+				arrow_offset = 0;
+			}
+			else if (windata->point_x > screen_width - arrow_side2_width)
+			{
+				arrow_side2_width = 0;
+				arrow_offset = req.width - arrow_side1_width;
+			}
+			else
+			{
+				if (windata->point_x - arrow_side2_width + req.width >=
+					screen_width)
+				{
+					arrow_offset =
+						req.width - arrow_side1_width - arrow_side2_width -
+						(screen_width - MAX(windata->point_x +
+											arrow_side1_width,
+											screen_width -
+											DEFAULT_ARROW_OFFSET));
+				}
+				else
+				{
+					arrow_offset = MIN(windata->point_x - arrow_side1_width,
+									   DEFAULT_ARROW_OFFSET);
+				}
+
+				if (arrow_offset == 0 ||
+					arrow_offset == req.width - arrow_side1_width)
+					windata->num_border_points++;
+				else
+					windata->num_border_points += 2;
+			}
+
+			/*
+			 * Why risk this for official builds? If it's somehow off the
+			 * screen, it won't horribly impact the user. Definitely less
+			 * than an assertion would...
+			 */
+#if 0
+			g_assert(arrow_offset + arrow_side1_width >= 0);
+			g_assert(arrow_offset + arrow_side1_width + arrow_side2_width <=
+					 req.width);
+#endif
+
+			windata->border_points = g_new0(GdkPoint,
+											windata->num_border_points);
+			shape_points = g_new0(GdkPoint, windata->num_border_points);
+
+			windata->drawn_arrow_begin_x = arrow_offset;
+			windata->drawn_arrow_middle_x = arrow_offset + arrow_side1_width;
+			windata->drawn_arrow_end_x = arrow_offset + arrow_side1_width +
+										 arrow_side2_width;
+
+			if (arrow_type == GTK_ARROW_UP)
+			{
+				gtk_widget_show(windata->top_spacer);
+				windata->drawn_arrow_begin_y = DEFAULT_ARROW_HEIGHT;
+				windata->drawn_arrow_middle_y = 0;
+				windata->drawn_arrow_end_y = DEFAULT_ARROW_HEIGHT;
+
+				if (arrow_side1_width == 0)
+				{
+					ADD_POINT(0, 0, 0, 0);
+				}
+				else
+				{
+					ADD_POINT(0, DEFAULT_ARROW_HEIGHT, 0, 0);
+
+					if (arrow_offset > 0)
+						ADD_POINT(arrow_offset -
+								  (arrow_side2_width > 0 ? 0 : 1),
+								  DEFAULT_ARROW_HEIGHT, 0, 0);
+
+					ADD_POINT(arrow_offset + arrow_side1_width -
+							  (arrow_side2_width > 0 ? 0 : 1),
+							  0, 0, 0);
+				}
+
+				if (arrow_side2_width > 0)
+				{
+					ADD_POINT(windata->drawn_arrow_end_x,
+							  windata->drawn_arrow_end_y, 1, 0);
+					ADD_POINT(req.width - 1, DEFAULT_ARROW_HEIGHT, 1, 0);
+				}
+
+				ADD_POINT(req.width - 1,
+						  req.height + DEFAULT_ARROW_HEIGHT - 1, 1, 1);
+				ADD_POINT(0, req.height + DEFAULT_ARROW_HEIGHT - 1, 0, 1);
+			}
+			else
+			{
+				gtk_widget_show(windata->bottom_spacer);
+				windata->drawn_arrow_begin_y = req.height;
+				windata->drawn_arrow_middle_y = req.height +
+				                                DEFAULT_ARROW_HEIGHT;
+				windata->drawn_arrow_end_y = req.height;
+
+				ADD_POINT(0, 0, 0, 0);
+				ADD_POINT(req.width - 1, 0, 1, 0);
+
+				if (arrow_side2_width == 0)
+				{
+					ADD_POINT(req.width - 1,
+							  req.height + DEFAULT_ARROW_HEIGHT,
+							  (arrow_side1_width > 0 ? 0 : 1), 0);
+				}
+				else
+				{
+					ADD_POINT(req.width - 1, req.height, 1, 1);
+
+					if (arrow_offset < req.width - arrow_side1_width)
+					{
+						ADD_POINT(arrow_offset + arrow_side1_width +
+								  arrow_side2_width, req.height, 0, 1);
+					}
+
+					ADD_POINT(arrow_offset + arrow_side1_width,
+							  req.height + DEFAULT_ARROW_HEIGHT, 0, 1);
+				}
+
+				if (arrow_side1_width > 0)
+				{
+					ADD_POINT(windata->drawn_arrow_begin_x -
+							  (arrow_side2_width > 0 ? 0 : 1),
+							  windata->drawn_arrow_begin_y, 0, 0);
+					ADD_POINT(0, req.height, 0, 1);
+				}
+			}
+
+#if 0
+			g_assert(i == windata->num_border_points);
+			g_assert(windata->point_x - arrow_offset - arrow_side1_width >= 0);
+#endif
+			gtk_window_move(GTK_WINDOW(nw),
+							windata->point_x - arrow_offset -
+							arrow_side1_width,
+							(arrow_type == GTK_ARROW_UP
+							 ? windata->point_y
+							 : windata->point_y - req.height -
+							   DEFAULT_ARROW_HEIGHT));
+
+			break;
+
+		case GTK_ARROW_LEFT:
+		case GTK_ARROW_RIGHT:
+			if (windata->point_y < arrow_side1_width)
+			{
+				arrow_side1_width = 0;
+				arrow_offset = windata->point_y;
+			}
+			else if (windata->point_y > screen_height - arrow_side2_width)
+			{
+				arrow_side2_width = 0;
+				arrow_offset = windata->point_y - arrow_side1_width;
+			}
+			break;
+	}
+
+	windata->window_region =
+		gdk_region_polygon(shape_points, windata->num_border_points,
+						   GDK_EVEN_ODD_RULE);
+	g_free(shape_points);
+
+	draw_border(nw, NULL, windata);
+}
+
+void
+move_notification(GtkWindow *nw, int x, int y)
+{
+	WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");
+	g_assert(windata != NULL);
+
+	if (windata->has_arrow)
+	{
+		create_border_with_arrow(GTK_WIDGET(nw), windata);
+	}
+	else
+	{
+		gtk_window_move(GTK_WINDOW(nw), x, y);
+	}
+}
+
+void
+get_theme_info(char **theme_name,
+			   char **theme_ver,
+			   char **author,
+			   char **homepage)
+{
+	*theme_name = g_strdup("Standard");
+	*theme_ver  = g_strdup_printf("%d.%d.%d",
+								  NOTIFICATION_DAEMON_MAJOR_VERSION,
+								  NOTIFICATION_DAEMON_MINOR_VERSION,
+								  NOTIFICATION_DAEMON_MICRO_VERSION);
+	*author = g_strdup("Christian Hammond");
+	*homepage = g_strdup("http://www.galago-project.org/");
+}
+
+gboolean
+theme_check_init(unsigned int major_ver, unsigned int minor_ver,
+				 unsigned int micro_ver)
+{
+	return major_ver == NOTIFICATION_DAEMON_MAJOR_VERSION &&
+	       minor_ver == NOTIFICATION_DAEMON_MINOR_VERSION &&
+	       micro_ver == NOTIFICATION_DAEMON_MICRO_VERSION;
+}


Property changes on: notification-daemon-xfce/trunk/themes/standard/theme.c
___________________________________________________________________
Name: svn:keywords
   + Id




More information about the Goodies-commits mailing list