+2007-04-20 Iñigo Martínez <inigomartinez@gmail.com>
+
+ * shell/ev-application.c:
+ * shell/ev-job-queue.c:
+ * shell/ev-metadata-manager.c:
+ * shell/ev-stock-icons.c:
+ * shell/ev-window.c:
+ * shell/main.c:
+
+ Developers documentation updated.
+
2007-04-19 Carlos Garcia Campos <carlosgc@gnome.org>
* shell/ev-window.c: (uri_is_valid), (launch_external_uri):
}
#endif /* ENABLE_DBUS */
+/**
+ * ev_application_get_instance:
+ *
+ * Checks for #EvApplication instance, if it doesn't exist it does create it.
+ *
+ * Returns: an instance of the #EvApplication data.
+ */
EvApplication *
ev_application_get_instance (void)
{
G_CALLBACK (removed_from_session), application);
}
+/**
+ * ev_display_open_if_needed:
+ * @name: the name of the display to be open if it's needed.
+ *
+ * Search among all the open displays if any of them have the same name as the
+ * passed name. If the display isn't found it tries the open it.
+ *
+ * Returns: a #GdkDisplay of the display with the passed name.
+ */
static GdkDisplay *
ev_display_open_if_needed (const gchar *name)
{
return display != NULL ? display : gdk_display_open (name);
}
+/**
+ * get_screen_from_args:
+ * @args: a #GHashTable with data passed to the application.
+ *
+ * Looks for the screen in the display available in the hash table passed to the
+ * application. If the display isn't opened, it's opened and the #GdkScreen
+ * assigned to the screen in that display returned.
+ *
+ * Returns: the #GdkScreen assigned to the screen on the display indicated by
+ * the data on the #GHashTable.
+ */
static GdkScreen *
get_screen_from_args (GHashTable *args)
{
return screen;
}
+/**
+ * get_window_run_mode_from_args:
+ * @args: a #GHashTable with data passed to the application.
+ *
+ * It does look if the mode option has been passed from command line, using it
+ * as the window run mode, otherwise the run mode will be the normal mode.
+ *
+ * Returns: The window run mode passed from command line or
+ * EV_WINDOW_MODE_NORMAL in other case.
+ */
static EvWindowRunMode
get_window_run_mode_from_args (GHashTable *args)
{
return mode;
}
+/**
+ * get_destination_from_args:
+ * @args: a #GHashTable with data passed to the application.
+ *
+ * It does look for the page-label argument parsed from the command line and
+ * if it does exist, it returns an #EvLinkDest.
+ *
+ * Returns: An #EvLinkDest to page-label if it has been passed from the command
+ * line, NULL in other case.
+ */
static EvLinkDest *
get_destination_from_args (GHashTable *args)
{
return dest;
}
+/**
+ * get_unlink_temp_file_from_args:
+ * @args: a #GHashTable with data passed to the application.
+ *
+ * It does look if the unlink-temp-file option has been passed from the command
+ * line returning it's boolean representation, otherwise it does return %FALSE.
+ *
+ * Returns: the boolean representation of the unlink-temp-file value or %FALSE
+ * in other case.
+ */
static gboolean
get_unlink_temp_file_from_args (GHashTable *args)
{
return unlink_temp_file;
}
+/**
+ * ev_application_open_window:
+ * @application: The instance of the application.
+ * @args: A #GHashTable with the arguments data.
+ * @timestamp: Current time value.
+ * @error: The #GError facility.
+ *
+ * Creates a new window and if the args are available, it's not NULL, it gets
+ * the screen from them and assigns the just created window to it. At last it
+ * does show it.
+ *
+ * Returns: %TRUE.
+ */
gboolean
ev_application_open_window (EvApplication *application,
GHashTable *args,
return TRUE;
}
+/**
+ * ev_application_get_empty_window:
+ * @application: The instance of the application.
+ * @screen: The screen where the empty window will be search.
+ *
+ * It does look if there is any empty window in the indicated screen.
+ *
+ * Returns: The first empty #EvWindow in the passed #GdkScreen or NULL in other
+ * case.
+ */
static EvWindow *
ev_application_get_empty_window (EvApplication *application,
GdkScreen *screen)
return empty_window;
}
+/**
+ * ev_application_get_uri_window:
+ * @application: The instance of the application.
+ * @uri: The uri to be opened.
+ *
+ * It looks in the list of the windows for the one with the document represented
+ * by the passed uri on it. If the window is empty or the document isn't present
+ * on any window, it will return NULL.
+ *
+ * Returns: The #EvWindow where the document represented by the passed uri is
+ * shown, NULL in other case.
+ */
static EvWindow *
ev_application_get_uri_window (EvApplication *application, const char *uri)
{
return uri_window;
}
+/**
+ * ev_application_open_uri_at_dest:
+ * @application: The instance of the application.
+ * @uri: The uri to be opened.
+ * @screen: Thee screen where the link will be shown.
+ * @dest: The #EvLinkDest of the document.
+ * @mode: The run mode of the window.
+ * @unlink_temp_file: The unlink_temp_file option value.
+ * @timestamp: Current time value.
+ */
void
ev_application_open_uri_at_dest (EvApplication *application,
const char *uri,
timestamp);
}
+/**
+ * ev_application_open_uri:
+ * @application: The instance of the application.
+ * @uri: The uri to be opened
+ * @args: A #GHashTable with the arguments data.
+ * @timestamp: Current time value.
+ * @error: The #GError facility.
+ */
gboolean
ev_application_open_uri (EvApplication *application,
const char *uri,
#endif /* HAVE_GTK_RECENT */
}
+/**
+ * ev_application_get_windows:
+ * @application: The instance of the application.
+ *
+ * It creates a list of the top level windows.
+ *
+ * Returns: A #GList of the top level windows.
+ */
GList *
ev_application_get_windows (EvApplication *application)
{
g_queue_push_tail (queue, job);
}
+/**
+ * add_job_to_queue_locked:
+ * @queue: a #GQueue where the #EvJob will be added.
+ * @job: an #EvJob to be added to the specified #GQueue.
+ *
+ * Add the #EvJob to the specified #GQueue and woke up the ev_render_thread who
+ * is waiting for render_cond.
+ */
static void
add_job_to_queue_locked (GQueue *queue,
EvJob *job)
g_cond_broadcast (render_cond);
}
+/**
+ * notify_finished:
+ * @job: the object that signal will be reseted.
+ *
+ * It does emit the job finished signal and returns %FALSE.
+ *
+ * Returns: %FALSE.
+ */
static gboolean
notify_finished (GObject *job)
{
return FALSE;
}
+/**
+ * job_finished_cb:
+ * @job: the #EvJob that has been handled.
+ *
+ * It does finish the job last work and look if there is any more job to be
+ * handled.
+ */
static void
job_finished_cb (EvJob *job)
{
ev_job_queue_run_next ();
}
+/**
+ * handle_job:
+ * @job: the #EvJob to be handled.
+ *
+ * First, it does check if the job is async and then it does attend it if
+ * possible giving a failed assertion otherwise. If the job isn't async it does
+ * attend it and notify that the job has been finished.
+ */
static void
handle_job (EvJob *job)
{
}
}
+/**
+ * search_for_jobs_unlocked:
+ *
+ * Check if there is any job at the synchronized queues and return any existing
+ * job in them taking in account the next priority:
+ *
+ * render_queue_high >
+ * thumbnail_queue_high >
+ * render_queue_low >
+ * links_queue >
+ * load_queue >
+ * thumbnail_queue_low >
+ * fonts_queue >
+ * print_queue >
+ *
+ * Returns: an available #EvJob in the queues taking in account stablished queue
+ * priorities.
+ */
static EvJob *
search_for_jobs_unlocked (void)
{
return NULL;
}
+/**
+ * no_jobs_available_unlocked:
+ *
+ * Looks if there is any job at render, links, load, thumbnail. fonts and print
+ * queues.
+ *
+ * Returns: %TRUE if the render, links, load, thumbnail, fonts and print queues
+ * are empty, %FALSE in other case.
+ */
static gboolean
no_jobs_available_unlocked (void)
{
}
/* the thread mainloop function */
+/**
+ * ev_render_thread:
+ * @data: data passed to the thread.
+ *
+ * The thread mainloop function. It does wait for any available job in synced
+ * queues to handle it.
+ *
+ * Returns: the return value of the thread, which will be returned by
+ * g_thread_join().
+ */
static gpointer
ev_render_thread (gpointer data)
{
}
+/**
+ * ev_job_queue_run_next:
+ *
+ * It does look for any job on the render high priority queue first and after
+ * in the render low priority one, and then it does handle it.
+ */
static void
ev_job_queue_run_next (void)
{
}
/* Public Functions */
+/**
+ * ev_job_queue_init:
+ *
+ * Creates a new cond, new mutex, a thread for evince job handling and inits
+ * every queue.
+ */
void
ev_job_queue_init (void)
{
static EvMetadataManager *ev_metadata_manager = NULL;
+/**
+ * item_free:
+ * @data: a pointer to a #Item data
+ *
+ * It does free the values on the #GHashTable where data points.
+ */
static void
item_free (gpointer data)
{
g_free (item);
}
+/**
+ * ev_metadata_manager_init:
+ *
+ * Creates an EvMetadataManager with default values.
+ *
+ * values_loaded -> %FALSE.
+ * modified -> %FALSE.
+ * timeout_id -> the id of the event source.
+ * items -> a new full empty #GHashTable.
+ */
void
ev_metadata_manager_init (void)
{
}
/**
- * ev_metadata_manager_set:
+ * ev_metadata_manager_get:
* @uri: Uri to set data for, if @NULL, we return default value
* @key: Key to set uri
* @value: GValue struct filled up with value
{ EV_STOCK_ROTATE_RIGHT, "object-rotate-right"},
};
+/**
+ * ev_stock_icons_init:
+ *
+ * Creates a new icon factory, adding the base stock icons to it.
+ */
void
ev_stock_icons_init (void)
{
}
}
+/**
+ * ev_window_is_empty:
+ * @ev_window: The instance of the #EvWindow.
+ *
+ * It does look if there is any document loaded or if there is any job to load
+ * a document.
+ *
+ * Returns: %TRUE if there isn't any document loaded or any any documente to be
+ * loaded, %FALSE in other case.
+ */
gboolean
ev_window_is_empty (const EvWindow *ev_window)
{
return;
}
+/**
+ * ev_window_get_uri:
+ * @ev_window: The instance of the #EvWindow.
+ *
+ * It returns the uri of the document showed in the #EvWindow.
+ *
+ * Returns: the uri of the document showed in the #EvWindow.
+ */
const char *
ev_window_get_uri (EvWindow *ev_window)
{
return ev_window->priv->uri;
}
+/**
+ * ev_window_close_dialogs:
+ * @ev_window: The window where dialogs will be closed.
+ *
+ * It looks for password, print and properties dialogs and closes them and
+ * frees them from memory. If there is any print job it does free it too.
+ */
static void
ev_window_close_dialogs (EvWindow *ev_window)
{
ev_window_setup_action_sensitivity (ev_window);
}
+/**
+ * ev_window_new:
+ *
+ * Creates a #GtkWidget that represents the window.
+ *
+ * Returns: the #GtkWidget that represents the window.
+ */
GtkWidget *
ev_window_new (void)
{
g_free (value);
}
+/**
+ * arguments_parse:
+ *
+ * Parses the arguments and creates a #GHashTable with this data.
+ *
+ * key -> value
+ *
+ * dislay -> display at the default screen.
+ * screen -> screen number.
+ * page-label -> only if the page label argument has been passed,
+ * the page of the document to display.
+ * mode -> only if the view mode is one of the availables,
+ * the view mode.
+ * unlink-temp-file -> only if the view mode is preview mode and
+ * unlink-temp-file has been passed, unlink-temp-file.
+ *
+ * Returns: a pointer into #GHashTable with data from the arguments.
+ */
static GHashTable *
arguments_parse (void)
{