static void em_junk_sa_init (void) { pthread_mutex_lock (&em_junk_sa_init_lock); if (!em_junk_sa_gconf) { em_junk_sa_gconf = gconf_client_get_default(); gconf_client_add_dir (em_junk_sa_gconf, "/apps/evolution/mail/junk/sa", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); em_junk_sa_local_only = gconf_client_get_bool (em_junk_sa_gconf, "/apps/evolution/mail/junk/sa/local_only", NULL); em_junk_sa_use_daemon = gconf_client_get_bool (em_junk_sa_gconf, "/apps/evolution/mail/junk/sa/use_daemon", NULL); pthread_mutex_lock (&em_junk_sa_preferred_socket_path_lock); g_free (em_junk_sa_preferred_socket_path); em_junk_sa_preferred_socket_path = gconf_client_get_string (em_junk_sa_gconf, "/apps/evolution/mail/junk/sa/socket_path", NULL); pthread_mutex_unlock (&em_junk_sa_preferred_socket_path_lock); gconf_client_notify_add(em_junk_sa_gconf, "/apps/evolution/mail/junk/sa", (GConfClientNotifyFunc)em_junk_sa_setting_notify, NULL, NULL, NULL); em_junk_sa_spamc_gconf_binary = gconf_client_get_string (em_junk_sa_gconf, "/apps/evolution/mail/junk/sa/spamc_binary", NULL); em_junk_sa_spamd_gconf_binary = gconf_client_get_string (em_junk_sa_gconf, "/apps/evolution/mail/junk/sa/spamd_binary", NULL); } pthread_mutex_unlock (&em_junk_sa_init_lock); atexit (em_junk_sa_finalize); }
static void set_proxy_auth(gboolean use_proxy_auth) { char *auth_user; char *auth_pw; auth_user = gconf_client_get_string(gl_client, KEY_GCONF_HTTP_AUTH_USER, NULL); auth_pw = gconf_client_get_string(gl_client, KEY_GCONF_HTTP_AUTH_PW, NULL); if (use_proxy_auth) { /* Christian Kellner: Here are the only changes I made to the proxy sub- * system */ proxy_username = (auth_user != NULL ? g_strdup(auth_user) : NULL); proxy_password = (auth_pw != NULL ? g_strdup(auth_pw) : NULL); DEBUG_HTTP(("New HTTP proxy auth user: '******'", auth_user)); } else { if (proxy_username != NULL) g_free(proxy_username); if (proxy_password != NULL) g_free(proxy_password); proxy_username = proxy_password = NULL; DEBUG_HTTP(("HTTP proxy auth unset")); } g_free(auth_user); g_free(auth_pw); }
void lmplayer_search_init(LmplayerObject *lmplayer) { gchar *database; gchar *path; database = gconf_client_get_string(lmplayer->gc, GCONF_PREFIX"/library_database", NULL); if(!database || strlen(database) < 1) { database = g_build_filename((const char*)getenv("HOME"), ".lmplayer/media.database", NULL); gconf_client_set_string(lmplayer->gc, GCONF_PREFIX"/library_database", (const gchar*)database, NULL); } path = gconf_client_get_string(lmplayer->gc, GCONF_PREFIX"/library_path", NULL); if(!path) { path = g_build_filename((const char*)getenv("HOME"), _("Music"), NULL); gconf_client_set_string(lmplayer->gc, GCONF_PREFIX"/library_path", (const gchar*)path, NULL); } search_library_init(database, path); g_free(database); g_free(path); }
void switcher_button_update_languages(SwitcherButton *self) { if (self->priv->model == N800 || self->priv->model == N810) { gchar* lang0 = gconf_client_get_string(self->priv->gconfClient, GCONF_LANG0_2008, 0); gchar* lang1 = gconf_client_get_string(self->priv->gconfClient, GCONF_LANG1_2008, 0); switcher_button_load_icon(self, lang0, &self->priv->icon0, self->priv->theme); switcher_button_load_icon(self, lang1, &self->priv->icon1, self->priv->theme); } else if (self->priv->model == N770) { gchar* lang0 = gconf_client_get_string(self->priv->gconfClient, GCONF_LANG0_2006, 0); gchar* lang1 = gconf_client_get_string(self->priv->gconfClient, GCONF_LANG1_2006, 0); switcher_button_load_icon(self, lang0, &self->priv->icon0, self->priv->theme); switcher_button_load_icon(self, lang1, &self->priv->icon1, self->priv->theme); } else { self->priv->icon0 = 0; self->priv->icon1 = 0; } switcher_button_update_icon(self); }
static void init_gconf (void) { #if defined (HAVE_GCONF) char *s; #if ! GLIB_CHECK_VERSION (2, 36, 0) g_type_init (); #endif gconf_client = gconf_client_get_default (); gconf_client_set_error_handling (gconf_client, GCONF_CLIENT_HANDLE_NONE); gconf_client_add_dir (gconf_client, GCONF_TOOL_BAR_STYLE, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); gconf_client_notify_add (gconf_client, GCONF_TOOL_BAR_STYLE, something_changed_gconfCB, NULL, NULL, NULL); s = gconf_client_get_string (gconf_client, GCONF_TOOL_BAR_STYLE, NULL); if (s) { current_tool_bar_style = map_tool_bar_style (s); g_free (s); } #ifdef HAVE_XFT s = gconf_client_get_string (gconf_client, GCONF_MONO_FONT, NULL); if (s) { dupstring (¤t_mono_font, s); g_free (s); } s = gconf_client_get_string (gconf_client, GCONF_FONT_NAME, NULL); if (s) { dupstring (¤t_font, s); g_free (s); } gconf_client_add_dir (gconf_client, GCONF_MONO_FONT, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); gconf_client_notify_add (gconf_client, GCONF_MONO_FONT, something_changed_gconfCB, NULL, NULL, NULL); gconf_client_add_dir (gconf_client, GCONF_FONT_NAME, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); gconf_client_notify_add (gconf_client, GCONF_FONT_NAME, something_changed_gconfCB, NULL, NULL, NULL); #endif /* HAVE_XFT */ #endif /* HAVE_GCONF */ }
static void construct(Uptime_plug_data **p) { *p = g_malloc(sizeof(Uptime_plug_data)); Uptime_plug_data * data = *p; GConfValue *value; gchar * svalue; data->timer = 1000; data->forceupdate = FALSE; svalue = gconf_client_get_string(get_dashboard_gconf(), GCONF_UPTIME_NO_GTK_BG, NULL); if (!svalue) { gconf_client_set_string(get_dashboard_gconf(), GCONF_UPTIME_NO_GTK_BG, svalue = g_strdup("999999d6"), NULL); } awn_cairo_string_to_color(svalue, &data->bg); g_free(svalue); svalue = gconf_client_get_string(get_dashboard_gconf(), GCONF_UPTIME_NO_GTK_FG, NULL); if (!svalue) { gconf_client_set_string(get_dashboard_gconf(), GCONF_UPTIME_NO_GTK_FG, svalue = g_strdup("000000bb"), NULL); } awn_cairo_string_to_color(svalue, &data->fg); g_free(svalue); value = gconf_client_get(get_dashboard_gconf(), GCONF_UPTIME_SIZE_MULT, NULL); if (value) { data->size_mult = gconf_client_get_float(get_dashboard_gconf(), GCONF_UPTIME_SIZE_MULT, NULL); } else { data->size_mult = 2.0; } value = gconf_client_get(get_dashboard_gconf(), GCONF_UPTIME_SHOW_SECONDS, NULL); if (value) { data->show_seconds = gconf_client_get_bool(get_dashboard_gconf(), GCONF_UPTIME_SHOW_SECONDS, NULL); } else { data->show_seconds = FALSE; } }
static void sj_metadata_musicbrainz5_init (SjMetadataMusicbrainz5 *self) { GConfClient *gconf_client; gchar *server_name; SjMetadataMusicbrainz5Private *priv; priv = GET_PRIVATE (self); gconf_client = gconf_client_get_default (); server_name = gconf_client_get_string (gconf_client, GCONF_MUSICBRAINZ_SERVER, NULL); if (server_name && (*server_name == '\0')) { g_free (server_name); server_name = NULL; } priv->mb = mb5_query_new (SJ_MUSICBRAINZ_USER_AGENT, server_name, 0); g_free (server_name); /* Set the HTTP proxy */ if (gconf_client_get_bool (gconf_client, GCONF_PROXY_USE_PROXY, NULL)) { char *proxy_host; int port; proxy_host = gconf_client_get_string (gconf_client, GCONF_PROXY_HOST, NULL); mb5_query_set_proxyhost (priv->mb, proxy_host); g_free (proxy_host); port = gconf_client_get_int (gconf_client, GCONF_PROXY_PORT, NULL); mb5_query_set_proxyport (priv->mb, port); if (gconf_client_get_bool (gconf_client, GCONF_PROXY_USE_AUTHENTICATION, NULL)) { char *username, *password; username = gconf_client_get_string (gconf_client, GCONF_PROXY_USERNAME, NULL); mb5_query_set_proxyusername (priv->mb, username); g_free (username); password = gconf_client_get_string (gconf_client, GCONF_PROXY_PASSWORD, NULL); mb5_query_set_proxypassword (priv->mb, password); g_free (password); } } g_object_unref (gconf_client); }
static void sj_metadata_musicbrainz3_init (SjMetadataMusicbrainz3 *self) { GConfClient *gconf_client; gchar *server_name; SjMetadataMusicbrainz3Private *priv; priv = GET_PRIVATE (self); priv->mb = mb_webservice_new (); gconf_client = gconf_client_get_default (); server_name = gconf_client_get_string (gconf_client, GCONF_MUSICBRAINZ_SERVER, NULL); if (server_name && strcmp (server_name, "") != 0) { mb_webservice_set_host (priv->mb, server_name); } g_free (server_name); /* Set the HTTP proxy */ if (gconf_client_get_bool (gconf_client, GCONF_PROXY_USE_PROXY, NULL)) { char *proxy_host; int port; proxy_host = gconf_client_get_string (gconf_client, GCONF_PROXY_HOST, NULL); mb_webservice_set_proxy_host (priv->mb, proxy_host); g_free (proxy_host); port = gconf_client_get_int (gconf_client, GCONF_PROXY_PORT, NULL); mb_webservice_set_proxy_port (priv->mb, port); if (gconf_client_get_bool (gconf_client, GCONF_PROXY_USE_AUTHENTICATION, NULL)) { char *username, *password; username = gconf_client_get_string (gconf_client, GCONF_PROXY_USERNAME, NULL); mb_webservice_set_proxy_username (priv->mb, username); g_free (username); password = gconf_client_get_string (gconf_client, GCONF_PROXY_PASSWORD, NULL); mb_webservice_set_proxy_password (priv->mb, password); g_free (password); } } g_object_unref (gconf_client); }
static void on_notify_font_theme (GSettings* settings, const gchar* key, gpointer user_data) { Sourceview *sv; sv = ANJUTA_SOURCEVIEW(user_data); if (g_settings_get_boolean (settings, key)) { /* FIXME: GSettings */ #if 0 GConfClient *gclient = gconf_client_get_default (); gchar *desktop_fixed_font; desktop_fixed_font = gconf_client_get_string (gclient, DESKTOP_FIXED_FONT, NULL); if (desktop_fixed_font) anjuta_view_set_font(sv->priv->view, FALSE, desktop_fixed_font); else anjuta_view_set_font(sv->priv->view, TRUE, NULL); g_free (desktop_fixed_font); #endif } else { gchar* font = g_settings_get_string (settings, FONT); anjuta_view_set_font(sv->priv->view, FALSE, font); g_free (font); } }
void gconf_setup() { gchar *str; GConfClient *client = gconf_client_get_default(); if (client == NULL) return; /* we're not running under GConf */ /* * This is deliberately somewhat simple-minded, at least for now. * We care about one thing: Is anything set to handle "bible://"? * * Unfortunate consequence of changing xiphos2 => xiphos: * We must fix broken keys. */ if ((((str = gconf_client_get_string(client, gconf_keys[0][0], NULL)) == NULL) || (strncmp(str, "xiphos ", 7) == 0))) { /* * Mechanical as can be, one after another. */ int i; for (i = 0; i < GS_GCONF_MAX; ++i) { (((i % 3) == 0) /* contrived hack */ ? gconf_client_set_string(client, gconf_keys[i][0], gconf_keys[i][1], NULL) : gconf_client_set_bool(client, gconf_keys[i][0], (gconf_keys[i][1] ? TRUE : FALSE), NULL)); } } }
gchar * gm_conf_get_string (const gchar *key) { g_return_val_if_fail (key != NULL, NULL); return gconf_client_get_string (client, key, NULL); }
static gboolean migrate_old_categories (void) { /* Try migrating old category settings from GConf to the new * category XML file. If successful, unset the old GConf key * so that this is a one-time-only operation. */ const gchar *key = "/apps/evolution/general/category_master_list"; GConfClient *client; gchar *string; gint n_added = 0; client = gconf_client_get_default (); string = gconf_client_get_string (client, key, NULL); if (string == NULL || *string == '\0') goto exit; g_debug ("Loading categories from GConf key \"%s\"", key); n_added = parse_categories (string, strlen (string)); if (n_added == 0) goto exit; /* default icon files are now in an unversioned directory */ g_hash_table_foreach (categories_table, migrate_old_icon_file, NULL); gconf_client_unset (client, key, NULL); exit: g_object_unref (client); g_free (string); return n_added; }
gchar *gm_pref_store_get_string(GmPrefStore * store, const gchar * key) { gchar *value = NULL; if (store == NULL) return value; #if HAVE_GSETTINGS value = g_settings_get_string(store->settings, key); #else #ifdef HAVE_GCONF gchar *full_key; full_key = g_strdup_printf("/apps/%s/preferences/%s", store->context, key); value = gconf_client_get_string(store->gconf, full_key, NULL); g_free(full_key); #else if (g_key_file_has_key(store->keyfile, store->context, key, NULL)) value = g_key_file_get_string(store->keyfile, store->context, key, NULL); #endif #endif return value; }
static void panel_drawer_use_custom_icon_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, Drawer *drawer) { gboolean use_custom_icon; char *custom_icon = NULL; if (!entry->value || entry->value->type != GCONF_VALUE_BOOL) return; use_custom_icon = gconf_value_get_bool (entry->value); if (use_custom_icon) { const char *key; key = panel_gconf_full_key (PANEL_GCONF_OBJECTS, drawer->info->id, "custom_icon"); custom_icon = gconf_client_get_string (client, key, NULL); } button_widget_set_icon_name (BUTTON_WIDGET (drawer->button), custom_icon); g_free (custom_icon); }
int e_plugin_lib_enable(EPluginLib *ep, int enable) { char *key; int i; if (epp_gconf || epp_mode != -1) return 0; if (enable) { epp_gconf = gconf_client_get_default(); key = gconf_client_get_string(epp_gconf, "/apps/evolution/eplugin/prefer_plain/mode", NULL); if (key) { for (i=0;i<sizeof(epp_options)/sizeof(epp_options[0]);i++) { if (!strcmp(epp_options[i].key, key)) { epp_mode = i; break; } } g_free (key); } else { epp_mode = 0; } } else { if (epp_gconf) { g_object_unref(epp_gconf); epp_gconf = NULL; } } return 0; }
/** * e_account_list_get_default: * @accounts: * * Get the default account. If no default is specified, or the default * has become stale, then the first account is made the default. * * Return value: The account or NULL if no accounts are defined. **/ const EAccount * e_account_list_get_default(EAccountList *accounts) { char *uid; EIterator *it; const EAccount *account = NULL; uid = gconf_client_get_string (accounts->priv->gconf, "/apps/evolution/mail/default_account", NULL); it = e_list_get_iterator ((EList *)accounts); if (uid) { for (;e_iterator_is_valid (it);e_iterator_next (it)) { account = (const EAccount *)e_iterator_get (it); if (!strcmp(uid, account->uid)) break; account = NULL; } e_iterator_reset(it); } /* no uid or uid not found, @it will be at the first account */ if (account == NULL && e_iterator_is_valid(it)) { account = (const EAccount *) e_iterator_get (it); gconf_client_set_string (accounts->priv->gconf, "/apps/evolution/mail/default_account", account->uid, NULL); } g_object_unref(it); g_free(uid); return account; }
gchar *gconf_get_password() { if (scrm_session.password == NULL) { scrm_session.password = gconf_client_get_string(gconf_client_get_default(), GCONF_KEY_PASSWORD, NULL); } return scrm_session.password; }
static void init_fonts(Sourceview* sv) { gboolean font_theme; font_theme = FALSE; //g_settings_get_boolean (sv->priv->settings, FONT_THEME); if (!font_theme) { gchar* font = g_settings_get_string (sv->priv->settings, FONT); anjuta_view_set_font(sv->priv->view, FALSE, font); g_free (font); } #if 0 else { /* FIXME: Get font from GSettings */ GConfClient *gclient; gchar *desktop_fixed_font; gclient = gconf_client_get_default (); desktop_fixed_font = gconf_client_get_string (gclient, DESKTOP_FIXED_FONT, NULL); if (desktop_fixed_font) anjuta_view_set_font(sv->priv->view, FALSE, desktop_fixed_font); else anjuta_view_set_font(sv->priv->view, TRUE, NULL); g_free (desktop_fixed_font); g_object_unref (gclient); } #endif }
static inline gchar * get_string_from_gconf (GConfClient *client, const gchar *plugin_id, const gchar *suffix) { gchar *key, *value; GError *error = NULL; key = get_gconf_key (plugin_id, suffix); value = gconf_client_get_string (client, key, &error); if (error) { g_warning ("%s. Could not read %s from GConf for bookmark shortcut %s. %s", __FUNCTION__, suffix, plugin_id, error->message); g_error_free (error); } g_free (key); return value; }
/* The primary memo list */ char * calendar_config_get_primary_memos (void) { calendar_config_init (); return gconf_client_get_string (config, CALENDAR_CONFIG_PRIMARY_MEMOS, NULL); }
/* The current timezone, e.g. "Europe/London". It may be NULL, in which case you should assume UTC (though Evolution will show the timezone-setting dialog the next time a calendar or task folder is selected). */ gchar * calendar_config_get_timezone (void) { calendar_config_init (); return gconf_client_get_string (config, CALENDAR_CONFIG_TIMEZONE, NULL); }
gchar * calendar_config_get_free_busy_template (void) { calendar_config_init (); return gconf_client_get_string (config, CALENDAR_CONFIG_TEMPLATE, NULL); }
NS_IMETHODIMP nsGConfService::GetAppForProtocol(const nsACString &aScheme, PRBool *aEnabled, nsACString &aHandler) { nsCAutoString key("/desktop/gnome/url-handlers/"); key.Append(aScheme); key.Append("/command"); GError *err = nsnull; gchar *command = gconf_client_get_string(mClient, key.get(), &err); if (!err && command) { key.Replace(key.Length() - 7, 7, NS_LITERAL_CSTRING("enabled")); *aEnabled = gconf_client_get_bool(mClient, key.get(), &err); } else { *aEnabled = PR_FALSE; } aHandler.Assign(command); if (command) g_free(command); if (err) { g_error_free(err); return NS_ERROR_FAILURE; } return NS_OK; }
gchar * gnc_gconf_get_string (const gchar *section, const gchar *name, GError **caller_error) { GError *error = NULL; gchar *value; gchar *key; if (our_client == NULL) our_client = gconf_client_get_default(); key = gnc_gconf_make_key(section, name); value = gconf_client_get_string(our_client, key, &error); if (error) { gnc_gconf_load_error(key, caller_error, error); } g_free(key); if (value && strlen(value) == 0) { g_free(value); return NULL; } return value; }
static char * panel_util_get_file_display_for_common_files (GFile *file) { GFile *compare; compare = g_file_new_for_path (g_get_home_dir ()); if (g_file_equal (file, compare)) { char *gconf_name; g_object_unref (compare); gconf_name = gconf_client_get_string (panel_gconf_get_client (), HOME_NAME_KEY, NULL); if (PANEL_GLIB_STR_EMPTY (gconf_name)) { g_free (gconf_name); return g_strdup (_("Home Folder")); } else { return gconf_name; } } g_object_unref (compare); compare = g_file_new_for_path ("/"); if (g_file_equal (file, compare)) { g_object_unref (compare); /* Translators: this is the same string as the one found in * nautilus */ return g_strdup (_("File System")); } g_object_unref (compare); return NULL; }
static void link_button_clicked_cb (GtkWidget *widget, LmplayerObject *lmplayer) { const char *uri; char *command, *browser, *escaped_uri; GError *error = NULL; uri = gtk_link_button_get_uri (GTK_LINK_BUTTON (widget)); escaped_uri = g_shell_quote (uri); browser = gconf_client_get_string (lmplayer->gc, "/desktop/gnome/url-handlers/http/command", NULL); if (browser == NULL || browser[0] == '\0') { char *message; message = g_strdup_printf(_("Could not launch URL \"%s\": %s"), uri, _("Default browser not configured")); //lmplayer_interface_error (_("Error launching URI"), message, GTK_WINDOW (lmplayer->win)); g_free (message); } else { char *message; command = g_strdup_printf (browser, escaped_uri); if (g_spawn_command_line_async ((const char*) command, &error) == FALSE) { message = g_strdup_printf(_("Could not launch URL \"%s\": %s"), uri, error->message); //lmplayer_interface_error (_("Error launching URI"), message, GTK_WINDOW (lmplayer->win)); g_free (message); g_error_free (error); } g_free (command); } g_free (escaped_uri); g_free (browser); }
void gfloppy_config_load (GFloppyConfig *config, GConfClient *client) { GError *error = NULL; g_return_if_fail (config != NULL); g_return_if_fail (client != NULL); /* We'll default the value when analyzing it, after loading the config */ config->default_fs = g_strdup (gconf_client_get_string (client, "/apps/gfloppy/default_fs", &error)); check_gconf_error (&error); /* Check to make sure that it's a valid string */ if (config->default_fs == NULL) config->default_fs = g_strdup (GFLOPPY_CONFIG_FS_FAT); else if (config->default_fs && strcmp (config->default_fs, GFLOPPY_CONFIG_FS_EXT2) && strcmp (config->default_fs, GFLOPPY_CONFIG_FS_FAT)) { g_free (config->default_fs); config->default_fs = g_strdup (GFLOPPY_CONFIG_FS_FAT); } config->default_formatting_mode = gconf_client_get_int (client, "/apps/gfloppy/default_formatting_mode", &error); /* We need to care about users sillyness ;) */ if (!check_gconf_error (&error) || config->default_formatting_mode < GFLOPPY_FORMAT_QUICK || config->default_formatting_mode > GFLOPPY_FORMAT_THOROUGH) config->default_formatting_mode = GFLOPPY_FORMAT_STANDARD; config->prefer_mkdosfs_backend = gconf_client_get_bool (client, "/apps/gfloppy/prefer_mkdosfs_backend", &error); if (!check_gconf_error (&error)) config->prefer_mkdosfs_backend = TRUE; }
void panel_menu_button_load_from_gconf (PanelWidget *panel, gboolean locked, int position, gboolean exactpos, const char *id) { GConfClient *client; const char *key; char *menu_path; char *custom_icon; char *tooltip; gboolean use_menu_path; gboolean use_custom_icon; client = panel_gconf_get_client (); key = panel_gconf_full_key (PANEL_GCONF_OBJECTS, id, "menu_path"); menu_path = gconf_client_get_string (client, key, NULL); key = panel_gconf_full_key (PANEL_GCONF_OBJECTS, id, "custom_icon"); custom_icon = gconf_client_get_string (client, key, NULL); key = panel_gconf_full_key (PANEL_GCONF_OBJECTS, id, "tooltip"); tooltip = gconf_client_get_string (client, key, NULL); key = panel_gconf_full_key (PANEL_GCONF_OBJECTS, id, "use_menu_path"); use_menu_path = gconf_client_get_bool (client, key, NULL); key = panel_gconf_full_key (PANEL_GCONF_OBJECTS, id, "use_custom_icon"); use_custom_icon = gconf_client_get_bool (client, key, NULL); panel_menu_button_load (menu_path, use_menu_path, custom_icon, use_custom_icon, tooltip, panel, locked, position, exactpos, id); g_free (menu_path); g_free (custom_icon); g_free (tooltip); }
void buffer_to_pdf (Ebook * ebook) { GtkTextBuffer * buffer; GtkTextIter start, end; Pqueue queue; gchar * size, *editor_font; /* A4 initial */ queue.ebook = ebook; queue.pos = 0; queue.page_count = 1; queue.width = 8.3 * POINTS; queue.height = 11.7 * POINTS; queue.page_height = 40.0; g_return_if_fail (ebook); g_return_if_fail (ebook->filename); size = gconf_client_get_string (ebook->client, ebook->paper_size.key, NULL); buffer = GTK_TEXT_BUFFER(gtk_builder_get_object (ebook->builder, "textbuffer1")); queue.progressbar = GTK_PROGRESS_BAR(gtk_builder_get_object (ebook->builder, "progressbar")); queue.statusbar = GTK_STATUSBAR(gtk_builder_get_object (ebook->builder, "statusbar")); gtk_text_buffer_get_bounds (buffer, &start, &end); queue.text = g_strdup(gtk_text_buffer_get_text (buffer, &start, &end, TRUE)); editor_font = gconf_client_get_string(ebook->client, ebook->editor_font.key, NULL); if (0 == g_strcmp0 (size, "A5")) { queue.width = a5_width * POINTS; queue.height = a5_height * POINTS; } if (0 == g_strcmp0 (size, "B5")) { queue.width = b5_width * POINTS; queue.height = b5_height * POINTS; } queue.surface = cairo_pdf_surface_create (ebook->filename, queue.width, queue.height); queue.cr = cairo_create (queue.surface); queue.context = pango_cairo_create_context (queue.cr); /* pango_cairo_create_layout is wasteful with a lot of text. */ queue.desc = pango_font_description_from_string (editor_font); queue.layout = make_new_page (queue.context, queue.desc, queue.height, queue.width); pango_layout_set_text (queue.layout, queue.text, -1); cairo_move_to (queue.cr, SIDE_MARGIN / 2, EDGE_MARGIN / 2); gtk_progress_bar_set_fraction (queue.progressbar, 0.0); queue.lines_per_page = pango_layout_get_line_count (queue.layout); queue.iter = pango_layout_get_iter (queue.layout); create_pages (&queue); }
void drawer_load_from_gconf (PanelWidget *panel_widget, gboolean locked, gint position, const char *id) { GConfClient *client; const char *key; gboolean use_custom_icon; char *toplevel_id; char *custom_icon; char *tooltip; g_return_if_fail (panel_widget != NULL); g_return_if_fail (id != NULL); client = panel_gconf_get_client (); key = panel_gconf_full_key (PANEL_GCONF_OBJECTS, id, "attached_toplevel_id"); toplevel_id = gconf_client_get_string (client, key, NULL); panel_profile_load_toplevel (client, PANEL_CONFIG_DIR, PANEL_GCONF_TOPLEVELS, toplevel_id); key = panel_gconf_full_key (PANEL_GCONF_OBJECTS, id, "use_custom_icon"); use_custom_icon = gconf_client_get_bool (client, key, NULL); key = panel_gconf_full_key (PANEL_GCONF_OBJECTS, id, "custom_icon"); custom_icon = gconf_client_get_string (client, key, NULL); key = panel_gconf_full_key (PANEL_GCONF_OBJECTS, id, "tooltip"); tooltip = gconf_client_get_string (client, key, NULL); load_drawer_applet (toplevel_id, custom_icon, use_custom_icon, tooltip, panel_widget->toplevel, locked, position, TRUE, id); g_free (toplevel_id); g_free (custom_icon); g_free (tooltip); }