Advertisement
dsreyes1014

main.c, driver_alsa_names.c source

Apr 16th, 2014
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. /* MAIN.C */
  2. #include <gtk/gtk.h>
  3.  
  4. #include "server_switch.h"
  5. #include "rt_box.h"
  6.  
  7. void
  8. print_driver_cb (GSimpleAction *action, GVariant *variant, gpointer data)
  9. {
  10. g_print ("Hello");
  11. }
  12.  
  13. const GActionEntry app_actions[] =
  14. {
  15. {"print_driver", print_driver_cb}
  16. };
  17.  
  18. void
  19. run_app (GApplication *app, gpointer data)
  20. {
  21. GtkWidget *window;
  22. GtkWidget *box;
  23.  
  24. window = gtk_application_window_new (GTK_APPLICATION (app));
  25. box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 18);
  26.  
  27. g_action_map_add_action_entries (G_ACTION_MAP (app), app_actions, G_N_ELEMENTS (app_actions), app);
  28.  
  29. server_switch (box);
  30. rt_box (box);
  31.  
  32. gtk_widget_set_size_request (window, 500, 250);
  33. gtk_window_set_title (GTK_WINDOW (window), "GJackCtl");
  34.  
  35. gtk_container_add (GTK_CONTAINER (window), box);
  36.  
  37. gtk_widget_show_all (window);
  38. }
  39.  
  40. int
  41. main (int argc, char *argv[])
  42. {
  43. GtkApplication *app;
  44. int status;
  45.  
  46. app = gtk_application_new ("org.gnome.gjackctl", G_APPLICATION_FLAGS_NONE);
  47.  
  48. g_signal_connect (app, "activate", G_CALLBACK (run_app), NULL);
  49.  
  50. status = g_application_run (G_APPLICATION (app), argc, argv);
  51.  
  52. g_object_unref (app);
  53.  
  54. return status;
  55. }
  56.  
  57. /* DRIVER_ALSA_NAMES.C */
  58.  
  59. /* Pack `submenu` with alsa names. */
  60. if (card == 0)
  61. {
  62. GMenuItem *item1;
  63.  
  64. item1 = g_menu_item_new (card_name, "print_driver");
  65. g_menu_insert_item (submenu, 0, item1);
  66. }
  67.  
  68. if (card == 1)
  69. {
  70. GMenuItem *item2;
  71.  
  72. item2 = g_menu_item_new (card_name, "print_driver");
  73. g_menu_insert_item (submenu, 1, item2);
  74. }
  75.  
  76. if (card == 2)
  77. {
  78. GMenuItem *item3;
  79.  
  80. item3 = g_menu_item_new (card_name, "print_driver");
  81. g_menu_insert_item (submenu, 2, item3);
  82. }
  83.  
  84. if (card == 3)
  85. {
  86. GMenuItem *item4;
  87.  
  88. item4 = g_menu_item_new (card_name, "print_driver");
  89. g_menu_insert_item (submenu, 3, item4);
  90. }
  91.  
  92. if (card == 4)
  93. {
  94. GMenuItem *item5;
  95.  
  96. item5 = g_menu_item_new (card_name, "print_driver");
  97. g_menu_insert_item (submenu, 4, item5);
  98. }
  99.  
  100. if (card == 5)
  101. {
  102. GMenuItem *item6;
  103.  
  104. item6 = g_menu_item_new (card_name, "print_driver");
  105. g_menu_insert_item (submenu, 5, item6);
  106. }
  107.  
  108. if (card == 6)
  109. {
  110. GMenuItem *item7;
  111.  
  112. item7 = g_menu_item_new (card_name, "print_driver");
  113. g_menu_insert_item (submenu, 6, item7);
  114. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement