* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
*
* Since: 2.10
*/
-G_CONST_RETURN gchar *
+const gchar *
gtk_printer_get_name (GtkPrinter *printer)
{
g_return_val_if_fail (GTK_IS_PRINTER (printer), NULL);
*
* Since: 2.10
*/
-G_CONST_RETURN gchar *
+const gchar *
gtk_printer_get_description (GtkPrinter *printer)
{
g_return_val_if_fail (GTK_IS_PRINTER (printer), NULL);
*
* Since: 2.10
*/
-G_CONST_RETURN gchar *
+const gchar *
gtk_printer_get_state_message (GtkPrinter *printer)
{
g_return_val_if_fail (GTK_IS_PRINTER (printer), NULL);
*
* Since: 2.10
*/
-G_CONST_RETURN gchar *
+const gchar *
gtk_printer_get_location (GtkPrinter *printer)
{
g_return_val_if_fail (GTK_IS_PRINTER (printer), NULL);
*
* Since: 2.10
*/
-G_CONST_RETURN gchar *
+const gchar *
gtk_printer_get_icon_name (GtkPrinter *printer)
{
g_return_val_if_fail (GTK_IS_PRINTER (printer), NULL);
/**
* gtk_printer_get_hard_margins:
* @printer: a #GtkPrinter
- * @top: a location to store the top margin in
- * @bottom: a location to store the bottom margin in
- * @left: a location to store the left margin in
- * @right: a location to store the right margin in
+ * @top: (out): a location to store the top margin in
+ * @bottom: (out): a location to store the bottom margin in
+ * @left: (out): a location to store the left margin in
+ * @right: (out): a location to store the right margin in
*
* Retrieve the hard margins of @printer, i.e. the margins that define
* the area at the borders of the paper that the printer cannot print to.
}
static void
-list_done_cb (GtkPrintBackend *backend,
- PrinterList *printer_list)
+list_printers_remove_backend (PrinterList *printer_list,
+ GtkPrintBackend *backend)
{
printer_list->backends = g_list_remove (printer_list->backends, backend);
-
- g_signal_handlers_disconnect_by_func (backend, list_added_cb, printer_list);
- g_signal_handlers_disconnect_by_func (backend, list_done_cb, printer_list);
- g_signal_handlers_disconnect_by_func (backend, backend_status_changed, printer_list);
-
gtk_print_backend_destroy (backend);
g_object_unref (backend);
free_printer_list (printer_list);
}
+static void
+list_done_cb (GtkPrintBackend *backend,
+ PrinterList *printer_list)
+{
+ g_signal_handlers_disconnect_by_func (backend, list_added_cb, printer_list);
+ g_signal_handlers_disconnect_by_func (backend, list_done_cb, printer_list);
+ g_signal_handlers_disconnect_by_func (backend, backend_status_changed, printer_list);
+
+ list_printers_remove_backend(printer_list, backend);
+}
+
static gboolean
list_printers_init (PrinterList *printer_list,
GtkPrintBackend *backend)
if (status == GTK_PRINT_BACKEND_STATUS_UNAVAILABLE ||
gtk_print_backend_printer_list_is_done (backend))
- {
- printer_list->backends = g_list_remove (printer_list->backends, backend);
- gtk_print_backend_destroy (backend);
- g_object_unref (backend);
- }
+ list_printers_remove_backend(printer_list, backend);
else
{
g_signal_connect (backend, "printer-added",
{
printer_list->loop = g_main_loop_new (NULL, FALSE);
- GDK_THREADS_LEAVE ();
+ gdk_threads_leave ();
g_main_loop_run (printer_list->loop);
- GDK_THREADS_ENTER ();
+ gdk_threads_enter ();
}
}