1
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
4
* Copyright (C) Joe Cortes 2010 <escozzia@gmail.com>
6
* GData Client is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
11
* GData Client is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with GData Client. If not, see <http://www.gnu.org/licenses/>.
23
#include <gdata/gdata.h>
25
#include <glib-object.h>
26
#define DEVELOPER_KEY "AI39si5MkSF-0bzTmP5WETk1D-Z7inHaQJzX13PeG_5Uzeu8mz3vo40cFoqnxjejB-UqzYFrqzOSlsqJvHuPNEGqdycqnPo30A"
27
#define CLIENT_ID "ytapi-GNOME-libgdata-444fubtt-0"
28
#define THUMBNAIL_WIDTH 180
29
#define MAX_RESULTS 10
31
/* how this works is that there's a struct for every window opened
32
* they contain that individual window's data
33
* and every one of them (except for scrap data, which is for the main window)
34
* has a pointer to the one for the main window called main_data */
59
typedef struct _ScrapYTSearch ScrapYTSearch;
60
typedef struct _ScrapPSearch ScrapPSearch;
61
typedef struct _ScrapPUpload ScrapPUpload;
62
typedef struct _ScrapPicSearch ScrapPicSearch;
64
typedef struct _ScrapData {
70
GtkWidget *scrollWindow;
71
ScrapYTSearch *yt_search;
72
ScrapPSearch *p_search;
73
ScrapPicSearch *pic_search;
74
ScrapPUpload *p_upload;
80
GDataYouTubeService *youtube_service;
81
GDataPicasaWebService *picasaweb_service;
83
struct _ScrapPUpload {
85
GDataPicasaWebFile *file;
88
GtkWidget *description;
91
struct _ScrapPicSearch { /* for finding pictures */
97
ScrapPSearch *search_data;
99
GDataPicasaWebFile *file;
100
GtkListStore *lStore;
104
struct _ScrapYTSearch { /* youtube search data */
105
GtkWidget *txt_entry;
111
GdkPixbuf *thumbnail;
113
ScrapData *main_data; /* <- points to a structure containing main vars */
114
GtkListStore *lStore;
118
struct _ScrapPSearch { /* for finding albums */
123
GdkPixbuf *thumbnail;
125
ScrapData *main_data;
126
GtkWidget *user_entry;
131
typedef struct _ScrapProps {
134
GtkWidget *username_entry, *password_entry;
135
ScrapData *main_data;
140
open_in_web_browser (GtkWidget *widget, gchar *uri);
143
picture_selected (GtkTreeView *tree, GtkTreePath *path, GtkTreeViewColumn *column, ScrapPicSearch *self);
146
video_selected (GtkTreeView *tree, GtkTreePath *path, GtkTreeViewColumn *column, ScrapYTSearch *self);
149
p_display_tree (ScrapPicSearch *self);
152
yt_display_tree (ScrapYTSearch *self);
154
GDataMediaThumbnail *
155
choose_best_thumbnail (GList *thumbnails, gint ideal_size);
158
find_pictures (GDataEntry *entry, guint entry_key, guint entry_count, ScrapPicSearch *self);
161
p_query_element (GDataEntry *entry, guint entry_key, guint entry_count, ScrapPSearch *self);
164
p_text_callback (GtkWidget *widget, ScrapPSearch *self);
167
yt_query_element (GDataEntry *entry, guint entry_key, guint entry_count, ScrapYTSearch *self);
170
yt_text_callback (GtkWidget *widget, ScrapYTSearch *self);
173
start_new_picasa_search (GtkWidget *widget, ScrapData *first);
176
start_new_youtube_search (GtkWidget *widget, ScrapData *first);
179
properties_set (GtkWidget *widget, ScrapProps *self);
182
properties_show (GtkWidget *widget, ScrapData *first);
185
upload (GtkWidget *widget, ScrapData *first);