ekiga r6475 - trunk/lib/gui



Author: jpuydt
Date: Sun Jul 20 14:01:11 2008
New Revision: 6475
URL: http://svn.gnome.org/viewvc/ekiga?rev=6475&view=rev

Log:
Moved the smileys to a centralized place so we use the same everywhere in ekiga

Added:
   trunk/lib/gui/gm-smileys.c
   trunk/lib/gui/gm-smileys.h
Modified:
   trunk/lib/gui/Makefile.am
   trunk/lib/gui/gm-text-smiley.c

Modified: trunk/lib/gui/Makefile.am
==============================================================================
--- trunk/lib/gui/Makefile.am	(original)
+++ trunk/lib/gui/Makefile.am	Sun Jul 20 14:01:11 2008
@@ -3,6 +3,8 @@
 noinst_LTLIBRARIES = libgmwidgets.la
 
 libgmwidgets_la_SOURCES =	\
+	gm-smileys.h		\
+	gm-smileys.c		\
 	gmwindow.c		\
 	gmwindow.h		\
 	gmconfwidgets.c		\

Added: trunk/lib/gui/gm-smileys.c
==============================================================================
--- (empty file)
+++ trunk/lib/gui/gm-smileys.c	Sun Jul 20 14:01:11 2008
@@ -0,0 +1,65 @@
+
+/* Ekiga -- A VoIP and Video-Conferencing application
+ * Copyright (C) 2000-2008 Damien Sandras
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *
+ * Ekiga is licensed under the GPL license and as a special exception,
+ * you have permission to link or otherwise combine this program with the
+ * programs OPAL, OpenH323 and PWLIB, and distribute the combination,
+ * without applying the requirements of the GNU GPL to the OPAL, OpenH323
+ * and PWLIB programs, as long as you do follow the requirements of the
+ * GNU GPL for all the rest of the software thus combined.
+ */
+
+
+/*
+ *                        gm-smileys.c  -  description
+ *                         --------------------------------
+ *   begin                : written in july 2008 by Julien Puydt
+ *   copyright            : (C) 2008 by Julien Puydt
+ *   description          : Implementation of the centralized smileys
+ *
+ */
+
+#include "gm-smileys.h"
+
+/* here are the smileys */
+static const char* smileys[] = {
+  /* smiley, pixbux */
+  "0:-)", "face-angel",
+  "B-)", "face-cool",
+  ":'-(", "face-crying",
+  ":-[", "face-embarrassed",
+  ">:-)", "face-devilish",
+  ":-*", "face-kiss",
+  ":-(|)", "face-monkey",
+  ":-|", "face-plain",
+  ":-P", "face-raspberry",
+  ":-(", "face-sad",
+  ":-)", "face-smile",
+  ":-D", "face-smile-big",
+  ":-!", "face-smirk",
+  ":-O", "face-surprise",
+  ";-)", "face-wink",
+  NULL
+};
+
+const char**
+gm_get_smileys ()
+{
+  return smileys;
+}

Added: trunk/lib/gui/gm-smileys.h
==============================================================================
--- (empty file)
+++ trunk/lib/gui/gm-smileys.h	Sun Jul 20 14:01:11 2008
@@ -0,0 +1,56 @@
+
+/* Ekiga -- A VoIP and Video-Conferencing application
+ * Copyright (C) 2000-2008 Damien Sandras
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *
+ * Ekiga is licensed under the GPL license and as a special exception,
+ * you have permission to link or otherwise combine this program with the
+ * programs OPAL, OpenH323 and PWLIB, and distribute the combination,
+ * without applying the requirements of the GNU GPL to the OPAL, OpenH323
+ * and PWLIB programs, as long as you do follow the requirements of the
+ * GNU GPL for all the rest of the software thus combined.
+ */
+
+
+/*
+ *                        gm-smileys.h  -  description
+ *                         --------------------------------
+ *   begin                : written in july 2008 by Julien Puydt
+ *   copyright            : (C) 2008 by Julien Puydt
+ *   description          : Declaration of the centralized smileys
+ *
+ */
+
+#ifndef __GM_SMILEY_H__
+#define __GM_SMILEY_H__
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+/* This function returns ekiga's known smileys,
+ * in the form of a NULL-terminated list of strings, like :
+ * smiley1, pixbuf1,
+ * smiley2, pixbuf2,
+ * ...
+ * NULL;
+ */
+const char** gm_get_smileys ();
+
+G_END_DECLS
+
+#endif

Modified: trunk/lib/gui/gm-text-smiley.c
==============================================================================
--- trunk/lib/gui/gm-text-smiley.c	(original)
+++ trunk/lib/gui/gm-text-smiley.c	Sun Jul 20 14:01:11 2008
@@ -37,28 +37,9 @@
 
 #include "gm-text-smiley.h"
 
-#include <string.h>
+#include "gm-smileys.h"
 
-/* here are the smileys */
-static const char* smileys[] = {
-  /* smiley, pixbux */
-  "0:-)", "face-angel",
-  "B-)", "face-cool",
-  ":'-(", "face-crying",
-  ":-[", "face-embarassed",
-  ">:-)", "face-devilish",
-  ":-*", "face-kiss",
-  ":-(|)", "face-monkey",
-  ":-|", "face-plain",
-  ":-P", "face-raspberry",
-  ":-(", "face-sad",
-  ":-)", "face-smile",
-  ":-D", "face-smile-big",
-  ":-!", "face-smirk",
-  ":-O", "face-surprise",
-  ";-)", "face-wink",
-  NULL
-};
+#include <string.h>
 
 static GObjectClass* parent_class = NULL;
 
@@ -90,6 +71,7 @@
 		       gint* start,
 		       gint* length)
 {
+  const gchar **smileys = gm_get_smileys ();
   gint smiley = 0;
   gint best_start = 0;
   gint best_smiley = -1;
@@ -132,6 +114,7 @@
 			 gint* start,
 			 gint length)
 {
+  const gchar **smileys = gm_get_smileys ();
   gchar* smiley = NULL;
   gint ii = 0;
   const gchar* pixbuf_name = NULL;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]