예제 #1
0
static void
language_css_init (Language_CSS * object)
{
    Language_CSSDetails *lgcssdet;
    lgcssdet = LANGUAGE_CSS_GET_PRIVATE(object);
    lgcssdet->prefmg = preferences_manager_new ();
    lgcssdet->symbolmg = symbol_manager_new ();
}
예제 #2
0
static void
language_cobol_init (Language_COBOL * object)
{
  Language_COBOLDetails *lgcoboldet;
  lgcoboldet = LANGUAGE_COBOL_GET_PRIVATE(object);
  lgcoboldet->prefmg = preferences_manager_new ();
  lgcoboldet->symbolmg = symbol_manager_new ();
}
예제 #3
0
void main_window_create(char **argv, gint argc)
{
  main_window.is_app_closing = FALSE;
  main_window.prefmg = preferences_manager_new();
  main_window.tempmg = templates_manager_new();

  create_app_main_window(&main_window, _("gPHPEdit"));

  main_window.pbuilder = gtk_builder_new ();
  GError *error = NULL;
  guint res = gtk_builder_add_from_file (main_window.pbuilder, GPHPEDIT_UI_DIR "/gphpedit.ui", &error);
  if (!res) {
    g_critical ("Unable to load the UI file!");
    g_error_free(error);
    return ;
  }

  GtkWidget *prinbox = get_widget_from_builder(&main_window, "prinbox");
  gtk_widget_reparent (prinbox, GTK_WIDGET(main_window.window));

  /* add menu bar to main window */
  GtkWidget *menubox = get_widget_from_builder(&main_window, "menubox");
  gtk_widget_show (menubox);

  main_window.pmenu_hints = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, NULL);

  main_window.pmenu = menubar_new (&main_window);
  gtk_box_pack_start (GTK_BOX (menubox), main_window.pmenu, FALSE, FALSE, 0);
  gtk_widget_show_all (main_window.pmenu);

  GtkWidget *toolbox = get_widget_from_builder(&main_window, "toolbox");
  gtk_widget_show (toolbox);

  main_window.toolbar_main = toolbar_new (&main_window);
  gtk_box_pack_start (GTK_BOX (toolbox), main_window.toolbar_main, FALSE, FALSE, 0);
  if (get_preferences_manager_show_maintoolbar(main_window.prefmg)) gtk_widget_show (main_window.toolbar_main);

  main_window.symbolmg = symbol_manager_new();

  main_window_create_panes(&main_window);
  main_window_fill_panes(&main_window);
  main_window_create_appbar(&main_window);
  
  g_signal_connect (G_OBJECT (main_window.window), "delete_event", G_CALLBACK(main_window_delete_event), &main_window);
  g_signal_connect (G_OBJECT (main_window.window), "destroy", G_CALLBACK (main_window_destroy_event), &main_window);
  g_signal_connect (G_OBJECT (main_window.window), "key_press_event", G_CALLBACK (main_window_key_press_event), &main_window);
  g_signal_connect (G_OBJECT (main_window.window), "size_allocate", G_CALLBACK (main_window_resize), &main_window);
  g_signal_connect (G_OBJECT (main_window.window), "window-state-event", G_CALLBACK (main_window_state_changed), &main_window);
  g_signal_connect (G_OBJECT (main_window.window), "focus-in-event", G_CALLBACK (main_window_activate_focus), &main_window);

  main_window.stylemg = gtk_source_style_scheme_manager_new ();
  gchar *theme_dir = g_build_path (G_DIR_SEPARATOR_S, API_DIR, "themes", NULL);
  gtk_source_style_scheme_manager_prepend_search_path (main_window.stylemg, theme_dir);
  g_free(theme_dir);

  main_window.docmg = document_manager_new_full(argv, argc, &main_window);
  g_signal_connect (G_OBJECT (main_window.docmg), "new_document", G_CALLBACK(document_manager_new_document_cb), &main_window);
  g_signal_connect (G_OBJECT (main_window.docmg), "change_document", G_CALLBACK(document_manager_change_document_cb), &main_window);
  g_signal_connect (G_OBJECT (main_window.docmg), "close_document", G_CALLBACK(document_manager_close_document_cb), &main_window);
  g_signal_connect (G_OBJECT (main_window.docmg), "zoom_change", G_CALLBACK(document_manager_zoom_change_cb), &main_window);

  /* create side panel */
  create_side_panel(&main_window);

  update_app_title(&main_window, document_manager_get_current_documentable(main_window.docmg));

  gtk_widget_show(main_window.window);
}