1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
|
/*
* Copyright © 2000-2003 Marco Pesenti Gritti
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
*/
#include "config.h"
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "ephy-embed.h"
#include "ephy-zoom.h"
#include "ephy-embed-type-builtins.h"
#include "ephy-marshal.h"
static void ephy_embed_base_init (gpointer g_class);
GType
ephy_embed_get_type (void)
{
static GType type = 0;
if (G_UNLIKELY (type == 0))
{
const GTypeInfo our_info =
{
sizeof (EphyEmbedIface),
ephy_embed_base_init,
NULL,
};
type = g_type_register_static (G_TYPE_INTERFACE,
"EphyEmbed",
&our_info, (GTypeFlags)0);
}
return type;
}
static void
ephy_embed_base_init (gpointer g_class)
{
static gboolean initialized = FALSE;
if (!initialized)
{
/**
* EphyEmbed::ge-new-window:
* @embed:
* @new_embed: the newly opened #EphyEmbed
*
* The ::ge_new_window signal is emitted after a new window has been opened by
* the embed. For example, when a JavaScript popup window is opened.
**/
g_signal_new ("ge_new_window",
EPHY_TYPE_EMBED,
G_SIGNAL_RUN_FIRST | G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EphyEmbedIface, new_window),
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE,
1,
GTK_TYPE_WIDGET);
/**
* EphyEmbed::ge-popup-blocked:
* @embed:
* @address: The requested URL
* @target: The requested window name, e.g. "_blank"
* @features: The requested features: for example, "height=400,width=200"
*
* The ::ge_popup_blocked signal is emitted when the viewed web page requests
* a popup window (with javascript:open()) but popup windows are not allowed.
**/
g_signal_new ("ge_popup_blocked",
EPHY_TYPE_EMBED,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (EphyEmbedIface, popup_blocked),
NULL, NULL,
ephy_marshal_VOID__STRING_STRING_STRING,
G_TYPE_NONE,
3,
G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE,
G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE,
G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE);
/**
* EphyEmbed::ge-context-menu:
* @embed:
* @event: the #EphyEmbedEvent which triggered this signal
*
* The ::ge_context_menu signal is emitted when a context menu is to be
* displayed. This will usually happen when the user right-clicks on a part of
* @embed.
**/
g_signal_new ("ge_context_menu",
EPHY_TYPE_EMBED,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EphyEmbedIface, context_menu),
g_signal_accumulator_true_handled, NULL,
ephy_marshal_BOOLEAN__OBJECT,
G_TYPE_BOOLEAN,
1,
G_TYPE_OBJECT);
/**
* EphyEmbed::ge-favicon:
* @embed:
* @address: the URL to @embed's web site's favicon
*
* The ::ge_favicon signal is emitted when @embed discovers that a favourite
* icon (favicon) is available for the site it is visiting.
**/
g_signal_new ("ge_favicon",
EPHY_TYPE_EMBED,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (EphyEmbedIface, favicon),
NULL, NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE,
1,
G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE);
/**
* EphyEmbed::ge-search-link:
* @embed:
* @type: the mime-type of the search description
* @title: the title of the news feed
* @address: the URL to @embed's web site's search description
*
* The ::ge_rss signal is emitted when @embed discovers that a search
* description is available for the site it is visiting.
**/
g_signal_new ("ge_search_link",
EPHY_TYPE_EMBED,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (EphyEmbedIface, search_link),
NULL, NULL,
ephy_marshal_VOID__STRING_STRING_STRING,
G_TYPE_NONE,
3,
G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE,
G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE,
G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE);
/**
* EphyEmbed::ge-feed-link:
* @embed:
* @type: the mime-type of the news feed
* @title: the title of the news feed
* @address: the URL to @embed's web site's news feed
*
* The ::ge_rss signal is emitted when @embed discovers that a news feed
* is available for the site it is visiting.
**/
g_signal_new ("ge_feed_link",
EPHY_TYPE_EMBED,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (EphyEmbedIface, feed_link),
NULL, NULL,
ephy_marshal_VOID__STRING_STRING_STRING,
G_TYPE_NONE,
3,
G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE,
G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE,
G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE);
/**
* EphyEmbed::ge-location:
* @embed:
* @address: the new URL @embed is visiting
*
* The ::ge_location signal is emitted when @embed begins to load a new web
* page. For example, if the user clicks on a link or enters an address or if
* the previous web page had JavaScript or a META REFRESH tag.
*
* The ::ge_location signal will be emitted even when @embed is simply
* refreshing the same web page.
**/
g_signal_new ("ge_location",
EPHY_TYPE_EMBED,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (EphyEmbedIface, location),
NULL, NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE,
1,
G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE);
/**
* EphyEmbed::ge-net-state:
* @embed:
* @uri: the URI @embed is loading
* @state: the #EmbedState of @embed
*
* The ::ge_net_state signal is emitted when @embed's network negotiation state
* changes. For example, this will indicate when page loading is complete or
* cancelled.
**/
g_signal_new ("ge_net_state",
EPHY_TYPE_EMBED,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (EphyEmbedIface, net_state),
NULL, NULL,
ephy_marshal_VOID__STRING_FLAGS,
G_TYPE_NONE,
2,
G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE,
EPHY_TYPE_EMBED_NET_STATE);
/**
* EphyEmbed::ge-dom-mouse-click:
* @embed:
* @event: the #EphyEmbedEvent which triggered this signal
*
* The ::ge_dom_mouse_click signal is emitted when the user clicks in @embed.
**/
g_signal_new ("ge_dom_mouse_click",
EPHY_TYPE_EMBED,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EphyEmbedIface, dom_mouse_click),
g_signal_accumulator_true_handled, NULL,
ephy_marshal_BOOLEAN__OBJECT,
G_TYPE_BOOLEAN,
1,
G_TYPE_OBJECT);
/**
* EphyEmbed::ge-dom-mouse-down:
* @embed:
* @event: the #EphyEmbedEvent which triggered this signal
*
* The ::ge_dom_mouse_down signal is emitted when the user depresses a mouse
* button.
**/
g_signal_new ("ge_dom_mouse_down",
EPHY_TYPE_EMBED,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EphyEmbedIface, dom_mouse_down),
g_signal_accumulator_true_handled, NULL,
ephy_marshal_BOOLEAN__OBJECT,
G_TYPE_BOOLEAN,
1,
G_TYPE_OBJECT);
/**
* EphyEmbed::ge-security-change:
* @embed:
* @level: @embed's new #EphyEmbedSecurityLevel
*
* The ::ge_security_change signal is emitted when the security level of @embed
* changes. For example, this will happen when the user browses from an
* insecure website to an SSL-secured one.
**/
g_signal_new ("ge_security_change",
EPHY_TYPE_EMBED,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EphyEmbedIface, security_change),
NULL, NULL,
g_cclosure_marshal_VOID__ENUM,
G_TYPE_NONE,
1,
EPHY_TYPE_EMBED_SECURITY_LEVEL);
/**
* EphyEmbed::ge-zoom-change:
* @embed:
* @zoom: @embed's new zoom level
*
* The ::ge_zoom_change signal is emitted when @embed's zoom changes. This can
* be manual (the user modified the zoom level) or automatic (@embed's zoom is
* automatically changed when browsing to a new site for which the user
* previously specified a zoom level).
*
* A @zoom value of 1.0 indicates 100% (normal zoom).
**/
g_signal_new ("ge_zoom_change",
EPHY_TYPE_EMBED,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EphyEmbedIface, zoom_change),
NULL, NULL,
g_cclosure_marshal_VOID__FLOAT,
G_TYPE_NONE,
1,
G_TYPE_FLOAT);
/**
* EphyEmbed::ge-content-change:
* @embed:
* @uri: URI of the new content
*
* The ::ge_content_change signal is emitted when a new page content
* is being loaded into the browser. It's a good place to do view
* related changes, for example to restore the zoom level of a page
* or to set an user style sheet.
**/
g_signal_new ("ge_content_change",
EPHY_TYPE_EMBED,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (EphyEmbedIface, content_change),
NULL, NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE,
1,
G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE);
/**
* EphyEmbed::ge-modal-alert:
* @embed:
*
* The ::ge-modal-alert signal is emitted when a DOM event will open a
* modal alert.
*
* Return %TRUE to prevent the dialog from being opened.
**/
g_signal_new ("ge_modal_alert",
EPHY_TYPE_EMBED,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EphyEmbedIface, modal_alert),
g_signal_accumulator_true_handled, NULL,
ephy_marshal_BOOLEAN__VOID,
G_TYPE_BOOLEAN,
0);
/**
* EphyEmbed::ge-modal-alert-closed:
* @embed:
*
* The ::ge-modal-alert-closed signal is emitted when a modal alert put up by a
* DOM event was closed.
**/
g_signal_new ("ge_modal_alert_closed",
EPHY_TYPE_EMBED,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EphyEmbedIface, modal_alert_closed),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE,
0);
/**
* EphyEmbed::ge-document-type:
* @embed:
* @type: the new document type
*
* The ::ge-document-type signal is emitted when @embed determines the type of its document.
**/
g_signal_new ("ge_document_type",
EPHY_TYPE_EMBED,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (EphyEmbedIface, document_type),
NULL, NULL,
g_cclosure_marshal_VOID__ENUM,
G_TYPE_NONE,
1,
EPHY_TYPE_EMBED_DOCUMENT_TYPE);
/**
* EphyEmbed::dom-content-loaded:
* @embed:
*
* The ::dom-content-loaded signal is emitted when
* the document has been loaded (excluding images and other loads initiated by this document).
* That's true also for frameset and all the frames within it.
**/
g_signal_new ("dom_content_loaded",
EPHY_TYPE_EMBED,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (EphyEmbedIface, dom_content_loaded),
NULL, NULL,
g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE,
1,
G_TYPE_POINTER);
/**
* EphyEmbed::ge-search-key-press:
* @embed:
* @event: the #GdkEventKey which triggered this signal
*
* The ::ge-search-key-press signal is emitted for keypresses which
* should be used for find implementations.
**/
g_signal_new ("ge-search-key-press",
EPHY_TYPE_EMBED,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EphyEmbedIface, search_key_press),
g_signal_accumulator_true_handled, NULL,
ephy_marshal_BOOLEAN__BOXED,
G_TYPE_BOOLEAN,
1,
GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
/**
* EphyEmbed::close-request
* @embed:
*
* The ::close signal is emitted when the embed request closing.
* Return %TRUE to prevent closing. You HAVE to process removal of the embed
* as soon as possible after that.
**/
g_signal_new ("close-request",
EPHY_TYPE_EMBED,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EphyEmbedIface, close_request),
g_signal_accumulator_true_handled, NULL,
ephy_marshal_BOOLEAN__VOID,
G_TYPE_BOOLEAN,
0);
/**
* EphyEmbed::content-blocked:
* @embed:
* @uri: blocked URI
*
* The ::content-blocked signal is emitted when an url has been blocked.
**/
g_signal_new ("content-blocked",
EPHY_TYPE_EMBED,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EphyEmbedIface, content_blocked),
NULL, NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE,
1,
G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE);
g_object_interface_install_property (g_class,
g_param_spec_enum ("security-level",
"Security Level",
"The embed's security level",
EPHY_TYPE_EMBED_SECURITY_LEVEL,
EPHY_EMBED_STATE_IS_UNKNOWN,
G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
g_object_interface_install_property (g_class,
g_param_spec_enum ("document-type",
"Document Type",
"The embed's documen type",
EPHY_TYPE_EMBED_DOCUMENT_TYPE,
EPHY_EMBED_DOCUMENT_HTML,
G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
g_object_interface_install_property (g_class,
g_param_spec_float ("zoom",
"Zoom",
"The embed's zoom",
ZOOM_MINIMAL,
ZOOM_MAXIMAL,
1.0,
G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
g_object_interface_install_property (g_class,
g_param_spec_int ("load-progress",
"Load progress",
"The embed's load progress in percent",
0,
100,
0,
G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
g_object_interface_install_property (g_class,
g_param_spec_boolean ("load-status",
"Load status",
"The embed's load status",
FALSE,
G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
g_object_interface_install_property (g_class,
g_param_spec_flags ("navigation",
"Navigation flags",
"The embed's navigation flags",
EPHY_TYPE_EMBED_NAVIGATION_FLAGS,
0,
G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
g_object_interface_install_property (g_class,
g_param_spec_string ("address",
"Address",
"The embed's address",
"",
G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
g_object_interface_install_property (g_class,
g_param_spec_string ("typed-address",
"Typed Address",
"The typed address",
"",
G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
g_object_interface_install_property (g_class,
g_param_spec_string ("title",
"Title",
"The embed's title",
_("Blank page"),
G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
g_object_interface_install_property (g_class,
g_param_spec_string ("status-message",
"Status Message",
"The embed's statusbar message",
NULL,
G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
g_object_interface_install_property (g_class,
g_param_spec_string ("link-message",
"Link Message",
"The embed's link message",
NULL,
G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
g_object_interface_install_property (g_class,
g_param_spec_object ("icon",
"Icon",
"The embed icon's",
GDK_TYPE_PIXBUF,
G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
g_object_interface_install_property (g_class,
g_param_spec_string ("icon-address",
"Icon address",
"The embed icon's address",
NULL,
(G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)));
g_object_interface_install_property (g_class,
g_param_spec_int ("hidden-popup-count",
"Number of Blocked Popups",
"The embed's number of blocked popup windows",
0,
G_MAXINT,
0,
G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
g_object_interface_install_property (g_class,
g_param_spec_boolean ("popups-allowed",
"Popups Allowed",
"Whether popup windows are to be displayed",
FALSE,
G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
initialized = TRUE;
}
}
/**
* ephy_embed_load_url:
* @embed: an #EphyEmbed
* @url: a URL
*
* Loads a new web page in @embed.
**/
void
ephy_embed_load_url (EphyEmbed *embed,
const char *url)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
iface->load_url (embed, url);
}
/**
* ephy_embed_load:
* @embed: an #EphyEmbed
* @url: an URL
* @flags: flags modifying load behaviour
* @previous_embed: the referrer embed or %NULL
*
* Loads a new web page in @embed.
**/
void
ephy_embed_load (EphyEmbed *embed,
const char *url,
EphyEmbedLoadFlags flags,
EphyEmbed *referring_embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
iface->load (embed, url, flags, referring_embed);
}
/**
* ephy_embed_stop_load:
* @embed: an #EphyEmbed
*
* If @embed is loading, stops it from continuing.
**/
void
ephy_embed_stop_load (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
iface->stop_load (embed);
}
/**
* ephy_embed_can_go_back:
* @embed: an #EphyEmbed
*
* Return value: %TRUE if @embed can return to a previously-visited location
**/
gboolean
ephy_embed_can_go_back (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->can_go_back (embed);
}
/**
* ephy_embed_can_go_forward:
* @embed: an #EphyEmbed
*
* Return value: %TRUE if @embed has gone back, and can thus go forward again
**/
gboolean
ephy_embed_can_go_forward (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->can_go_forward (embed);
}
/**
* ephy_embed_can_go_up:
* @embed: an #EphyEmbed
*
* Returns whether @embed can travel to a higher-level directory on the server.
* For example, for http://www.example.com/subdir/index.html, returns %TRUE; for
* http://www.example.com/index.html, returns %FALSE.
*
* Return value: %TRUE if @embed can browse to a higher-level directory
**/
gboolean
ephy_embed_can_go_up (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->can_go_up (embed);
}
/**
* ephy_embed_get_go_up_list:
* @embed: an #EphyEmbed
*
* Returns a list of (%char *) URLs to higher-level directories on the same
* server, in order of deepest to shallowest. For example, given
* "http://www.example.com/dir/subdir/file.html", will return a list containing
* "http://www.example.com/dir/subdir/", "http://www.example.com/dir/" and
* "http://www.example.com/".
*
* Return value: a list of URLs higher up in @embed's web page's directory
* hierarchy
**/
GSList *
ephy_embed_get_go_up_list (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->get_go_up_list (embed);
}
/**
* ephy_embed_go_back:
* @embed: an #EphyEmbed
*
* Causes @embed to return to the previously-visited web page.
**/
void
ephy_embed_go_back (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
iface->go_back (embed);
}
/**
* ephy_embed_go_forward:
* @embed: an #EphyEmbed
*
* If @embed has returned to a previously-visited web page, proceed forward to
* the next page.
**/
void
ephy_embed_go_forward (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
iface->go_forward (embed);
}
/**
* ephy_embed_go_up:
* @embed: an #EphyEmbed
*
* Moves @embed one level up in its web page's directory hierarchy.
**/
void
ephy_embed_go_up (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
iface->go_up (embed);
}
/**
* ephy_embed_get_title:
* @embed: an #EphyEmbed
*
* Return value: the title of the web page displayed in @embed
**/
const char *
ephy_embed_get_title (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->get_title (embed);
}
/**
* ephy_embed_get_location:
* @embed: an #EphyEmbed
* @toplevel: %FALSE to return the location of the focused frame only
*
* Returns the URL of the web page displayed in @embed.
*
* If the web page contains frames, @toplevel will determine which location to
* retrieve. If @toplevel is %TRUE, the return value will be the location of the
* frameset document. If @toplevel is %FALSE, the return value will be the
* location of the currently-focused frame.
*
* Return value: the URL of the web page displayed in @embed
**/
char *
ephy_embed_get_location (EphyEmbed *embed,
gboolean toplevel)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->get_location (embed, toplevel);
}
/**
* ephy_embed_get_link_message:
* @embed: an #EphyEmbed
*
* When the user is hovering the mouse over a hyperlink, returns the URL of the
* hyperlink.
*
* Return value: the URL of the link over which the mouse is hovering
**/
const char *
ephy_embed_get_link_message (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->get_link_message (embed);
}
/**
* ephy_embed_get_js_status:
* @embed: an #EphyEmbed
*
* Displays the message JavaScript is attempting to display in the statusbar.
*
* Note that Epiphany does not display JavaScript statusbar messages.
*
* Return value: a message from JavaScript meant to be displayed in the
* statusbar
**/
char *
ephy_embed_get_js_status (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->get_js_status (embed);
}
/**
* ephy_embed_reload:
* @embed: an #EphyEmbed
* @force: %TRUE to bypass cache
*
* Reloads the web page being displayed in @embed.
*
* If @force is %TRUE, cache and proxy will be bypassed when
* reloading the page.
**/
void
ephy_embed_reload (EphyEmbed *embed,
gboolean force)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
iface->reload (embed, force);
}
/**
* ephy_embed_set_zoom:
* @embed: an #EphyEmbed
* @zoom: the new zoom level
*
* Sets the zoom level for a web page.
*
* Zoom is normally controlled by the Epiphany itself and remembered in
* Epiphany's history data. Be very careful not to break this behavior if using
* this function; better yet, don't use this function at all.
**/
void
ephy_embed_set_zoom (EphyEmbed *embed,
float zoom)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
iface->set_zoom (embed, zoom);
}
/**
* ephy_embed_get_zoom:
* @embed: an #EphyEmbed
*
* Returns the zoom level of @embed. A zoom of 1.0 corresponds to 100% (normal
* size).
*
* Return value: the zoom level of @embed
**/
float
ephy_embed_get_zoom (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->get_zoom (embed);
}
/**
* ephy_embed_scroll:
* @embed: an #EphyEmbed
* @num_lines: The number of lines to scroll by
*
* Scrolls the view by lines. Positive numbers scroll down, negative
* numbers scroll up
*
**/
void
ephy_embed_scroll (EphyEmbed *embed,
int num_lines)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
iface->scroll_lines (embed, num_lines);
}
/**
* ephy_embed_page_scroll:
* @embed: an #EphyEmbed
* @num_lines: The number of pages to scroll by
*
* Scrolls the view by pages. Positive numbers scroll down, negative
* numbers scroll up
*
**/
void
ephy_embed_page_scroll (EphyEmbed *embed,
int num_pages)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
iface->scroll_pages (embed, num_pages);
}
/**
* ephy_embed_scroll_pixels:
* @embed: an #EphyEmbed
* @dx: the number of pixels to scroll in X direction
* @dy: the number of pixels to scroll in Y direction
*
* Scrolls the view by pixels. Positive numbers scroll down resp. right,
* negative numbers scroll up resp. left.
*
**/
void
ephy_embed_scroll_pixels (EphyEmbed *embed,
int dx,
int dy)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
iface->scroll_pixels (embed, dx, dy);
}
/**
* ephy_embed_shistory_n_items:
* @embed: an #EphyEmbed
*
* Returns the number of items in @embed's history. In other words, returns the
* number of pages @embed has visited.
*
* The number is upper-bound by Mozilla's browser.sessionhistory.max_entries
* preference.
*
* Return value: the number of items in @embed's history
**/
int
ephy_embed_shistory_n_items (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->shistory_n_items (embed);
}
/**
* ephy_embed_shistory_get_nth:
* @embed: an #EphyEmbed
* @nth: index of the desired page in @embed's browser history
* @is_relative: if %TRUE, add @embed's current history position to @nth
* @url: returned value of the history entry's URL
* @title: returned value of the history entry's title
*
* Fetches the @url and @title of the @nth item in @embed's session history.
* If @is_relative is %TRUE, @nth is an offset from the browser's current
* history position. For example, calling this function with @is_relative %TRUE
* and @nth %0 will return the URL and title of the current page.
**/
void
ephy_embed_shistory_get_nth (EphyEmbed *embed,
int nth,
gboolean is_relative,
char **url,
char **title)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
iface->shistory_get_nth (embed, nth, is_relative, url, title);
}
/**
* ephy_embed_shistory_get_pos:
* @embed: an #EphyEmbed
*
* Returns @embed's current position in its history. If the user never uses the
* "Back" button, this number will be the same as the return value of
* ephy_embed_shistory_n_items().
*
* Return value: @embed's current position in its history
**/
int
ephy_embed_shistory_get_pos (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->shistory_get_pos (embed);
}
/**
* ephy_embed_shistory_go_nth:
* @embed: an #EphyEmbed
* @nth: desired history index
*
* Opens the webpage at location @nth in @embed's history.
**/
void
ephy_embed_shistory_go_nth (EphyEmbed *embed,
int nth)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
iface->shistory_go_nth (embed, nth);
}
/**
* ephy_embed_shistory_copy:
* @source: the #EphyEmbed to copy the history from
* @dest: the #EphyEmbed to copy the history to
* @copy_back: %TRUE to copy the back history
* @copy_forward: %TRUE to copy the forward history
* @copy_current: %TRUE to set the current page to that in the copied history
*
* Copy's the back and/or forward history from @source to @dest,
* and optionally set @dest to the current page of @source as well.
**/
void
ephy_embed_shistory_copy (EphyEmbed *source,
EphyEmbed *dest,
gboolean copy_back,
gboolean copy_forward,
gboolean copy_current)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (source);
iface->shistory_copy (source, dest, copy_back, copy_forward, copy_current);
}
/**
* ephy_embed_get_security_level:
* @embed: an #EphyEmbed
* @level: return value of security level
* @description: return value of the description of the security level
*
* Fetches the #EphyEmbedSecurityLevel and a newly-allocated string description
* of the security state of @embed.
**/
void
ephy_embed_get_security_level (EphyEmbed *embed,
EphyEmbedSecurityLevel *level,
char **description)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
iface->get_security_level (embed, level, description);
}
/**
* ephy_embed_show_page_certificate:
* @embed: an #EphyEmbed
*
* Shows a dialogue displaying the certificate of the currently loaded page
* of @embed, if it was loaded over a secure connection; else does nothing.
**/
void
ephy_embed_show_page_certificate (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
iface->show_page_certificate (embed);
}
/**
* ephy_embed_close:
* @embed: an #EphyEmbed
*
* Closes the @embed
**/
void
ephy_embed_close (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
iface->close (embed);
}
/**
* ephy_embed_set_encoding:
* @embed: an #EphyEmbed
* @encoding: the desired encoding
*
* Sets @embed's character encoding to @encoding. These cryptic encoding
* strings are listed in <filename>embed/ephy-encodings.c</filename>.
*
* Pass an empty string (not NULL) in @encoding to reset @embed to use the
* document-specified encoding.
**/
void
ephy_embed_set_encoding (EphyEmbed *embed,
const char *encoding)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
iface->set_encoding (embed, encoding);
}
/**
* ephy_embed_get_encoding:
* @embed: an #EphyEmbed
*
* Returns the @embed's document's encoding
**/
char *
ephy_embed_get_encoding (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->get_encoding (embed);
}
/**
* ephy_embed_has_automatic_encoding:
* @embed: an #EphyEmbed
*
* Returns whether the @embed's document's was determined by the document itself
**/
gboolean
ephy_embed_has_automatic_encoding (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->has_automatic_encoding (embed);
}
/**
* ephy_embed_print:
* @embed: an #EphyEmbed
*
* Sends a document to the printer.
*
**/
void
ephy_embed_print (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
iface->print (embed);
}
/**
* ephy_embed_set_print_preview_mode:
* @embed: an #EphyEmbed
* @preview_mode: Whether the print preview mode is enabled.
*
* Enable and disable the print preview mode.
**/
void
ephy_embed_set_print_preview_mode (EphyEmbed *embed,
gboolean preview_mode)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
iface->set_print_preview_mode (embed, preview_mode);
}
/**
* ephy_embed_print_preview_n_pages:
* @embed: an #EphyEmbed
*
* Returns the number of pages which would appear in @embed's loaded document
* if it were to be printed.
*
* Return value: the number of pages in @embed's loaded document
**/
int
ephy_embed_print_preview_n_pages (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->print_preview_n_pages (embed);
}
/**
* ephy_embed_print_preview_navigate:
* @embed: an #EphyEmbed
* @type: an #EphyPrintPreviewNavType which determines where to navigate
* @page: if @type is %EPHY_EMBED_PRINTPREVIEW_GOTO_PAGENUM, the desired page number
*
* Navigates @embed's print preview.
**/
void
ephy_embed_print_preview_navigate (EphyEmbed *embed,
EphyEmbedPrintPreviewNavType type,
int page)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
iface->print_preview_navigate (embed, type, page);
}
/**
* ephy_embed_has_modified_forms:
* @embed: an #EphyEmbed
*
* Returns %TRUE if the user has modified <input> or <textarea>
* values in @embed's loaded document.
*
* Return value: %TRUE if @embed has user-modified forms
**/
gboolean
ephy_embed_has_modified_forms (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->has_modified_forms (embed);
}
/**
* ephy_embed_get_document_type:
* @embed: an #EphyEmbed
*
* Returns the type of document loaded in the @embed
*
* Return value: the #EphyEmbedDocumentType
**/
EphyEmbedDocumentType
ephy_embed_get_document_type (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->get_document_type (embed);
}
/**
* ephy_embed_get_load_percent:
* @embed: an #EphyEmbed
*
* Returns the page load percentage (displayed in the progressbar).
*
* Return value: a percentage from 0 to 100.
**/
int
ephy_embed_get_load_percent (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->get_load_percent (embed);
}
/**
* ephy_embed_get_load_status:
* @embed: an #EphyEmbed
*
* Returns whether the web page in @embed has finished loading. A web page is
* only finished loading after all images, styles, and other dependencies have
* been downloaded and rendered.
*
* Return value: %TRUE if the page is still loading, %FALSE if complete
**/
gboolean
ephy_embed_get_load_status (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->get_load_status (embed);
}
/**
* ephy_embed_get_navigation_flags:
* @embed: an #EphyEmbed
*
* Returns @embed's navigation flags.
*
* Return value: @embed's navigation flags
**/
EphyEmbedNavigationFlags
ephy_embed_get_navigation_flags (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->get_navigation_flags (embed);
}
/**
* ephy_embed_get_typed_address:
* @embed: an #EphyEmbed
*
* Returns the text that @embed's #EphyWindow will display in its location toolbar
* entry when @embed is selected.
*
* This is not guaranteed to be the same as @embed's location,
* available through ephy_embed_get_location(). As the user types a new address
* into the location entry, ephy_embed_get_location()'s returned string will
* change.
*
* Return value: @embed's #EphyWindow's location entry when @embed is selected
**/
const char *
ephy_embed_get_typed_address (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->get_typed_address (embed);
}
/**
* ephy_embed_set_typed_address:
* @embed: an #EphyEmbed
* @address: the new typed address, or %NULL to clear it
* @expire: when to expire this address_expire
*
* Sets the text that @embed's #EphyWindow will display in its location toolbar
* entry when @embed is selected.
**/
void
ephy_embed_set_typed_address (EphyEmbed *embed,
const char *address,
EphyEmbedAddressExpire expire)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->set_typed_address (embed, address, expire);
}
/**
* ephy_embed_get_address:
* @embed: an #EphyEmbed
*
* Returns the address of the currently loaded page.
*
* Return value: @embed's address. Will never be %NULL.
**/
const char *
ephy_embed_get_address (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->get_address (embed);
}
/**
* ephy_embed_get_status_message:
* @embed: an #EphyEmbed
*
* Returns the message displayed in @embed's #EphyWindow's
* #EphyStatusbar. If the user is hovering the mouse over a hyperlink,
* this function will return the same value as
* ephy_embed_get_link_message(). Otherwise, it will return a network
* status message, or NULL.
*
* The message returned has a limited lifetime, and so should be copied with
* g_strdup() if it must be stored.
*
* Return value: The current statusbar message
**/
const char *
ephy_embed_get_status_message (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->get_status_message (embed);
}
/**
* ephy_embed_get_icon:
* @embed: an #EphyEmbed
*
* Returns the embed's site icon as a #GdkPixbuf,
* or %NULL if it is not available.
*
* Return value: a the embed's site icon
**/
GdkPixbuf *
ephy_embed_get_icon (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->get_icon (embed);
}
/**
* ephy_embed_get_icon_address:
* @embed: an #EphyEmbed
*
* Returns a URL which points to @embed's site icon.
*
* Return value: the URL of @embed's site icon
**/
const char *
ephy_embed_get_icon_address (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->get_icon_address (embed);
}
/**
* ephy_embed_get_is_blank:
* @embed: an #EphyEmbed
*
* Returns whether the @embed's address is "blank".
*
* Return value: %TRUE if the @embed's address is "blank"
**/
gboolean
ephy_embed_get_is_blank (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->get_is_blank (embed);
}
const char *
ephy_embed_get_loading_title (EphyEmbed *embed)
{
EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
return iface->get_loading_title (embed);
}
|