]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/dual-decode.git/blobdiff - include/gui.h
Modified in acordance to coding guidelines.
[glsdk/dual-decode.git] / include / gui.h
index 4662a71bfb63c6aa9a3c0c61024cbfd538e7a7ea..f9374c11fb0a4fdd88b24096b821c3f6cc81e32a 100644 (file)
 \r
 #include <gtk/gtk.h>\r
 #include <gst/gst.h>\r
+\r
 /******************************************************************************\r
\r
+                        Public functions declarations\r
\r
+******************************************************************************/\r
+\r
+/**\r
+ *     @brief                  initialises GTK if X is present\r
+ *\r
+ *     @param[in,out] argc             number of command line arguments\r
+ *     @param[in,out] argv             command line arguments\r
+ *\r
+ *     @return                 TRUE if X present, FALSE otherwise              \r
+ *\r
+ *     Called From             main()\r
+ */\r
+gboolean DualDecode_initGUI(gint *argc, char **argv[]);\r
+\r
+/**\r
+ *     @brief                  start the application\r
+ *\r
+ *     Called From             main()\r
+ */\r
+void DualDecode_startApplication();\r
+\r
+/**\r
+ *     @brief                  stop the application and return to main()\r
+ *\r
+ *     Called From             delete-event handlers of the windows\r
+ */\r
+void DualDecode_exitApplication();\r
+\r
+/******************************************************************************\r
\r
+                         Structure Definitions\r
\r
+*****************************************************************************/\r
+\r
+/**\r
  *     @brief                  This structure defines all the components and the signals\r
  *                                     for a Dual-Decode GUI window. There will be two such\r
  *                                     windows when the application is running \r
- ******************************************************************************/\r
+ */\r
 typedef struct{\r
 \r
        /*The Window and its delete-event signal handler*/\r
@@ -74,7 +113,7 @@ typedef struct{
        GtkWidget *openButton;\r
        gulong openSignal;\r
 \r
-       /*media control buttons and clicked signal handlers*/\r
+       /*Media control buttons and clicked signal handlers*/\r
        GtkWidget *playButton;\r
        gulong playSignal;\r
        GtkWidget *pauseButton;\r
@@ -110,75 +149,28 @@ typedef struct{
        gint modeFlag;\r
 } GUIWindow;\r
 \r
-/*To index the static GUIWindow and Pipeline structures                        */\r
-/*There are two of them, since it is a dual-decode application */\r
-#define DECODER_INDEX_SINGLE 0\r
-#define DECODER_INDEX_DOUBLE 1\r
-\r
-/*ratio of screen size per window*/\r
-#define SCREEN_WIDTH_FACTOR 3\r
-#define SCREEN_HEIGHT_FACTOR 2\r
-\r
-/*Whether the control buttons are active*/\r
-#define CONTROL_MODE_ACTIVE TRUE\r
-#define CONTROL_MODE_INACTIVE FALSE\r
-\r
-#define CONTROL_MODE_STOPPED 0\r
-#define CONTROL_MODE_PLAYING 1\r
-#define CONTROL_MODE_PAUSED 2\r
-#define CONTROL_MODE_NO_FILE 4\r
-\r
-#define LABEL_TEXT_NO_FILE "No File"\r
-#define LABEL_TEXT_PLAYING "Playing"\r
-#define LABEL_TEXT_STOPPED "Stopped"\r
-#define LABEL_TEXT_PAUSED "Paused"\r
-\r
-#define TIME_LABEL_ORIGIN "--:--:--/--:--:--"\r
-\r
-#define FORWARD 3000000000\r
-#define REWIND 3000000000\r
-#define SWITCH_TEXT_SINGLE "Single Decode"\r
-#define SWITCH_TEXT_DUAL "Dual Decode"\r
-\r
-#define TIMER_INTERVAL 1000\r
-#define TIMER_SIGNAL_NONE 0\r
-\r
-/******************************************************************************\r
- *     @brief                  initialises GTK if X is present\r
- *\r
- *     @param[in,out] argc             number of command line arguments\r
- *     @param[in,out] argv             command line arguments\r
- *\r
- *     @return                 TRUE if X present, FALSE otherwise              \r
- *\r
- *     Called From             main()\r
- ******************************************************************************/\r
-gboolean DualDecode_initGUI(gint *argc, char **argv[]);\r
 \r
-/******************************************************************************\r
- *     @brief                  start the application\r
- *\r
- *     Called From             main()\r
- ******************************************************************************/\r
-void DualDecode_startApplication();\r
 \r
 /******************************************************************************\r
- *     @brief                  stop the application and return to main()\r
- *\r
- *     Called From             delete-event handlers of the windows\r
- ******************************************************************************/\r
-void DualDecode_exitApplication();\r
\r
+              Statically used variables per GUI component file\r
 \r
-/*The glade file to import widgets from*/\r
-#define GLADE_FILE "res/gui.xml"\r
+ *****************************************************************************/\r
 \r
-/*statically used variables per GUI component file*/\r
 static GError *error                   = NULL;\r
 static GtkBuilder *builder             = NULL;\r
 \r
-/*report and then free the error, if error is not NULL*/\r
-/*This function is called when a NULL is returned from*/\r
-/*an allocation function                              */\r
+/******************************************************************************\r
\r
+                        Static Inline functions\r
\r
+*****************************************************************************/\r
+\r
+/**\r
+ * Report and then free the error, if error is not NULL\r
+ *This function is called when a NULL is returned from\r
+ *an allocation function\r
+ */                              \r
 static inline void DualDecode_checkError(){\r
        if(NULL == error){\r
                g_printerr("GError Report : Unknown error\n");\r
@@ -213,17 +205,19 @@ static inline GtkWidget *DualDecode_getWidget(const char *widget) {
        return retWidget;\r
 }\r
 \r
-/* get a widget exclusively from the builder                      */\r
-/* this will let the application create two instances             */\r
-/* of a widget defined in the glade file.                         */\r
-/*                                                                */\r
-/* For example : this macro can be used like -                    */\r
-/*                                                                */\r
-/* widget0 = DualDecode_getWidgetExclusive("applicationWindow")   */\r
-/* widget1 = DualDecode_getWidgetExclusive("applicationWindow")   */\r
-/*                                                                */\r
-/* this will create two different widgets with the same           */\r
-/* look and feel                                                  */\r
+/**\r
+ * Get a widget exclusively from the builder                      \r
+ * this will let the application create two instances             \r
+ * of a widget defined in the glade file.                         \r
+ *                                                                \r
+ * For example : this macro can be used like -                    \r
+ *                                                                \r
+ * widget0 = DualDecode_getWidgetExclusive("applicationWindow")   \r
+ * widget1 = DualDecode_getWidgetExclusive("applicationWindow")   \r
+ *                                                                \r
+ * this will create two different widgets with the same           \r
+ * look and feel                                                  \r
+ */\r
 \r
 static inline GtkWidget *DualDecode_getWidgetExclusive(const char *widget) {\r
        GtkWidget *retWidget = NULL;\r
@@ -232,4 +226,46 @@ static inline GtkWidget *DualDecode_getWidgetExclusive(const char *widget) {
        DualDecode_builderClose();\r
        return retWidget;\r
 }\r
+/******************************************************************************\r
+\r
+                                Macros\r
+\r
+ *****************************************************************************/\r
+/*To index the static GUIWindow and Pipeline structures                        */\r
+/*There are two of them, since it is a dual-decode application */\r
+#define DECODER_INDEX_SINGLE 0\r
+#define DECODER_INDEX_DOUBLE 1\r
+\r
+/*ratio of screen size per window*/\r
+#define SCREEN_WIDTH_FACTOR 3\r
+#define SCREEN_HEIGHT_FACTOR 2\r
+\r
+/*Whether the control buttons are active*/\r
+#define CONTROL_MODE_ACTIVE TRUE\r
+#define CONTROL_MODE_INACTIVE FALSE\r
+\r
+#define CONTROL_MODE_STOPPED 0\r
+#define CONTROL_MODE_PLAYING 1\r
+#define CONTROL_MODE_PAUSED 2\r
+#define CONTROL_MODE_NO_FILE 4\r
+\r
+#define LABEL_TEXT_NO_FILE "No File"\r
+#define LABEL_TEXT_PLAYING "Playing"\r
+#define LABEL_TEXT_STOPPED "Stopped"\r
+#define LABEL_TEXT_PAUSED "Paused"\r
+\r
+#define TIME_LABEL_ORIGIN "--:--:--/--:--:--"\r
+\r
+#define FORWARD 3000000000\r
+#define REWIND 3000000000\r
+#define SWITCH_TEXT_SINGLE "Single Decode"\r
+#define SWITCH_TEXT_DUAL "Dual Decode"\r
+\r
+#define TIMER_INTERVAL 1000\r
+#define TIMER_SIGNAL_NONE 0\r
+\r
+/*The glade file to import widgets from*/\r
+#define GLADE_FILE "res/gui.xml"\r
+\r
+\r
 #endif /*__GUI_H__*/\r