Exemplo n.º 1
0
static VALUE
rbglib_m_get_package_installation_subdirectory(VALUE self, VALUE package, VALUE dll_name, VALUE subdir)
{
	return CSTR2RVAL_FREE(g_win32_get_package_installation_subdirectory(RVAL2CSTR(package), 
	                                                                RVAL2CSTR(dll_name),
	                                                                RVAL2CSTR(subdir)));
}
Exemplo n.º 2
0
G_CONST_RETURN char *
pangolite_get_sysconf_subdirectory (void)
{
#ifdef G_OS_WIN32
  static gchar *result = NULL;

  if (result == NULL)
    result = g_win32_get_package_installation_subdirectory
      ("pangolite", g_strdup_printf ("pangolite-%s.dll", PANGO_VERSION), "etc\\pangolite");

  return result;
  // Am open to any other way of doing this
  // Bottomline : need to provide path to pango.modules
  /* Currently set to dist/bin - Am open to other location */
#else
  char *tmp = getenv("MOZILLA_FIVE_HOME");
  return tmp;
#endif
}
Exemplo n.º 3
0
G_CONST_RETURN char *
pangolite_get_lib_subdirectory (void)
{
#ifdef G_OS_WIN32
  static gchar *result = NULL;

  if (result == NULL)
    result = g_win32_get_package_installation_subdirectory
      ("pangolite", g_strdup_printf ("pangolite-%s.dll", PANGO_VERSION), "lib\\pangolite");

  return result;
  // Open to any other way of doing this
  // Bottomline : need to provide path to pangolite libraries
  // Currently set to dist/bin - Open to other locations
#else
  char *tmp = getenv("MOZILLA_FIVE_HOME");
  return tmp;
  /*  return "/home/prabhath/PROJ/opt/lib"; */
#endif
}
Exemplo n.º 4
0
MapeEditView* mape_edit_view_new(MapePreView* pre_view,
                                 MapeStatusbar* statusbar,
                                 GError** error)
{
	MapeEditView* view;
	GtkSourceBuffer* buf;
	GPtrArray* search_dirs;
	const gchar* const* data_dirs;
	const gchar* const* dir;

	view = malloc(sizeof(MapeEditView) );
	view->pre_view = pre_view;
	view->statusbar = statusbar;
	view->file_path = NULL;
	view->encoding = "UTF-8";
	view->type = MAPE_MAPGEN_NONE;
	view->render_thread = NULL;
	view->rerender = FALSE;
	view->fixed_seed = FALSE;

	view->view = gtk_source_view_new();
	buf = GTK_SOURCE_BUFFER(
		gtk_text_view_get_buffer(GTK_TEXT_VIEW(view->view) )
	);

	g_signal_connect_after(
		G_OBJECT(buf),
		"changed",
		G_CALLBACK(mape_edit_view_cb_changed),
		view
	);

	g_signal_connect(
		G_OBJECT(pre_view->event_box),
		"button-press-event",
		G_CALLBACK(mape_edit_view_cb_update),
		view
	);

	view->font_desc = pango_font_description_new();
	pango_font_description_set_family(view->font_desc, "monospace");
	gtk_widget_modify_font(view->view, view->font_desc);

	search_dirs = g_ptr_array_new();
#ifdef G_OS_WIN32
	g_ptr_array_add(
		search_dirs,
		g_win32_get_package_installation_subdirectory(NULL, NULL, "mape-syntax")
	);
#endif

	g_ptr_array_add(
		search_dirs,
		g_build_filename(g_get_home_dir(), ".mape-syntax", NULL)
	);

	g_ptr_array_add(
		search_dirs,
		g_strdup("./mape-syntax")
	);

	g_ptr_array_add(
		search_dirs,
		g_strdup("./src/mape/mape-syntax")
	);

	data_dirs = g_get_system_data_dirs();
	for(dir = data_dirs; *dir != NULL; ++ dir)
		g_ptr_array_add(search_dirs, g_build_filename(*dir, "mape", NULL));
	g_ptr_array_add(search_dirs, NULL);

	view->lang_manager = gtk_source_language_manager_new();
	gtk_source_language_manager_set_search_path(
		view->lang_manager,
		(gchar**)search_dirs->pdata
	);

	view->style_manager = gtk_source_style_scheme_manager_new();
	gtk_source_style_scheme_manager_set_search_path(
	  view->style_manager,
	  (gchar**)search_dirs->pdata
	);

	g_ptr_array_foreach(search_dirs, (GFunc)g_free, NULL);
	g_ptr_array_free(search_dirs, TRUE);

	mape_edit_view_set_filename(view, NULL);

	gtk_widget_show(view->view);
	
	view->window = gtk_scrolled_window_new(NULL, NULL);
	
	gtk_scrolled_window_set_policy(
		GTK_SCROLLED_WINDOW(view->window),
		GTK_POLICY_AUTOMATIC,
		GTK_POLICY_AUTOMATIC
	);
	
	gtk_scrolled_window_set_shadow_type(
		GTK_SCROLLED_WINDOW(view->window),
		GTK_SHADOW_IN
	);
	
	gtk_container_add(
		GTK_CONTAINER(view->window),
		view->view
	);

	gtk_widget_show(view->window);
	return view;
}
Exemplo n.º 5
0
void
gkrellm_plugins_load(void)
	{
	GkrellmMonitor	*m;
	gchar			*path;

	if (_GK.command_line_plugin)
		{
		if (   *_GK.command_line_plugin != '.'
			&& !strchr(_GK.command_line_plugin, G_DIR_SEPARATOR)
		   )
			path = g_strconcat(".", G_DIR_SEPARATOR_S,
						_GK.command_line_plugin, NULL);
		else
			path = g_strdup(_GK.command_line_plugin);
		plugin_log(_("*** Command line plugin:\n"), NULL);
		if ((m = install_plugin(path)) == NULL)
			g_free(path);
		else
			{
			m->privat->from_command_line = TRUE;
			plugins_list = g_list_append(plugins_list, m);
			}
		plugin_log("\n", NULL);
		}
	load_plugins_enable_file();
	load_plugins_placement_file();
	path = g_strconcat(gkrellm_homedir(), G_DIR_SEPARATOR_S,
				GKRELLM_PLUGINS_DIR, NULL);
	scan_for_plugins(path);
	g_free(path);

#if defined(WIN32)
	path = NULL;
#if GLIB_CHECK_VERSION(2,16,0)
	gchar *install_path;
	install_path = g_win32_get_package_installation_directory_of_module(NULL);
	if (install_path != NULL)
		{
		path = g_build_filename(install_path, "lib", "gkrellm2", "plugins", NULL);
		g_free(install_path);
		}
#else
	// deprecated since glib 2.16.0
	path = g_win32_get_package_installation_subdirectory(NULL, NULL, "lib/gkrellm2/plugins");
#endif
	if (path)
		{
		scan_for_plugins(path);
		g_free(path);
		}
#endif


#if defined(LOCAL_PLUGINS_DIR)
	scan_for_plugins(LOCAL_PLUGINS_DIR);
#endif

#if defined(SYSTEM_PLUGINS_DIR)
	scan_for_plugins(SYSTEM_PLUGINS_DIR);
#endif
	}